Search
lxdream.org :: lxdream/src/drivers/gl_fbo.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/gl_fbo.c
changeset 1228:8168aa94e6d7
prev1223:61684ca88599
next1245:01e0020adf88
author nkeynes
date Thu Feb 23 15:24:47 2012 +1000 (8 years ago)
permissions -rw-r--r--
last change Check for existence of glDrawBuffer (assuming that glReadBuffer will
follow). Note only need to guard the common code in gl_fbo.c
file annotate diff log raw
1.1 --- a/src/drivers/gl_fbo.c Wed Feb 15 18:09:02 2012 +1000
1.2 +++ b/src/drivers/gl_fbo.c Thu Feb 23 15:24:47 2012 +1000
1.3 @@ -198,8 +198,10 @@
1.4 int attach = -1, i;
1.5 for( i=0; i<gl_fbo_max_attachments; i++ ) {
1.6 if( fbo[fbo_no].tex_ids[i] == tex_id ) {
1.7 +#ifdef HAVE_OPENGL_DRAW_BUFFER
1.8 glDrawBuffer(ATTACHMENT_POINT(i));
1.9 glReadBuffer(ATTACHMENT_POINT(i));
1.10 +#endif
1.11 return ATTACHMENT_POINT(i); // already attached
1.12 } else if( fbo[fbo_no].tex_ids[i] == -1 && attach == -1 ) {
1.13 attach = i;
1.14 @@ -213,8 +215,10 @@
1.15 glFramebufferTexture2D(GL_FRAMEBUFFER, ATTACHMENT_POINT(attach),
1.16 GL_TEXTURE_2D, tex_id, 0 );
1.17 /* Set draw/read buffers by default */
1.18 +#ifdef HAVE_OPENGL_DRAW_BUFFER
1.19 glDrawBuffer(ATTACHMENT_POINT(attach));
1.20 glReadBuffer(ATTACHMENT_POINT(attach));
1.21 +#endif
1.22
1.23 return ATTACHMENT_POINT(attach);
1.24 }
1.25 @@ -345,8 +349,10 @@
1.26 {
1.27 glBindFramebuffer( GL_FRAMEBUFFER, 0 );
1.28 /* Make sure texture attachment is not a current draw/read buffer */
1.29 +#ifdef HAVE_OPENGL_DRAW_BUFFER
1.30 glDrawBuffer( GL_FRONT );
1.31 glReadBuffer( GL_FRONT );
1.32 +#endif
1.33 display_driver->swap_buffers();
1.34 }
1.35
.