Before I forget, here's a combined patch of the stuff in this thread, based on current trunk and with the post processing code adapted to use it as well:
Index: cutscene/mveplayer.cpp
===================================================================
--- cutscene/mveplayer.cpp (revision 8833)
+++ cutscene/mveplayer.cpp (working copy)
@@ -66,12 +66,13 @@
void *g_vBackBuf1, *g_vBackBuf2;
ushort *pixelbuf = NULL;
static GLuint GLtex = 0;
-static GLint gl_screenYH = 0;
-static GLint gl_screenXW = 0;
+static GLfloat gl_screenYH = 0;
+static GLfloat gl_screenXW = 0;
static GLfloat gl_screenU = 0;
static GLfloat gl_screenV = 0;
+static GLfloat glVertices[4][4] = {{0}};
static int g_screenWidth, g_screenHeight;
-static int g_screenX, g_screenY;
+static float g_screenX, g_screenY;
static int g_truecolor = 0;
static ubyte g_palette[768];
static ubyte *g_pCurMap = NULL;
@@ -478,12 +479,12 @@
}
if (mve_scale_video) {
- g_screenX = ((fl2i(gr_screen.max_w / scale_by + 0.5f) - g_width) / 2);
- g_screenY = ((fl2i(gr_screen.max_h / scale_by + 0.5f) - g_height) / 2);
+ g_screenX = ((ceil((gr_screen.max_w / scale_by) - 0.5f) - g_width) / 2);
+ g_screenY = ((ceil((gr_screen.max_h / scale_by) - 0.5f) - g_height) / 2);
} else {
// centers on 1024x768, fills on 640x480
- g_screenX = ((gr_screen.max_w - g_width) / 2);
- g_screenY = ((gr_screen.max_h - g_height) / 2);
+ g_screenX = ((float)(gr_screen.max_w - g_width) / 2.0f);
+ g_screenY = ((float)(gr_screen.max_h - g_height) / 2.0f);
}
// set additional values for screen width/height and UV coords
@@ -494,6 +495,32 @@
gl_screenU = i2fl(g_width) / i2fl(wp2);
gl_screenV = i2fl(g_height) / i2fl(hp2);
}
+
+ glVertices[0][0] = g_screenX;
+ glVertices[0][1] = g_screenY;
+ glVertices[0][2] = 0;
+ glVertices[0][3] = 0;
+
+ glVertices[1][0] = g_screenX;
+ glVertices[1][1] = gl_screenYH;
+ glVertices[1][2] = 0;
+ glVertices[1][3] = gl_screenV;
+
+ glVertices[2][0] = gl_screenXW;
+ glVertices[2][1] = g_screenY;
+ glVertices[2][2] = gl_screenU;
+ glVertices[2][3] = 0;
+
+ glVertices[3][0] = gl_screenXW;
+ glVertices[3][1] = gl_screenYH;
+ glVertices[3][2] = gl_screenU;
+ glVertices[3][3] = gl_screenV;
+
+ glVertexPointer(2, GL_FLOAT, sizeof(glVertices[0]), glVertices);
+ glTexCoordPointer(2, GL_FLOAT, sizeof(glVertices[0]), &(glVertices[0][2]));
+
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
}
return 1;
@@ -579,24 +606,12 @@
if (gr_screen.mode == GR_OPENGL) {
glTexSubImage2D(GL_state.Texture.GetTarget(), 0, 0, 0, g_width, g_height, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, pixelbuf);
- glBegin(GL_QUADS);
- glTexCoord2f(0, 0);
- glVertex2i(g_screenX, g_screenY);
-
- glTexCoord2f(0, gl_screenV);
- glVertex2i(g_screenX, gl_screenYH);
-
- glTexCoord2f(gl_screenU, gl_screenV);
- glVertex2i(gl_screenXW, gl_screenYH);
-
- glTexCoord2f(gl_screenU, 0);
- glVertex2i(gl_screenXW, g_screenY);
- glEnd();
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
} else {
// DDOI - This is probably really fricking slow
int bitmap = bm_create (16, g_screenWidth, g_screenHeight, pixelbuf, 0);
gr_set_bitmap (bitmap);
- gr_bitmap (g_screenX, g_screenY, true);
+ gr_bitmap ((int)g_screenX, (int)g_screenY, true);
bm_release (bitmap);
}
@@ -779,6 +794,9 @@
void mve_shutdown()
{
if (gr_screen.mode == GR_OPENGL) {
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+
if (mve_scale_video) {
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
Index: cutscene/oggplayer.cpp
===================================================================
--- cutscene/oggplayer.cpp (revision 8833)
+++ cutscene/oggplayer.cpp (working copy)
@@ -50,6 +50,7 @@
static GLint gl_screenXW = 0;
static GLfloat gl_screenU = 0;
static GLfloat gl_screenV = 0;
+static GLfloat glVertices[4][4] = {{0}};
// video externs from API graphics functions
extern void opengl_tcache_get_adjusted_texture_size(int w_in, int h_in, int *w_out, int *h_out);
@@ -535,6 +536,32 @@
vglUniform1iARB( vglGetUniformLocationARB(shader_id, "utex"), 1 );
vglUniform1iARB( vglGetUniformLocationARB(shader_id, "vtex"), 2 );
}
+
+ glVertices[0][0] = (GLfloat)g_screenX;
+ glVertices[0][1] = (GLfloat)g_screenY;
+ glVertices[0][2] = 0.0f;
+ glVertices[0][3] = 0.0f;
+
+ glVertices[1][0] = (GLfloat)g_screenX;
+ glVertices[1][1] = (GLfloat)gl_screenYH;
+ glVertices[1][2] = 0.0f;
+ glVertices[1][3] = gl_screenV;
+
+ glVertices[2][0] = (GLfloat)gl_screenXW;
+ glVertices[2][1] = (GLfloat)g_screenY;
+ glVertices[2][2] = gl_screenU;
+ glVertices[2][3] = 0.0f;
+
+ glVertices[3][0] = (GLfloat)gl_screenXW;
+ glVertices[3][1] = (GLfloat)gl_screenYH;
+ glVertices[3][2] = gl_screenU;
+ glVertices[3][3] = gl_screenV;
+
+ glVertexPointer(2, GL_FLOAT, sizeof(glVertices[0]), glVertices);
+ glTexCoordPointer(2, GL_FLOAT, sizeof(glVertices[0]), &(glVertices[0][2]));
+
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
}
if(!use_shaders && tinfo->frame_height > 450) {
mprintf(("VIDEO: No shader support and hd video is beeing played this can get choppy."));
@@ -549,6 +576,9 @@
}
if (gr_screen.mode == GR_OPENGL) {
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+
if (scale_video) {
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
@@ -680,19 +710,8 @@
} else {
glTexSubImage2D(GL_state.Texture.GetTarget(), 0, 0, 0, g_screenWidth, g_screenHeight, GL_BGR, GL_UNSIGNED_BYTE, pixelbuf);
}
- glBegin(GL_QUADS);
- glTexCoord2f(0, 0);
- glVertex2i(g_screenX, g_screenY);
- glTexCoord2f(0, gl_screenV);
- glVertex2i(g_screenX, gl_screenYH);
-
- glTexCoord2f(gl_screenU, gl_screenV);
- glVertex2i(gl_screenXW, gl_screenYH);
-
- glTexCoord2f(gl_screenU, 0);
- glVertex2i(gl_screenXW, g_screenY);
- glEnd();
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
Mouse_hidden = 1;
gr_flip();
Index: graphics/gropengldraw.cpp
===================================================================
--- graphics/gropengldraw.cpp (revision 8833)
+++ graphics/gropengldraw.cpp (working copy)
@@ -59,6 +59,29 @@
gr_line(x, y, x, y, resize);
}
+inline void opengl_draw_textured_quad(
+ GLfloat x1, GLfloat y1, GLfloat u1, GLfloat v1,
+ GLfloat x2, GLfloat y2, GLfloat u2, GLfloat v2 )
+{
+ GLfloat glVertices[4][4] = {
+ { x1, y1, u1, v1 },
+ { x1, y2, u1, v2 },
+ { x2, y1, u2, v1 },
+ { x2, y2, u2, v2 }
+ };
+
+ glVertexPointer(2, GL_FLOAT, sizeof(glVertices[0]), glVertices);
+ glTexCoordPointer(2, GL_FLOAT, sizeof(glVertices[0]), &(glVertices[0][2]));
+
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+}
+
void opengl_aabitmap_ex_internal(int x, int y, int w, int h, int sx, int sy, bool resize, bool mirror)
{
if ( (w < 1) || (h < 1) ) {
@@ -120,20 +143,8 @@
GLboolean cull_face = GL_state.CullFace(GL_FALSE);
- glBegin(GL_QUADS);
- glTexCoord2f(u0, v1);
- glVertex2f(x1, y2);
+ opengl_draw_textured_quad(x1,y1,u0,v0, x2,y2,u1,v1);
- glTexCoord2f(u1, v1);
- glVertex2f(x2, y2);
-
- glTexCoord2f(u1, v0);
- glVertex2f(x2, y1);
-
- glTexCoord2f(u0, v0);
- glVertex2f(x1, y1);
- glEnd();
-
GL_state.CullFace(cull_face);
GL_CHECK_FOR_ERRORS("end of aabitmap_ex_internal()");
@@ -318,6 +329,7 @@
opengl_aabitmap_ex_internal(dx1, dy1, (dx2 - dx1 + 1), (dy2 - dy1 + 1), sx, sy, resize, mirror);
}
+struct v4 { GLfloat x,y,u,v; };
void gr_opengl_string(int sx, int sy, const char *s, bool resize)
{
@@ -328,6 +340,10 @@
int x1, x2, y1, y2;
float u_scale, v_scale;
+ // conversion from quads to triangles requires six vertices per quad
+ struct v4 *glVert = (struct v4*) alloca(sizeof(struct v4) * strlen(s) * 6);
+ int curChar = 0;
+
if ( !Current_font || (*s == 0) ) {
return;
}
@@ -350,7 +366,7 @@
bw = i2fl(ibw);
bh = i2fl(ibh);
-
+
// set color!
if (gr_screen.current_color.is_alphacolor) {
glColor4ub(gr_screen.current_color.red, gr_screen.current_color.green, gr_screen.current_color.blue, gr_screen.current_color.alpha);
@@ -384,9 +400,6 @@
GLboolean cull_face = GL_state.CullFace(GL_FALSE);
- // start rendering...
- glBegin(GL_QUADS);
-
// pick out letter coords, draw it, goto next letter and do the same
while (*s) {
x += spacing;
@@ -482,22 +495,43 @@
u1 = u_scale * (i2fl((u+xd)+wc) / bw);
v1 = v_scale * (i2fl((v+yd)+hc) / bh);
- glTexCoord2f(u0, v1);
- glVertex2i(x1, y2);
+ glVert[curChar*6 + 0].x = (GLfloat)x1;
+ glVert[curChar*6 + 0].y = (GLfloat)y2;
+ glVert[curChar*6 + 0].u = u0;
+ glVert[curChar*6 + 0].v = v1;
- glTexCoord2f(u1, v1);
- glVertex2i(x2, y2);
+ glVert[curChar*6 + 1].x = (GLfloat)x2;
+ glVert[curChar*6 + 1].y = (GLfloat)y2;
+ glVert[curChar*6 + 1].u = u1;
+ glVert[curChar*6 + 1].v = v1;
- glTexCoord2f(u1, v0);
- glVertex2i(x2, y1);
+ glVert[curChar*6 + 2].x = (GLfloat)x1;
+ glVert[curChar*6 + 2].y = (GLfloat)y1;
+ glVert[curChar*6 + 2].u = u0;
+ glVert[curChar*6 + 2].v = v0;
- glTexCoord2f(u0, v0);
- glVertex2i(x1, y1);
+ glVert[curChar*6 + 3] = glVert[curChar*6 + 1];
+ glVert[curChar*6 + 4] = glVert[curChar*6 + 2];
+
+ glVert[curChar*6 + 5].x = (GLfloat)x2;
+ glVert[curChar*6 + 5].y = (GLfloat)y1;
+ glVert[curChar*6 + 5].u = u1;
+ glVert[curChar*6 + 5].v = v0;
+
+ curChar++;
}
- // done!
- glEnd();
+ glVertexPointer(2, GL_FLOAT, sizeof(struct v4), &glVert[0].x);
+ glTexCoordPointer(2, GL_FLOAT, sizeof(struct v4), &glVert[0].u);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ glDrawArrays(GL_TRIANGLES, 0, curChar * 6);
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+
GL_state.CullFace(cull_face);
GL_CHECK_FOR_ERRORS("end of string()");
@@ -890,16 +924,21 @@
}
}
+struct v6 { GLfloat x,y,z,w,u,v; };
+struct c4 { GLubyte r,g,b,a; };
+
void opengl_draw_primitive(int nv, vertex **verts, uint flags, float u_scale, float v_scale, int r, int g, int b, int a, int override_primary = 0)
{
GLenum gl_mode = GL_TRIANGLE_FAN;
- float sx, sy, sz, sw, tu, tv;
- int i;
+ float sx, sy, sz, sw;
+ int i,j;
vertex *va;
bool isNebula = false;
bool isRamp = false;
bool isRGB = false;
ubyte alpha = (ubyte)a;
+ struct v6 *vertPos = (struct v6*) alloca(sizeof(struct v6) * nv);
+ struct c4 *vertCol = (struct c4*) alloca(sizeof(struct c4) * nv);
GL_CHECK_FOR_ERRORS("start of draw_primitive()");
@@ -922,12 +961,11 @@
} else if (flags & TMAP_FLAG_QUADLIST) {
gl_mode = GL_QUADS;
} else if (flags & TMAP_FLAG_QUADSTRIP) {
- gl_mode = GL_QUAD_STRIP;
+ gl_mode = GL_TRIANGLE_STRIP;
+ Assert((nv % 2) == 0);
}
- glBegin(gl_mode);
-
- for (i = (nv - 1); i >= 0; i--) {
+ for (i = (nv - 1), j = 0; i >= 0; i--, j++) {
va = verts[i];
sw = 1.0f;
@@ -957,32 +995,67 @@
}
if (override_primary) {
- glColor3ub(va->spec_r, va->spec_g, va->spec_b);
+ vertCol[j].r = va->spec_r;
+ vertCol[j].g = va->spec_g;
+ vertCol[j].b = va->spec_b;
+ vertCol[j].a = 255;
} else {
if (isNebula) {
int pal = (va->b * (NEBULA_COLORS-1)) / 255;
- glColor4ub( gr_palette[pal*3+0], gr_palette[pal*3+1], gr_palette[pal*3+2], alpha );
+ vertCol[j].r = gr_palette[pal*3+0];
+ vertCol[j].g = gr_palette[pal*3+1];
+ vertCol[j].b = gr_palette[pal*3+2];
+ vertCol[j].a = alpha;
} else if (isRamp) {
- glColor4ub( va->b, va->b, va->b, alpha );
+ vertCol[j].r = va->b;
+ vertCol[j].g = va->b;
+ vertCol[j].b = va->b;
+ vertCol[j].a = alpha;
} else if (isRGB) {
- glColor4ub( va->r, va->g, va->b, alpha );
+ vertCol[j].r = va->r;
+ vertCol[j].g = va->g;
+ vertCol[j].b = va->b;
+ vertCol[j].a = alpha;
}
}
if (flags & TMAP_FLAG_TEXTURED) {
- tu = va->texture_position.u * u_scale;
- tv = va->texture_position.v * v_scale;
-
- // use opengl hardware multitexturing
- vglMultiTexCoord2fARB(GL_TEXTURE0_ARB, tu, tv);
- vglMultiTexCoord2fARB(GL_TEXTURE1_ARB, tu, tv);
+ vertPos[j].u = va->texture_position.u * u_scale;
+ vertPos[j].v = va->texture_position.v * v_scale;
}
- glVertex4f(sx, sy, -sz, sw);
+ vertPos[j].x = sx;
+ vertPos[j].y = sy;
+ vertPos[j].z = -sz;
+ vertPos[j].w = sw;
}
- glEnd();
+ glVertexPointer(4, GL_FLOAT, sizeof(struct v6), &vertPos[0].x);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ if(flags & TMAP_FLAG_TEXTURED) {
+ vglClientActiveTextureARB(GL_TEXTURE0);
+ glTexCoordPointer(2, GL_FLOAT, sizeof(struct v6), &vertPos[0].u);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ vglClientActiveTextureARB(GL_TEXTURE1);
+ glTexCoordPointer(2, GL_FLOAT, sizeof(struct v6), &vertPos[0].u);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ }
+
+ if(flags & (TMAP_FLAG_NEBULA | TMAP_FLAG_GOURAUD)) {
+ glColorPointer(4, GL_UNSIGNED_BYTE, 0, &vertCol[0].r);
+ glEnableClientState(GL_COLOR_ARRAY);
+ }
+
+ glDrawArrays(gl_mode, 0, nv);
+
+ glDisableClientState(GL_COLOR_ARRAY);
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ vglClientActiveTextureARB(GL_TEXTURE0);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+
GL_CHECK_FOR_ERRORS("start of draw_primitive()");
}
@@ -1726,19 +1799,7 @@
glColor4f(1.0f, 1.0f, 1.0f, gr_screen.current_alpha);
- glBegin(GL_QUADS);
- glTexCoord2f(u0, v1);
- glVertex2f(x1, y2);
-
- glTexCoord2f(u1, v1);
- glVertex2f(x2, y2);
-
- glTexCoord2f(u1, v0);
- glVertex2f(x2, y1);
-
- glTexCoord2f(u0, v0);
- glVertex2f(x1, y1);
- glEnd();
+ opengl_draw_textured_quad(x1, y1, u0, v0, x2, y2, u1, v1);
}
Index: graphics/gropengldraw.h
===================================================================
--- graphics/gropengldraw.h (revision 8833)
+++ graphics/gropengldraw.h (working copy)
@@ -47,6 +47,10 @@
void gr_opengl_scene_texture_begin();
void gr_opengl_scene_texture_end();
+inline void opengl_draw_textured_quad(
+ GLfloat x1, GLfloat y1, GLfloat u1, GLfloat v1,
+ GLfloat x2, GLfloat y2, GLfloat u2, GLfloat v2 );
+
extern int Scene_texture_initialized;
extern GLuint Scene_color_texture;
Index: graphics/gropenglpostprocessing.cpp
===================================================================
--- graphics/gropenglpostprocessing.cpp (revision 8833)
+++ graphics/gropenglpostprocessing.cpp (working copy)
@@ -155,20 +155,8 @@
GL_state.Texture.SetTarget(GL_TEXTURE_2D);
GL_state.Texture.Enable(Scene_color_texture);
- glBegin(GL_QUADS);
- glTexCoord2f(0.0f, 0.0f);
- glVertex2f(-1.0f, -1.0f);
+ opengl_draw_textured_quad(-1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f);
- glTexCoord2f(1.0f, 0.0f);
- glVertex2f(1.0f, -1.0f);
-
- glTexCoord2f(1.0f, 1.0f);
- glVertex2f(1.0f, 1.0f);
-
- glTexCoord2f(0.0f, 1.0f);
- glVertex2f(-1.0f, 1.0f);
- glEnd();
-
GL_state.Texture.Disable();
// ------ end bright pass ------
@@ -200,19 +188,7 @@
GL_state.Texture.Enable(Post_bloom_texture_id[pass]);
- glBegin(GL_QUADS);
- glTexCoord2f(0.0f, 0.0f);
- glVertex2f(-1.0f, -1.0f);
-
- glTexCoord2f(1.0f, 0.0f);
- glVertex2f(1.0f, -1.0f);
-
- glTexCoord2f(1.0f, 1.0f);
- glVertex2f(1.0f, 1.0f);
-
- glTexCoord2f(0.0f, 1.0f);
- glVertex2f(-1.0f, 1.0f);
- glEnd();
+ opengl_draw_textured_quad(-1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f);
}
GL_state.Texture.Disable();
@@ -323,20 +299,8 @@
GL_state.Texture.SetTarget(GL_TEXTURE_2D);
GL_state.Texture.Enable(Scene_color_texture);
- glBegin(GL_QUADS);
- glTexCoord2f(0.0f, 0.0f);
- glVertex2f(-1.0f, -1.0f);
+ opengl_draw_textured_quad(-1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f, Scene_texture_u_scale, Scene_texture_u_scale);
- glTexCoord2f(Scene_texture_u_scale, 0.0f);
- glVertex2f(1.0f, -1.0f);
-
- glTexCoord2f(Scene_texture_u_scale, Scene_texture_v_scale);
- glVertex2f(1.0f, 1.0f);
-
- glTexCoord2f(0.0f, Scene_texture_v_scale);
- glVertex2f(-1.0f, 1.0f);
- glEnd();
-
GL_state.Texture.Disable();
// set and configure post shader ..
@@ -353,20 +317,8 @@
GL_state.Texture.SetTarget(GL_TEXTURE_2D);
GL_state.Texture.Enable(Scene_luminance_texture);
- glBegin(GL_QUADS);
- glTexCoord2f(0.0f, 0.0f);
- glVertex2f(-1.0f, -1.0f);
+ opengl_draw_textured_quad(-1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f, Scene_texture_u_scale, Scene_texture_u_scale);
- glTexCoord2f(Scene_texture_u_scale, 0.0f);
- glVertex2f(1.0f, -1.0f);
-
- glTexCoord2f(Scene_texture_u_scale, Scene_texture_v_scale);
- glVertex2f(1.0f, 1.0f);
-
- glTexCoord2f(0.0f, Scene_texture_v_scale);
- glVertex2f(-1.0f, 1.0f);
- glEnd();
-
GL_state.Texture.Disable();
opengl_shader_set_current();
@@ -432,19 +384,9 @@
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
GL_state.Blend(GL_TRUE);
GL_state.SetAlphaBlendMode(ALPHA_BLEND_ADDITIVE);
- glBegin(GL_QUADS);
- glTexCoord2f(0.0f, 0.0f);
- glVertex2f(-1.0f, -1.0f);
+
+ opengl_draw_textured_quad(-1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f, Scene_texture_u_scale, Scene_texture_u_scale);
- glTexCoord2f(Scene_texture_u_scale, 0.0f);
- glVertex2f(1.0f, -1.0f);
-
- glTexCoord2f(Scene_texture_u_scale, Scene_texture_v_scale);
- glVertex2f(1.0f, 1.0f);
-
- glTexCoord2f(0.0f, Scene_texture_v_scale);
- glVertex2f(-1.0f, 1.0f);
- glEnd();
GL_state.Blend(GL_FALSE);
break;
}
@@ -511,20 +453,7 @@
GL_state.Texture.SetTarget(GL_TEXTURE_2D);
GL_state.Texture.Enable(Scene_color_texture);
- glBegin(GL_QUADS);
- glTexCoord2f(0.0f, 0.0f);
- glVertex2f(-1.0f, -1.0f);
-
- glTexCoord2f(Scene_texture_u_scale, 0.0f);
- glVertex2f(1.0f, -1.0f);
-
- glTexCoord2f(Scene_texture_u_scale, Scene_texture_v_scale);
- glVertex2f(1.0f, 1.0f);
-
- glTexCoord2f(0.0f, Scene_texture_v_scale);
- glVertex2f(-1.0f, 1.0f);
- glEnd();
-
+ opengl_draw_textured_quad(-1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f, Scene_texture_u_scale, Scene_texture_u_scale);
// Done!
GL_state.Texture.SetActiveUnit(1);