59 m_fbo_array.Init(0, NULL);
61 m_fbo_stack_index = -1;
63 return (m_glmanager!=NULL);
75 new_fbo->
Init(m_glmanager);
76 m_fbo_array.Add(new_fbo);
77 return m_fbo_array.Count() - 1;
84 delete m_fbo_array.GetRef(p_fbo);
85 m_fbo_array.Remove(p_fbo);
94 for (
MOuint i = 0; i < m_fbo_array.Count(); i++)
96 if ((m_fbo_array.Get(i)->GetTarget() == p_target) &&
97 (m_fbo_array.Get(i)->GetTarget() == p_internal_format) &&
98 (m_fbo_array.Get(i)->GetTarget() == p_width) &&
99 (m_fbo_array.Get(i)->GetTarget() == p_height))
110 m_fbo_stack[m_fbo_stack_index] = (
MOuint)m_current_fbo;
132 m_fbo_stack[m_fbo_stack_index] = m_current_fbo;
137 m_fbo_array[p_fbo]->Bind();
138 m_current_fbo = p_fbo;
148 m_fbo_array[p_fbo]->SetDrawTexture(p_attach_point);
186 if (-1 < m_current_fbo) m_fbo_array[m_current_fbo]->SetDrawTexture(p_attach_point);
191 if (-1 < m_current_fbo)
193 GLsizei n = p_num_attach_points;
195 for (
int i = 0; i < n; i++) m_color_buffers[i] = m_fbo_array[m_current_fbo]->GetColorAttachPoint(p_attach_point_list[i]);
197 glDrawBuffers(n, m_color_buffers);
204 if (-1 < m_current_fbo) m_fbo_array[m_current_fbo]->SetReadTexture(p_attach_point);
209 if (-1 < m_current_fbo) m_fbo_array[m_current_fbo]->SetDrawTexture(p_glid, p_width, p_height, p_param, p_def_attach_point);
214 if (-1 < m_current_fbo)
216 GLsizei n = p_num_glids;
218 for (
int i = 0; i < n; i++)
219 m_fbo_array[m_current_fbo]->
SetDrawTexture(p_glid_list[i], p_width, p_height, p_param, i);
222 for (
int i = 0; i < n; i++) m_color_buffers[i] = m_fbo_array[m_current_fbo]->GetColorAttachPoint(i);
224 glDrawBuffers(n, m_color_buffers);
231 if (-1 < m_current_fbo) m_fbo_array[m_current_fbo]->SetReadTexture(p_glid, p_width, p_height, p_param, p_def_attach_point);
237 if ((-1 < m_current_fbo) && (p_pTex != NULL))
239 if (p_pTex->
GetFBO() == NULL)
244 if (p_pTex->
GetFBO() == m_fbo_array[m_current_fbo])
260 if (-1 < m_current_fbo)
262 GLsizei n = p_tex_array.Count();
264 for (
int i = 0; i < n; i++)
265 if (p_tex_array[i] != NULL)
266 m_fbo_array[m_current_fbo]->SetDrawTexture(p_tex_array[i]->GetGLId(), p_tex_array[i]->GetWidth(), p_tex_array[i]->GetHeight(), p_tex_array[i]->GetTexParam(), i);
269 for (
int i = 0; i < n; i++) m_color_buffers[i] = m_fbo_array[m_current_fbo]->GetColorAttachPoint(i);
271 glDrawBuffers(n, m_color_buffers);
280 if ((-1 < m_current_fbo) && (p_pTex != NULL))
282 if (p_pTex->
GetFBO() == NULL)
287 if (p_pTex->
GetFBO() == m_fbo_array[m_current_fbo])
302 if (0 < m_fbo_stack_index)
304 MOuint previous_fbo = m_fbo_stack[m_fbo_stack_index];
305 m_fbo_array[previous_fbo]->Bind();
306 m_current_fbo = previous_fbo;
308 MOuint prev_draw_buffer = m_draw_buffer_stack[m_fbo_stack_index];
309 MOuint prev_read_buffer = m_read_buffer_stack[m_fbo_stack_index];
321 m_fbo_stack_index = -1;
331 m_fbo_stack_index = -1;
335 void moFBManager::GetScreenBuffers()
338 glGetIntegerv(GL_DRAW_BUFFER, &m_screen_draw_buffer);
339 glGetIntegerv(GL_READ_BUFFER, &m_screen_read_buffer);
Parámetros internos de una textura.
void SetDrawTexture(MOuint p_attach_point)
void SetName(const moText &p_name)
void SetDrawTextures(MOuint p_num_attach_points, MOuint *p_attach_point_list)
virtual MOboolean Init(moGLManager *p_gl)
void SetResourceType(moResourceType p_restype)
void SetReadTexture(MOuint p_attach_point)
void SetDrawTextureByGLId(MOuint p_glid, MOuint p_width, MOuint p_height, const moTexParam &p_param, MOuint p_def_attach_point=0)
MOboolean DeleteFBO(MOuint p_fbo)
moResourceManager * m_pResourceManager
Puntero al administrador de recursos.
Dispositivo de entrada/salida, típicamente, interfaces humanas de IO y datos ( teclado, mouse, tableta, tcp, udp, serial )
void SetCurrentDrawBuffer(MOint p_buffer)
void SetCurrentReadBuffer(MOint p_buffer)
void SetCurrentFBO(MOuint m_fbo)
void SetDrawTexturesByGLId(MOuint p_num_glids, MOuint *p_glid_list, MOuint p_width, MOuint p_height, const moTexParam &p_param)
MOboolean AttachTexture(MOuint p_fbo, moTexture *p_pTex, MOuint p_attach_point)
clase base para el manejo de una textura
void SetLabelName(const moText &p_labelname)
moFBO * GetFBO(MOuint p_fbo)
MOboolean AddTexture(MOuint p_fbo, moTexture *p_pTex, MOuint &p_attach_point)
MOuint GetFBOAttachPoint() const
MOint GetCurrentReadBuffer()
virtual MOboolean Finish()
MOint GetCurrentDrawBuffer()
void SetType(moMoldeoObjectType p_type)
void SetReadTextureByGLId(MOuint p_glid, MOuint p_width, MOuint p_height, const moTexParam &p_param, MOuint p_def_attach_point=0)
MOboolean BindFBO(MOuint p_fbo)
moTexParam GetTexParam() const