[osg-submissions] Bug in MRT and FBO

Art Tevs stud_info2 at yahoo.de
Tue Jul 15 04:15:44 PDT 2008


Hi Robert,




> Would just removing the possibility of using enum in
> setAttachement
> fix this ambiguity?  Just have osg::Camera::BufferAttach
> used in
> osg::FrameBufferObject?
> 
I think it would. However having the enums it is possible to do something like this:

for (int i=0; i < 4; i++)
   fbo->setAttachment(GL_COLOR_BUFFER0_EXT + i, ...);
, which is correct in respect to OpenGL specificatiosn, since GL_COLOR_BUFFERn_EXT = GL_COLOR_BUFFER0_EXT + n.


If you remove the GLenum then one has to write something like this:

for (int i=0; i < 4; i++)
   fbo->setAttachment(Camera::BufferAttachment(int(Camera::COLOR_BUFFER0) + i), ...);

which ends up in a lot of casts, which is not so nice code style (one can not add integer value to an enum value).

Hence I would propose to let the GLenum in there or to work out a new API interface to solve that problem.

Best regards,
Art

P.S. Sorry, I do not remember the discussion about the using of COLOR_BUFFER!=COLOR_BUFFER0. I can not see any issue which might be introduced by setting COLOR_BUFFER=COLOR_BUFFER0. Could you explain me in few words why?
 



      __________________________________________________________
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com


More information about the osg-submissions mailing list