134 text =
moText(
"Error(moTextureIndex): the index: ");
136 text +=
moText(
" does not exists.");
145 moText TextureFilterLabelName =
"";
151 return TextureFilterLabelName;
180 moTextureArray src_tex, dest_tex;
183 MOuint dest_width, dest_height;
184 moText name, extension, left;
192 reading_src_tex =
true;
200 for (j = 0; j < nFilterParts; j++)
215 if (extension ==
moText(
"cfg"))
217 reading_src_tex =
false;
220 else if (reading_src_tex)
231 else error_code =
LoadDestTexture(name, dest_tex, dest_width, dest_height);
248 MODebug2->
Error(
"Error in creating filter: cannot load shader");
249 else if (error_code == 2)
250 MODebug2->
Error(
"Error in creating filter: cannot load source texture");
251 else if (error_code == 3)
252 MODebug2->
Error(
"Error in creating filter: cannot read resolution of destination texture");
253 else if (error_code == 4)
254 MODebug2->
Error(
"Error in creating filter: cannot create destination texture");
270 MOuint nFilters, nFilterParts;
276 moTextureArray src_tex, dest_tex;
279 MOuint dest_width, dest_height;
280 moText name, extension, left;
285 for (i = 0; i < nFilters; i++)
289 reading_src_tex =
true;
294 for (j = 0; j < nFilterParts; j++)
301 if (extension ==
moText(
"cfg"))
303 reading_src_tex =
false;
306 else if (reading_src_tex)
317 else error_code =
LoadDestTexture(name, dest_tex, dest_width, dest_height);
321 if (pshader==NULL) error_code = 1;
335 MODebug2->
Error(
"Error in creating filter: cannot load shader");
336 else if (error_code == 2)
337 MODebug2->
Error(
"Error in creating filter: cannot load source texture");
338 else if (error_code == 3)
339 MODebug2->
Error(
"Error in creating filter: cannot read resolution of destination texture");
340 else if (error_code == 4)
341 MODebug2->
Error(
"Error in creating filter: cannot create destination texture");
359 MOuint nFilters, nFilterParts;
365 moTextureArray src_tex, dest_tex;
368 MOuint dest_width, dest_height;
369 moText name, extension, left;
375 for (i = 0; i < nFilters; i++)
379 reading_src_tex =
true;
384 for (j = 0; j < nFilterParts; j++)
391 if (extension ==
moText(
"cfg"))
393 reading_src_tex =
false;
396 else if (reading_src_tex)
407 else error_code =
LoadDestTexture(name, dest_tex, dest_width, dest_height);
411 if (pshader==NULL) error_code = 1;
425 MODebug2->
Error(
"Error in creating filter: cannot load shader");
426 else if (error_code == 2)
427 MODebug2->
Error(
"Error in creating filter: cannot load source texture");
428 else if (error_code == 3)
429 MODebug2->
Error(
"Error in creating filter: cannot read resolution of destination texture");
430 else if (error_code == 4)
431 MODebug2->
Error(
"Error in creating filter: cannot create destination texture");
453 moTextureArray src_tex, dest_tex;
456 MOuint dest_width, dest_height;
457 moText name, extension, left, tmp;
459 nFilters = p_filters_str->Count();
460 for (i = 0; i < nFilters; i++)
462 reading_src_tex =
true;
467 tmp = p_filters_str->Get(i);
479 if (extension ==
moText(
"cfg"))
481 reading_src_tex =
false;
484 else if (reading_src_tex)
495 else error_code =
LoadDestTexture(name, dest_tex, dest_width, dest_height);
499 if (pshader==NULL) error_code = 1;
519 MODebug2->
Error(
"Error in creating filter: cannot load shader");
520 else if (error_code == 2)
521 MODebug2->
Error(
"Error in creating filter: cannot load source texture");
522 else if (error_code == 3)
523 MODebug2->
Error(
"Error in creating filter: cannot read resolution of destination texture");
524 else if (error_code == 4)
525 MODebug2->
Error(
"Error in creating filter: cannot create destination texture");
570 moText tmp_width, tmp_height;
576 tmp_height.
Mid(1, l - 1);
579 tmp_width.
Mid(4, tmp_width.
Length() - l - 4);
581 dest_width = atoi(tmp_width);
582 dest_height = atoi(tmp_height);
617 MOint idx, total_tex_count;
621 GLint internal_format0;
623 MOboolean first_tex, test, compatible_tex;
631 compatible_tex =
true;
636 total_tex_count += dest_tex->
Count();
637 for (j = 0; j < dest_tex->
Count(); j++)
657 compatible_tex =
false;
672 if (pfbo == NULL)
return;
681 for (j = 0; j < dest_tex->
Count(); j++)
700 for (j = 0; j < dest_tex->
Count(); j++)
717 for (j = 0; j < dest_tex->
Count(); j++)
MOint LoadSourceTexture(moText &name, moTextureArray &src_tex, MOboolean first_tex, MOuint &dest_width, MOuint &dest_height)
MOint Add(moTextureFilter *p_filter)
moTextureFilterArray m_filters_array
void Error(moText p_text)
Anuncia y registra un error.
virtual MOboolean Finish()
moValueBase & GetSubValue(MOint p_indexsubvalue=0)
void Apply(MOuint p_idx, MOuint p_i, MOfloat p_fade, const moTextFilterParam &p_params)
bool NextValue()
Selecciona el próximo valor del parámetro actual.
MOint AddTexture(MOuint p_type, moText p_name, moTexParam p_tex_param=MODefTex2DParams)
virtual MOboolean Init()
Inicializa el objeto.
void AddSubValue(const moText &strvalue, moValueType p_valuetype)
MOint LoadShader(moText &name, moShader **pshader)
MOint LoadDestTexture(const moText &name, moTextureArray &dest_tex, MOuint dest_width, MOuint dest_height)
clase de para manejar textos
moTexture * GetTexture(MOuint p_moid)
MOint TextureFilterExists(moValue *p_value)
void SetFBOAttachPoint(MOuint p_fbo_attach_point)
virtual ~moTextureFilterIndex()
moTypes MOint moText moParamIndex moParamReference int iRow int int i int i
void SetFBO(moFBO *p_fbo)
moTexture * GetTexture(MOuint p_idx)
MOuint AddTexture(MOuint p_width, MOuint p_height, const moTexParam &p_param, MOuint p_glid, MOuint &p_attach_point)
#define MO_MAX_COLOR_ATTACHMENTS_EXT
moShaderManager * m_shaman
moText0 & Mid(MOuint, MOuint)
moText MakeTextureFilterLabelName(moValue *p_value)
moText GetTextureFilterLabelName()
MOint LoadDestTexResolution(const moText &name, MOuint &dest_width, MOuint &dest_height)
MOboolean ValidIndex(MOuint p_idx)
MOint GetTextureMOId(moParam *param, MOboolean p_create_tex)
clase base para el manejo de una textura
moShader * GetShader(MOuint p_idx)
MOuint LoadFilter(moValue *p_value)
moFBO * GetFBO(MOuint p_fbo)
Clase que implementa un administrador de shaders.
manejador de operaciones comunes de Open GL
static moDebug * MODebug2
Clase de impresión de errores para depuración.
virtual MOboolean Init(moGLManager *p_glman, moRenderManager *p_renderman, moTextureArray &p_src_tex, moTextureArray &p_dest_tex, moShader *p_shader, const moTextFilterParam &p_params)
moRenderManager * m_renderman
moValue & GetValue(MOint i=-1)
void SetTextureFilterLabelName(moText p_text)
MOuint LoadFilters(moParam *p_param)
moParam & GetParam(MOint p_paramindex=-1)
Devuelve el parámetro por índice.
moTextureManager * m_texman
LIBMOLDEO_API moText0 IntToStr(int a)
MOint GetShaderIndex(moText p_name, MOboolean p_create_shader)
bool SetCurrentParamIndex(int)
Selecciona el parámetro por el índice.
MOuint GetSubValueCount()
MOuint GetValuesCount() const
bool FirstValue()
Selecciona el primer valor del parámetro actual.
almacena la configuración de los parámetros de un objeto en un archivo XML
moTexParam GetTexParam() const