Code_TYMPAN  4.4.0
Industrial site acoustic simulation
OGLShaderManager.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
14  */
15 
27 #ifndef __O_SHADER_MANAGER__
28 #define __O_SHADER_MANAGER__
29 
34 #include <qopenglcontext.h>
35 #include <qopenglshaderprogram.h>
36 
42 {
43 public:
44  enum ShaderId
45  {
47  };
48 
53  static OGLShaderManager* instance(QOpenGLContext* context);
54 
58  QOpenGLShaderProgram* getShaderProgram(ShaderId shaderId);
59 
60 private:
61  /*
62  * Initialize new shader manager usable by a given context.
63  */
64  OGLShaderManager(QOpenGLContext* context);
65 
66  ~OGLShaderManager() = default;
67 
68  void initializeShaders();
69 
70  QOpenGLShaderProgram simpleShader;
71 
72  static QMap<QOpenGLContextGroup*, OGLShaderManager*> instances;
73 };
74 
75 #endif // __O_SHADER_MANAGER__
classe permettant d'accède a des shaders
~OGLShaderManager()=default
static QMap< QOpenGLContextGroup *, OGLShaderManager * > instances
static OGLShaderManager * instance(QOpenGLContext *context)
QOpenGLShaderProgram simpleShader
QOpenGLShaderProgram * getShaderProgram(ShaderId shaderId)
OGLShaderManager(QOpenGLContext *context)