Search
lxdream.org :: lxdream/src/drivers/video_gl.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/video_gl.c
changeset 1222:a4545699a82b
prev1076:18c164e8aec4
next1236:d93175c36387
author nkeynes
date Wed Feb 15 17:54:51 2012 +1000 (7 years ago)
permissions -rw-r--r--
last change Use GL_TEXTURE_2D instead of GL_TEXTURE_RECTANGLE_ARB for frame buffers, for
systems that don't provide the latter (and there's not really much
difference anyway).
Add macro wrangling for GL_DEPTH24_STENCIL8 format
file annotate diff log raw
1.1 --- a/src/drivers/video_gl.c Mon Aug 03 08:41:11 2009 +1000
1.2 +++ b/src/drivers/video_gl.c Wed Feb 15 17:54:51 2012 +1000
1.3 @@ -38,7 +38,6 @@
1.4 glLoadIdentity();
1.5 glEnable( GL_BLEND );
1.6 glDisable( GL_TEXTURE_2D );
1.7 - glDisable( GL_TEXTURE_RECTANGLE_ARB );
1.8 glDisable( GL_ALPHA_TEST );
1.9 glDisable( GL_DEPTH_TEST );
1.10 glDisable( GL_SCISSOR_TEST );
1.11 @@ -82,11 +81,11 @@
1.12 {
1.13 float top, bottom;
1.14 if( inverted ) {
1.15 - top = ((float)height);
1.16 + top = 1;
1.17 bottom = 0;
1.18 } else {
1.19 top = 0;
1.20 - bottom = ((float)height);
1.21 + bottom = 1;
1.22 }
1.23
1.24 /* Reset display parameters */
1.25 @@ -128,24 +127,24 @@
1.26 }
1.27
1.28 /* Render the textured rectangle */
1.29 - glEnable( GL_TEXTURE_RECTANGLE_ARB );
1.30 - glBindTexture( GL_TEXTURE_RECTANGLE_ARB, tex_id );
1.31 + glEnable( GL_TEXTURE_2D );
1.32 + glBindTexture( GL_TEXTURE_2D, tex_id );
1.33 glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
1.34 - glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
1.35 - glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
1.36 + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
1.37 + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
1.38 glEnable( GL_BLEND );
1.39 glBlendFunc( GL_ONE, GL_ZERO );
1.40 glBegin( GL_QUADS );
1.41 glTexCoord2f( 0, top );
1.42 glVertex2f( x1, y1 );
1.43 - glTexCoord2f( ((float)width), top );
1.44 + glTexCoord2f( 1, top );
1.45 glVertex2f( x2, y1 );
1.46 - glTexCoord2f( ((float)width), bottom );
1.47 + glTexCoord2f( 1, bottom );
1.48 glVertex2f( x2, y2 );
1.49 glTexCoord2f( 0, bottom );
1.50 glVertex2f( x1, y2 );
1.51 glEnd();
1.52 - glDisable( GL_TEXTURE_RECTANGLE_ARB );
1.53 + glDisable( GL_TEXTURE_2D );
1.54 glFlush();
1.55 }
1.56
1.57 @@ -157,8 +156,8 @@
1.58 int rowstride = (frame->rowstride / bpp) - frame->width;
1.59
1.60 glPixelStorei( GL_UNPACK_ROW_LENGTH, rowstride );
1.61 - glBindTexture( GL_TEXTURE_RECTANGLE_ARB, tex_id );
1.62 - glTexSubImage2D( GL_TEXTURE_RECTANGLE_ARB, 0, 0,0,
1.63 + glBindTexture( GL_TEXTURE_2D, tex_id );
1.64 + glTexSubImage2D( GL_TEXTURE_2D, 0, 0,0,
1.65 frame->width, frame->height, format, type, frame->data );
1.66 return TRUE;
1.67 }
.