- removed some obsolete init stuff and some deprecated constants.

This commit is contained in:
Christoph Oelckers 2014-07-14 18:48:46 +02:00
parent 4df25d951b
commit ed5ee4e8d1
3 changed files with 5 additions and 16 deletions

View file

@ -138,7 +138,6 @@ void OpenGLFrameBuffer::InitializeState()
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0f); glClearDepth(1.0f);
glDepthFunc(GL_LESS); glDepthFunc(GL_LESS);
glShadeModel(GL_SMOOTH);
glEnable(GL_DITHER); glEnable(GL_DITHER);
glEnable(GL_ALPHA_TEST); glEnable(GL_ALPHA_TEST);
@ -146,7 +145,7 @@ void OpenGLFrameBuffer::InitializeState()
glDisable(GL_POLYGON_OFFSET_FILL); glDisable(GL_POLYGON_OFFSET_FILL);
glEnable(GL_POLYGON_OFFSET_LINE); glEnable(GL_POLYGON_OFFSET_LINE);
glEnable(GL_BLEND); glEnable(GL_BLEND);
glEnable(GL_DEPTH_CLAMP_NV); glEnable(GL_DEPTH_CLAMP);
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
glDisable(GL_LINE_SMOOTH); glDisable(GL_LINE_SMOOTH);
@ -154,15 +153,6 @@ void OpenGLFrameBuffer::InitializeState()
glAlphaFunc(GL_GEQUAL,0.5f); glAlphaFunc(GL_GEQUAL,0.5f);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glHint(GL_POLYGON_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); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

View file

@ -140,7 +140,6 @@ void gl_LoadExtensions()
if (CheckExtension("GL_ARB_texture_compression")) gl.flags|=RFL_TEXTURE_COMPRESSION; 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 (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 >= 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); glGetIntegerv(GL_MAX_TEXTURE_SIZE,&gl.max_texturesize);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

View file

@ -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. // When using separate samplers the stuff below is not needed.
// if (gl.flags & RFL_SAMPLER_OBJECTS) return; // 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_S, wrapparam);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapparam==GL_CLAMP? GL_CLAMP_TO_EDGE : GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapparam);
clampmode = wrapparam==GL_CLAMP? GLT_CLAMPX|GLT_CLAMPY : 0; clampmode = wrapparam==GL_CLAMP_TO_EDGE? GLT_CLAMPX|GLT_CLAMPY : 0;
if (forcenofiltering) if (forcenofiltering)
{ {
@ -469,7 +469,7 @@ unsigned int FHardwareTexture::CreateTexture(unsigned char * buffer, int w, int
unsigned int * pTexID=GetTexID(translation); unsigned int * pTexID=GetTexID(translation);
if (texunit != 0) glActiveTexture(GL_TEXTURE0+texunit); 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); if (texunit != 0) glActiveTexture(GL_TEXTURE0);
return *pTexID; return *pTexID;
} }