From 384941d59664e23468d189e2ccd16e4da40577a4 Mon Sep 17 00:00:00 2001 From: mudlord Date: Mon, 7 Apr 2008 13:37:54 +0000 Subject: [PATCH] Bleh, removed OGL dlists since it didnt seem to make much difference. git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@476 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/win32/OpenGL.cpp | 75 +++++++++++--------------------------------- 1 file changed, 18 insertions(+), 57 deletions(-) diff --git a/src/win32/OpenGL.cpp b/src/win32/OpenGL.cpp index 0bc61b16..decc9c93 100644 --- a/src/win32/OpenGL.cpp +++ b/src/win32/OpenGL.cpp @@ -75,9 +75,7 @@ private: bool failed; GLFONT font; int pitch; - GLuint displaylist; u8 *data; - GLhandleARB v,f,p,t; DWORD currentAdapter; void initializeMatrices( int w, int h ); @@ -192,12 +190,6 @@ void OpenGLDisplay::cleanup() texture = 0; } - if (displaylist) - { - glDeleteLists(displaylist, 1); - displaylist = 0; - } - DisableOpenGL(); if(filterData) { free(filterData); @@ -385,7 +377,6 @@ bool OpenGLDisplay::initialize() theApp.updateIFB(); pitch = theApp.filterWidth * (systemColorDepth>>3) + 4; data = pix + ( theApp.sizeX + 1 ) * 4; - renderlist(); if(failed) return false; @@ -400,28 +391,6 @@ void OpenGLDisplay::clear() glClear( GL_COLOR_BUFFER_BIT ); } -//dlist -void OpenGLDisplay::renderlist() -{ - displaylist = glGenLists(1); //set the cube list to Generate a List - glNewList(displaylist,GL_COMPILE); //compile the new list - glBegin( GL_QUADS ); - - glTexCoord2f( 0.0f, 0.0f ); - glVertex3i( 0, 0, 0 ); - - glTexCoord2f( (float)(width) / size, 0.0f ); - glVertex3i( theApp.surfaceSizeX, 0, 0 ); - - glTexCoord2f( (float)(width) / size, (float)(height) / size ); - glVertex3i( theApp.surfaceSizeX, theApp.surfaceSizeY, 0 ); - - glTexCoord2f( 0.0f, (float)(height) / size ); - glVertex3i( 0, theApp.surfaceSizeY, 0 ); - glEnd(); - glEndList(); -} - //main render func void OpenGLDisplay::render() { @@ -454,7 +423,20 @@ void OpenGLDisplay::render() glTexSubImage2D(GL_TEXTURE_2D,0,0,0,width,height,GL_RGBA,GL_UNSIGNED_BYTE,data ); - glCallList(displaylist); + glBegin( GL_QUADS ); + + glTexCoord2f( 0.0f, 0.0f ); + glVertex3i( 0, 0, 0 ); + + glTexCoord2f( (float)(width) / size, 0.0f ); + glVertex3i( theApp.surfaceSizeX, 0, 0 ); + + glTexCoord2f( (float)(width) / size, (float)(height) / size ); + glVertex3i( theApp.surfaceSizeX, theApp.surfaceSizeY, 0 ); + + glTexCoord2f( 0.0f, (float)(height) / size ); + glVertex3i( 0, theApp.surfaceSizeY, 0 ); + glEnd(); if( theApp.showSpeed ) { // && ( theApp.videoOption > VIDEO_4X ) ) { @@ -504,13 +486,7 @@ void OpenGLDisplay::render() void OpenGLDisplay::resize( int w, int h ) { initializeMatrices( w, h ); - /* Display lists are not mutable, so we have to do this*/ - if (displaylist) - { - glDeleteLists(displaylist, 1); - displaylist = 0; - renderlist(); - } + } //update filtering methods @@ -558,12 +534,7 @@ void OpenGLDisplay::initializeMatrices( int w, int h ) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - if (displaylist) - { - glDeleteLists(displaylist, 1); - displaylist = 0; - renderlist(); - } + } //init font texture @@ -648,12 +619,7 @@ bool OpenGLDisplay::changeRenderSize( int w, int h ) free(filterData); filterData = (u8 *)malloc(4*w*h); } - if (displaylist) - { - glDeleteLists(displaylist, 1); - displaylist = 0; - renderlist(); - } + return true; } @@ -680,12 +646,7 @@ void OpenGLDisplay::calculateDestRect( int w, int h ) destRect.top += diff; destRect.bottom += diff; } - if (displaylist) - { - glDeleteLists(displaylist, 1); - displaylist = 0; - renderlist(); - } + } //config options