Commit 7380f36e authored by hybrid's avatar hybrid

Added better support for OpenGL clamp modes.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@693 dfc29bdd-3216-0410-991c-e03cc46cb475
parent f510c269
......@@ -1406,13 +1406,55 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
mode=GL_CLAMP;
break;
case ETC_CLAMP_TO_EDGE:
mode=GL_CLAMP_TO_EDGE;
#ifdef GL_VERSION_1_2
if (Version>101)
mode=GL_CLAMP_TO_EDGE;
else
#endif
#ifdef GL_SGIS_texture_edge_clamp
if (FeatureAvailable[IRR_SGIS_texture_edge_clamp])
mode=GL_CLAMP_TO_EDGE_SGIS;
else
#endif
// fallback
mode=GL_CLAMP;
break;
case ETC_CLAMP_TO_BORDER:
mode=GL_CLAMP_TO_BORDER;
#ifdef GL_VERSION_1_3
if (Version>102)
mode=GL_CLAMP_TO_BORDER;
else
#endif
#ifdef GL_ARB_texture_border_clamp
if (FeatureAvailable[IRR_ARB_texture_border_clamp])
mode=GL_CLAMP_TO_BORDER_ARB;
else
#endif
#ifdef GL_SGIS_texture_border_clamp
if (FeatureAvailable[IRR_SGIS_texture_border_clamp])
mode=GL_CLAMP_TO_BORDER_SGIS;
else
#endif
// fallback
mode=GL_CLAMP_TO_EDGE;
break;
case ETC_MIRROR:
mode=GL_MIRRORED_REPEAT;
#ifdef GL_VERSION_1_4
if (Version>103)
mode=GL_MIRRORED_REPEAT;
else
#endif
#ifdef GL_ARB_texture_border_clamp
if (FeatureAvailable[IRR_ARB_texture_mirrored_repeat])
mode=GL_MIRRORED_REPEAT_ARB;
else
#endif
#ifdef GL_IBM_texture_mirrored_repeat
if (FeatureAvailable[IRR_IBM_texture_mirrored_repeat])
mode=GL_MIRRORED_REPEAT_IBM;
else
#endif
mode=GL_REPEAT;
break;
}
......
......@@ -354,6 +354,7 @@ static const char* const OpenGLFeatureStrings[] = {
class COpenGLExtensionHandler
{
public:
enum EOpenGLFeatures {
IRR_3DFX_multisample = 0,
IRR_3DFX_tbuffer,
......@@ -645,7 +646,6 @@ class COpenGLExtensionHandler
IRR_OpenGL_Feature_Count
};
public:
// constructor
COpenGLExtensionHandler();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment