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 758:99ae000d4e09
prev736:a02d1475ccfd
next798:eb5c0d1863cd
author nkeynes
date Mon Jul 21 00:37:13 2008 +0000 (15 years ago)
permissions -rw-r--r--
last change Fix compiler warnings
file annotate diff log raw
1.1 --- a/src/drivers/gl_fbo.c Mon Jul 14 07:44:42 2008 +0000
1.2 +++ b/src/drivers/gl_fbo.c Mon Jul 21 00:37:13 2008 +0000
1.3 @@ -201,11 +201,13 @@
1.4
1.5 static render_buffer_t gl_fbo_create_render_buffer( uint32_t width, uint32_t height )
1.6 {
1.7 + GLuint tex;
1.8 render_buffer_t buffer = calloc( sizeof(struct render_buffer), 1 );
1.9 buffer->width = width;
1.10 buffer->height = height;
1.11 - glGenTextures( 1, &buffer->buf_id );
1.12 - glBindTexture( GL_TEXTURE_RECTANGLE_ARB, buffer->buf_id );
1.13 + glGenTextures( 1, &tex );
1.14 + buffer->buf_id = tex;
1.15 + glBindTexture( GL_TEXTURE_RECTANGLE_ARB, tex );
1.16 glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP );
1.17 glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP );
1.18 glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
1.19 @@ -217,6 +219,7 @@
1.20 static void gl_fbo_destroy_render_buffer( render_buffer_t buffer )
1.21 {
1.22 int i,j;
1.23 + GLuint tex = buffer->buf_id;
1.24 for( i=0; i<MAX_FRAMEBUFFERS; i++ ) {
1.25 for( j=0; j < MAX_TEXTURES_PER_FB; j++ ) {
1.26 if( fbo[i].tex_ids[j] == buffer->buf_id ) {
1.27 @@ -228,7 +231,7 @@
1.28 }
1.29 }
1.30
1.31 - glDeleteTextures( 1, &buffer->buf_id );
1.32 + glDeleteTextures( 1, &tex );
1.33 buffer->buf_id = 0;
1.34 free( buffer );
1.35 }
.