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
moResourceManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  moResourceManager.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 
33 #ifndef __MORESOURCESMANAGER_H
34 #define __MORESOURCESMANAGER_H
35 
36 #include "moTypes.h"
37 #include "moArray.h"
38 #include "moMoldeoObject.h"
39 
40 #define MO_CFG_RESOURCE 0
41 #define MO_CFG_RESOURCE_CONFIG 1
42 #define MO_CFG_RESOURCE_LABEL 2
43 
45 
52  /*UNDEFINED*/
54  /*INTERNAL CORE*/
73  /*EXTRAS*/
80 
81  /*RESERVED*/
86 };
87 
88 #define MO_CFG_RESOURCE 0
89 #define MO_CFG_RESOURCE_CONFIG 1
90 #define MO_CFG_RESOURCE_LABEL 2
91 
93 
104 
105  public:
107  moResourceElement( moResourceType p_type) { m_ResourceType = p_type; }
108  virtual ~moResourceElement() {}
109  virtual MOboolean Init( moResourceManager* p_rm ) {
110  SetResourceManager(p_rm);
111  return moAbstract::Init();
112  }
113  virtual void SetResourceManager( moResourceManager* p_rm ) {
114  m_pResourceManager = p_rm;
115  }
117  return m_pResourceManager;
118  }
120  return m_ResourceType;
121  }
122  protected:
125 };
126 
127 
129 
153 
154  public:
155 
159  moResource();
160 
164  virtual ~moResource();
165 
169  virtual MOboolean Init();
170 
174  virtual MOboolean Finish();
175 
180  moResourceType GetResourceType();
181 
182  protected:
183  void SetResourceType( moResourceType p_restype );
184 
185  private:
186  moResourceType m_ResourceType;
187  moText m_ResourceName;
188 
189 };
190 
192 
194 
195 class moDebugManager;
196 class moNetManager;
197 class moFileManager;
198 class moVideoManager;
199 class moFilterManager;
200 class moTimeManager;
201 class moDataManager;
202 class moFBManager;
203 class moGLManager;
204 class moRenderManager;
205 class moShaderManager;
206 class moMathManager;
207 class moFontManager;
208 class moGUIManager;
209 class moScriptManager;
210 class moTextureManager;
211 class moSoundManager;
212 class mo3dModelManager;
213 class moDecoderManager;
214 
215 
216 #include "moResourcePlugin.h"
217 
219 
225 
226  public:
227 
232  virtual ~moResourceManager();
233 
239  virtual MOboolean Init( const moText& p_apppath,
240  const moText& p_datapath,
241  moConfig& p_consoleconfig,
242  MOint p_render_to_texture_mode=0,
243  MOint p_screen_width=320,
244  MOint p_screen_height=240,
245  MOint p_render_width=320,
246  MOint p_render_height=240,
247  MO_HANDLE p_OpWindowHandle = 0,
248  MO_DISPLAY p_Display = NULL );
252  virtual MOboolean Finish();
253 
259  moResource* NewResource( const moText& p_resname, const moText& p_configname, const moText& p_labelname, const moText& p_keyname, int paramindex = -1, int valueindex = -1, bool p_activate=true );
260 
266  MOboolean AddResource( moResource* m_pResource );
267 
273  MOboolean RemoveResource( MOint p_index );
274 
280  MOint GetResourceIndex( moText p_labelname );
281 
287  moText GetResourceName( MOint p_index );
288 
292  moText GetResourceLabelName( MOint p_index );
293 
299  moResource* GetResource( MOint p_index );
300 
306  moResourceType GetResourceType( MOint p_index );
307 
313  moResource* GetResourceByType( moResourceType p_type );
314 
320  moResources& Resources();
321 
322  //predefined managers: 14
328  moFileManager* GetFileMan() { return MOFileMan; }
329 
335  moVideoManager* GetVideoMan() { return MOVideoMan; }
336 
342  moFilterManager* GetFilterMan() { return MOFilterMan; }
343 
349  moNetManager* GetNetMan() { return MONetMan; }
350 
356  moDataManager* GetDataMan() { return MODataMan; }
357 
363  moTimeManager* GetTimeMan() { return MOTimeMan; }
364 
370  moFBManager* GetFBMan() { return MOFBMan; }
371 
377  moGLManager* GetGLMan() { return MOGLMan; }
378 
384  moRenderManager* GetRenderMan() { return MORenderMan; }
385 
391  moMathManager* GetMathMan() { return MOMathMan; }
392 
398  moShaderManager* GetShaderMan() { return MOShaderMan; }
399 
405  moFontManager* GetFontMan() { return MOFontMan; }
406 
412  moGUIManager* GetGuiMan() { return MOGuiMan; }
413 
419  moScriptManager* GetScriptMan() { return MOScriptMan; }
420 
426  moTextureManager* GetTextureMan() { return MOTextureMan; }
427 
433  moSoundManager* GetSoundMan() { return MOSoundMan; }
434 
440  mo3dModelManager* GetModelMan() { return MOModelMan; }
441 
447  moDebugManager* GetDebugMan() { return MODebugMan; }
448 
449 
455  moDecoderManager* GetDecoderMan() { return MODecoderMan; }
456 
457  private:
458 
459  //predefined managers
460  moFileManager* MOFileMan;
461  moVideoManager* MOVideoMan;
462  moFilterManager* MOFilterMan;
463  moNetManager* MONetMan;
464  moTimeManager* MOTimeMan;
465  moDataManager* MODataMan;
466  moFBManager* MOFBMan;
467  moGLManager* MOGLMan;
468  moRenderManager* MORenderMan;
469  moShaderManager* MOShaderMan;
470  moMathManager* MOMathMan;
471  moFontManager* MOFontMan;
472  moGUIManager* MOGuiMan;
473  moScriptManager* MOScriptMan;
474  moTextureManager* MOTextureMan;
475  moSoundManager* MOSoundMan;
476  mo3dModelManager* MOModelMan;
477  moDebugManager* MODebugMan;
478  moDecoderManager* MODecoderMan;
479 
480 
481  moResources m_Resources;
482 
483  moResourcePluginsArray m_Plugins;
484 
485 };
486 
487 
488 #endif
489 
Manejador de archivos.
moResource * moResourcePtr
moVideoManager * GetVideoMan()
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 )
virtual MOboolean Finish()
Finaliza el objeto, libera recursos.
Definition: moAbstract.cpp:147
mo3dModelManager * GetModelMan()
moResourceType
Tipos de recursos que se pueden implementar.
moRenderManager * GetRenderMan()
virtual MOboolean Init(moResourceManager *p_rm)
#define MOboolean
Definition: moTypes.h:385
moFontManager * GetFontMan()
Administrador de sonidos.
Administrador de recursos GUI.
Definition: moGUIManager.h:646
administrator de fuentes
Clase base abstracta de donde deben derivar los objetos [virtual pura].
Definition: moAbstract.h:191
virtual MOboolean Init()
Inicializa el objeto.
Definition: moAbstract.cpp:141
moDebugManager * GetDebugMan()
Administrador de scripts (LUA)
moGLManager * GetGLMan()
#define LIBMOLDEO_API
Definition: moTypes.h:180
moSoundManager * GetSoundMan()
moShaderManager * GetShaderMan()
moMathManager * GetMathMan()
clase de para manejar textos
Definition: moText.h:75
virtual void SetResourceManager(moResourceManager *p_rm)
moResourceElement(moResourceType p_type)
moDecoderManager * GetDecoderMan()
moGUIManager * GetGuiMan()
#define MOint
Definition: moTypes.h:388
moFileManager * GetFileMan()
Clase Base para Objetos Moldeo ( moEffect, moIODevice, moResource, moConsole )
moDeclareExportedDynamicArray(moResourcePtr, moResources)
Administrador de recursos.
virtual moResourceManager * GetResourceManager()
moScriptManager * GetScriptMan()
moFBManager * GetFBMan()
Clase que implementa un administrador de shaders.
moFilterManager * GetFilterMan()
manejador de operaciones comunes de Open GL
Definition: moGLManager.h:154
moNetManager * GetNetMan()
moDataManager * GetDataMan()
Clase para el manejo de los temporizadores en Moldeo.
Definition: moTimeManager.h:64
moResourceType GetResourceType()
moTimeManager * GetTimeMan()
moResourceType m_ResourceType
virtual ~moResourceElement()
virtual MOboolean Finish()
moTextureManager * GetTextureMan()
almacena la configuración de los parámetros de un objeto en un archivo XML
Definition: moConfig.h:193
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 )
virtual MOboolean Init()
moResourceManager * m_pResourceManager