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
moTextureIndex.h
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  moTextureIndex.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_TEXTURE_INDEX_H
33 #define __MO_TEXTURE_INDEX_H
34 
35 #include "moTypes.h"
36 #include "moAbstract.h"
37 #include "moConfig.h"
38 #include "moParam.h"
39 #include "moMoldeoObject.h"
40 
41 class moTextureManager;
42 
50 {
51 public:
55  moTextureIndex() { m_textures_array.Init(0, NULL); }
59  virtual ~moTextureIndex() { Finish(); }
60 
68  virtual MOboolean Init(moConfig* p_cfg, MOuint p_param_idx, moTextureManager* p_tex_man)
69  { LoadTextures(p_cfg, p_param_idx, p_tex_man); return true; }
77  virtual MOboolean Init(moConfig* p_cfg, moParamReference p_param_ref, moTextureManager* p_tex_man)
78  { LoadTextures(p_cfg, p_cfg->GetConfigDefinition()->ParamIndexes().GetRef(p_param_ref.reference).index, p_tex_man); return true; }
83  virtual MOboolean Finish() { m_textures_array.Finish(); return true; }
84 
91  MOint Add(moText p_name, moTextureManager* p_tex_man);
97  MOint Add(moTexture* p_tex);
98 
104  MOuint GetGLId(MOuint p_idx);
111  MOuint GetGLId(MOuint p_idx, MOint p_cuad);
119  MOuint GetGLId(MOuint p_idx, MOfloat p_cycle);
126  MOuint GetGLId(MOuint p_idx, moTempo *p_tempo);
127 
128 
135  MOuint GetGLId(MOuint p_idx, moMoldeoObject *p_mob);
141  MOint GetType(MOuint p_idx);
147  moTexture* GetTexture(MOuint p_idx);
148 
154  MOboolean ValidIndex(MOuint p_idx);
159  moTextureArray GetTextureArray() { return m_textures_array; } // Deberia devolver referencia constante!
164  MOuint Count() { return m_textures_array.Count(); }
170  moTexture* operator [](MOuint p_idx) { return GetTexture(p_idx); }
171 private:
172  moTextureArray m_textures_array;
173 
174  MOuint LoadTextures(moConfig* p_cfg, MOuint p_param_idx, moTextureManager* p_tex_man);
175 };
176 
177 #endif
178 
Tempo, beat, ritmo.
Definition: moTempo.h:44
virtual MOboolean Finish()
Finaliza el objeto, libera recursos.
Definition: moAbstract.cpp:147
#define MOboolean
Definition: moTypes.h:385
virtual MOboolean Init(moConfig *p_cfg, moParamReference p_param_ref, moTextureManager *p_tex_man)
Clase base abstracta de donde deben derivar los objetos [virtual pura].
Definition: moAbstract.h:191
#define LIBMOLDEO_API
Definition: moTypes.h:180
#define MOfloat
Definition: moTypes.h:403
clase de para manejar textos
Definition: moText.h:75
moParamIndexes & ParamIndexes()
Devuelve el puntero al arreglo de índices de los parámetros.
Definition: moConfig.h:97
virtual MOboolean Finish()
#define MOint
Definition: moTypes.h:388
Clase Base para Objetos Moldeo ( moEffect, moIODevice, moResource, moConsole )
clase base para el manejo de una textura
Definition: moTexture.h:78
moConfigDefinition * GetConfigDefinition()
Devuelve el puntero al objeto de definición de la configuración
Definition: moConfig.cpp:1572
moTextureArray GetTextureArray()
MOlong reference
Definition: moParam.h:98
virtual ~moTextureIndex()
virtual MOboolean Init(moConfig *p_cfg, MOuint p_param_idx, moTextureManager *p_tex_man)
#define MOuint
Definition: moTypes.h:387
almacena la configuración de los parámetros de un objeto en un archivo XML
Definition: moConfig.h:193
const Real * operator[](int iRow) const