libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
moShaderManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  moShaderManager.h
4 
5  ****************************************************************************
6  * *
7  * This source is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This code is distributed in the hope that it will be useful, but *
13  * WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15  * General Public License for more details. *
16  * *
17  * A copy of the GNU General Public License is available on the World *
18  * Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
19  * obtain it by writing to the Free Software Foundation, *
20  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  * *
22  ****************************************************************************
23 
24  Copyright(C) 2006 Fabricio Costa
25 
26  Authors:
27  Fabricio Costa
28 
29 
30 *******************************************************************************/
31 
32 #ifndef __MO_SHADER_MANAGER_H
33 #define __MO_SHADER_MANAGER_H
34 
35 #include "moTypes.h"
36 #include "moAbstract.h"
37 #include "moText.h"
38 #include "moParam.h"
39 #include "moConfig.h"
40 #include "moShader.h"
41 #include "moShaderGLSL.h"
42 #include "moShaderCG.h"
43 
44 #include "moResourceManager.h"
45 #include "moGLManager.h"
46 #include "moFBManager.h"
47 
48 
50 
52 
56 {
57 public:
62 
66  virtual ~moShaderManager() {}
67 
72  virtual MOboolean Init();
73 
78  virtual MOboolean Finish();
79 
83  void Delete() { m_shaders_array.Empty(); }
84 
93  MOint GetShaderIndex(moText p_name, MOboolean p_create_shader);
101  MOint AddShader(MOuint p_type, moText p_name);
108  MOint AddShader(moText p_filename);
120  MOint AddShader(MOuint p_type, moText p_name, moText p_vert_fn, moText p_frag_fn, moTexturedGrid p_tex_grid);
121 
127  MOboolean DeleteShader(MOint p_idx);
128 
133  MOuint GetShaderCount() { return m_shaders_array.Count(); }
139  moShader* GetShader(MOuint p_idx) { return m_shaders_array[p_idx]; }
140 
142  return m_pTextureFilterIndex;
143  }
144 
146  return m_RenderShader;
147  }
148 
150  return m_RenderShaderPositionIndex;
151  }
152 
154  return m_RenderShaderColorsIndex;
155  }
156 
158  return m_RenderShaderColorIndex;
159  }
160 
162  return m_RenderShaderOpacityIndex;
163  }
164 
166  return m_RenderShaderTextureIndex;
167  }
168 
170  return m_RenderShaderNormalIndex;
171  }
172 
174  return m_RenderShaderProjectionMatrixIndex;
175  }
176 
178  return m_RenderShaderTexCoordIndex;
179  }
180 
182  return m_RenderShaderTexCoordEdgeIndex;
183  }
184 
186  return m_RenderShaderWireframeWidthIndex;
187  }
188 
190  return m_RenderShaderTexWSegmentsIndex;
191  }
193  return m_RenderShaderTexHSegmentsIndex;
194  }
196  return m_RenderShaderLightIndex;
197  }
198 
199 private:
200  moGLManager* m_glmanager;
201  moFBManager* m_fbmanager;
202 
203  moShaderGLSL m_RenderShader;
204 
205  MOuint m_RenderShaderColorIndex;
206  MOuint m_RenderShaderOpacityIndex;
207  MOuint m_RenderShaderColorsIndex;
208  MOuint m_RenderShaderPositionIndex;
209  MOuint m_RenderShaderTextureIndex;
210  MOuint m_RenderShaderNormalIndex;
211  MOuint m_RenderShaderProjectionMatrixIndex;
212  MOuint m_RenderShaderTexCoordIndex;
213  MOuint m_RenderShaderTexCoordEdgeIndex;
214  MOuint m_RenderShaderWireframeWidthIndex;
215  MOuint m_RenderShaderTexWSegmentsIndex;
216  MOuint m_RenderShaderTexHSegmentsIndex;
217  MOuint m_RenderShaderLightIndex;
218 
227  moTextureFilterIndex* m_pTextureFilterIndex;
228  moShaderArray m_shaders_array;
229 
230  /*moDirectories m_ShaderDirectories;*/
231 };
232 
233 
234 #endif
235 
MOuint GetRSHTexHSegmentsIndex()
MOuint GetRSHProjectionMatrixIndex()
Recurso ( objeto para cargar y manipular objetos físicos de datos de imágenes, audio, video, 3d, 2d, fuentes, shaders y de cualquier otro tipo extendible por un plugin )
MOuint GetRSHTexCoordEdgeIndex()
moShaderGLSL & GetRenderShader()
#define MOboolean
Definition: moTypes.h:385
MOuint GetRSHNormalIndex()
MOuint GetRSHLightIndex()
moTextureFilterIndex * GetTextureFilterIndex()
MOuint GetRSHTextureIndex()
MOuint GetRSHColorIndex()
#define LIBMOLDEO_API
Definition: moTypes.h:180
virtual MOboolean Init()
clase de para manejar textos
Definition: moText.h:75
MOuint GetRSHOpacityIndex()
#define MOint
Definition: moTypes.h:388
MOuint GetRSHTexCoordIndex()
MOuint GetRSHPositionIndex()
moShader * GetShader(MOuint p_idx)
MOuint GetRSHColorsIndex()
Clase que implementa un administrador de shaders.
manejador de operaciones comunes de Open GL
Definition: moGLManager.h:154
virtual MOboolean Finish()
MOuint GetShaderCount()
MOuint GetRSHTexWSegmentsIndex()
#define MOuint
Definition: moTypes.h:387
virtual ~moShaderManager()
MOuint GetRSHWireframeWidthIndex()