From ed5ee4e8d196a27af348a769a55e11140786767b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 14 Jul 2014 18:48:46 +0200 Subject: [PATCH] - removed some obsolete init stuff and some deprecated constants. --- src/gl/system/gl_framebuffer.cpp | 12 +----------- src/gl/system/gl_interface.cpp | 1 - src/gl/textures/gl_hwtexture.cpp | 8 ++++---- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index 96abf833d..e34eb5fce 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -138,7 +138,6 @@ void OpenGLFrameBuffer::InitializeState() glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearDepth(1.0f); glDepthFunc(GL_LESS); - glShadeModel(GL_SMOOTH); glEnable(GL_DITHER); glEnable(GL_ALPHA_TEST); @@ -146,7 +145,7 @@ void OpenGLFrameBuffer::InitializeState() glDisable(GL_POLYGON_OFFSET_FILL); glEnable(GL_POLYGON_OFFSET_LINE); glEnable(GL_BLEND); - glEnable(GL_DEPTH_CLAMP_NV); + glEnable(GL_DEPTH_CLAMP); glDisable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); glDisable(GL_LINE_SMOOTH); @@ -154,15 +153,6 @@ void OpenGLFrameBuffer::InitializeState() glAlphaFunc(GL_GEQUAL,0.5f); glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST); - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); - - // This was to work around a bug in some older driver. Probably doesn't make sense anymore. - glEnable(GL_FOG); - glDisable(GL_FOG); - - glHint(GL_FOG_HINT, GL_FASTEST); - glFogi(GL_FOG_MODE, GL_EXP); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); diff --git a/src/gl/system/gl_interface.cpp b/src/gl/system/gl_interface.cpp index 42224767b..5b99bd562 100644 --- a/src/gl/system/gl_interface.cpp +++ b/src/gl/system/gl_interface.cpp @@ -140,7 +140,6 @@ void gl_LoadExtensions() if (CheckExtension("GL_ARB_texture_compression")) gl.flags|=RFL_TEXTURE_COMPRESSION; if (CheckExtension("GL_EXT_texture_compression_s3tc")) gl.flags|=RFL_TEXTURE_COMPRESSION_S3TC; if (gl.version >= 4.f && CheckExtension("GL_ARB_buffer_storage")) gl.flags |= RFL_BUFFER_STORAGE; - if (gl.version >= 3.2f || CheckExtension("GL_ARB_draw_elements_base_vertex")) gl.flags |= RFL_BASEINDEX; glGetIntegerv(GL_MAX_TEXTURE_SIZE,&gl.max_texturesize); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); diff --git a/src/gl/textures/gl_hwtexture.cpp b/src/gl/textures/gl_hwtexture.cpp index 9d81b54ce..516b5aaf5 100644 --- a/src/gl/textures/gl_hwtexture.cpp +++ b/src/gl/textures/gl_hwtexture.cpp @@ -253,9 +253,9 @@ void FHardwareTexture::LoadImage(unsigned char * buffer,int w, int h, unsigned i // When using separate samplers the stuff below is not needed. // if (gl.flags & RFL_SAMPLER_OBJECTS) return; - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrapparam==GL_CLAMP? GL_CLAMP_TO_EDGE : GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapparam==GL_CLAMP? GL_CLAMP_TO_EDGE : GL_REPEAT); - clampmode = wrapparam==GL_CLAMP? GLT_CLAMPX|GLT_CLAMPY : 0; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrapparam); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapparam); + clampmode = wrapparam==GL_CLAMP_TO_EDGE? GLT_CLAMPX|GLT_CLAMPY : 0; if (forcenofiltering) { @@ -469,7 +469,7 @@ unsigned int FHardwareTexture::CreateTexture(unsigned char * buffer, int w, int unsigned int * pTexID=GetTexID(translation); if (texunit != 0) glActiveTexture(GL_TEXTURE0+texunit); - LoadImage(buffer, w, h, *pTexID, wrap? GL_REPEAT:GL_CLAMP, alphatexture, texunit); + LoadImage(buffer, w, h, *pTexID, wrap? GL_REPEAT:GL_CLAMP_TO_EDGE, alphatexture, texunit); if (texunit != 0) glActiveTexture(GL_TEXTURE0); return *pTexID; }