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 438:f4d7774967d1
prev429:e581b90c3fb3
next443:1163eb5c0590
author nkeynes
date Thu Oct 11 11:08:36 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Fix tex coords and render with linear filtering
file annotate diff log raw
1.1 --- a/src/drivers/gl_fbo.c Mon Oct 08 11:52:13 2007 +0000
1.2 +++ b/src/drivers/gl_fbo.c Thu Oct 11 11:08:36 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: gl_fbo.c,v 1.3 2007-10-08 11:49:35 nkeynes Exp $
1.6 + * $Id: gl_fbo.c,v 1.4 2007-10-11 11:08:36 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 @@ -249,6 +249,8 @@
1.11 glEnable( GL_TEXTURE_RECTANGLE_ARB );
1.12 glBindTexture( GL_TEXTURE_RECTANGLE_ARB, buffer->buf_id );
1.13 glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
1.14 + glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
1.15 + glTexParameteri( GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
1.16 glDrawBuffer( GL_FRONT );
1.17 glReadBuffer( GL_FRONT );
1.18 glDisable( GL_ALPHA_TEST );
1.19 @@ -265,13 +267,13 @@
1.20 glBlendFunc( GL_ONE, GL_ZERO );
1.21 glDisable( GL_DEPTH_TEST );
1.22 glBegin( GL_QUADS );
1.23 - glTexCoord2i( 0, buffer->height );
1.24 + glTexCoord2i( 0.5, buffer->height-0.5 );
1.25 glVertex2f( 0.0, 0.0 );
1.26 - glTexCoord2i( buffer->width, buffer->height );
1.27 + glTexCoord2i( buffer->width-0.5, buffer->height-0.5 );
1.28 glVertex2f( buffer->width, 0.0 );
1.29 - glTexCoord2i( buffer->width, 0 );
1.30 + glTexCoord2i( buffer->width-0.5, 0 );
1.31 glVertex2f( buffer->width, buffer->height );
1.32 - glTexCoord2i( 0, 0 );
1.33 + glTexCoord2i( 0.5, 0.5 );
1.34 glVertex2f( 0.0, buffer->height );
1.35 glEnd();
1.36 glDisable( GL_TEXTURE_RECTANGLE_ARB );
.