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 424:421d68e78c46
prev352:f0df7a6d4703
next429:e581b90c3fb3
author nkeynes
date Sun Oct 07 05:42:25 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Fix compilation warnings
file annotate diff log raw
1.1 --- a/src/drivers/gl_fbo.c Sun Feb 11 10:09:32 2007 +0000
1.2 +++ b/src/drivers/gl_fbo.c Sun Oct 07 05:42:25 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: gl_fbo.c,v 1.1 2007-02-11 10:09:32 nkeynes Exp $
1.6 + * $Id: gl_fbo.c,v 1.2 2007-10-07 05:42:25 nkeynes Exp $
1.7 *
1.8 * GL framebuffer-based driver shell. This requires the EXT_framebuffer_object
1.9 * extension, but is much nicer/faster/etc than pbuffers when it's available.
1.10 @@ -22,8 +22,13 @@
1.11 * GNU General Public License for more details.
1.12 */
1.13
1.14 +#define GL_GLEXT_PROTOTYPES 1
1.15 +
1.16 #include <GL/gl.h>
1.17 +#include <GL/glext.h>
1.18 #include "display.h"
1.19 +#include "drivers/video_x11.h"
1.20 +#include "drivers/gl_common.h"
1.21
1.22 #define MAX_FRAMEBUFFERS 2
1.23 #define MAX_TEXTURES_PER_FB 4
1.24 @@ -67,11 +72,11 @@
1.25 void gl_fbo_init( display_driver_t driver )
1.26 {
1.27 int i,j;
1.28 - int fbids[MAX_FRAMEBUFFERS];
1.29 - int rbids[MAX_FRAMEBUFFERS*2]; /* depth buffer, stencil buffer per fb */
1.30 + GLuint fbids[MAX_FRAMEBUFFERS];
1.31 + GLuint rbids[MAX_FRAMEBUFFERS*2]; /* depth buffer, stencil buffer per fb */
1.32
1.33 - glGenFramebuffersEXT( MAX_FRAMEBUFFERS, &fbids );
1.34 - glGenRenderbuffersEXT( MAX_FRAMEBUFFERS*2, &rbids );
1.35 + glGenFramebuffersEXT( MAX_FRAMEBUFFERS, &fbids[0] );
1.36 + glGenRenderbuffersEXT( MAX_FRAMEBUFFERS*2, &rbids[0] );
1.37 for( i=0; i<MAX_FRAMEBUFFERS; i++ ) {
1.38 fbo[i].fb_id = fbids[i];
1.39 fbo[i].depth_id = rbids[i*2];
1.40 @@ -225,7 +230,7 @@
1.41 {
1.42 glGetError();
1.43 int fb = gl_fbo_get_framebuffer( buffer->width, buffer->height );
1.44 - GLint attach = gl_fbo_attach_texture( fb, buffer->buf_id );
1.45 + gl_fbo_attach_texture( fb, buffer->buf_id );
1.46 /* setup the gl context */
1.47 glViewport( 0, 0, buffer->width, buffer->height );
1.48
1.49 @@ -293,7 +298,7 @@
1.50 static gboolean gl_fbo_read_render_buffer( render_buffer_t buffer, char *target )
1.51 {
1.52 int fb = gl_fbo_get_framebuffer( buffer->width, buffer->height );
1.53 - GLint attach = gl_fbo_attach_texture( fb, buffer->buf_id );
1.54 + gl_fbo_attach_texture( fb, buffer->buf_id );
1.55 return gl_read_render_buffer( buffer, target );
1.56 }
1.57
.