Look for OpenGL 3.3 not 1.2 on startup.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 11 years ago
parent 82d29b3e23
commit c90f51afbe

@ -895,13 +895,18 @@ static bool setupPackedDepthStencil(const char *glext)
void registerGlExtensions(CGlExtensions &ext)
{
H_AUTO_OGL(registerGlExtensions);
// OpenGL 1.2 ??
const char *nglVersion= (const char *)glGetString (GL_VERSION);
sint a=0, b=0;
// 1.2*** ???
sscanf(nglVersion, "%d.%d", &a, &b);
ext.Version1_2= (a==1 && b>=2) || (a>=2);
sscanf(nglVersion, "%d.%d", &a, &b);
if( ( a < 3 ) || ( ( a == 3 ) && ( b < 3 ) ) )
{
nlinfo( "OpenGL version is less than 3.3!" );
nlinfo( "Version string: %s",nglVersion );
nlassert( false );
}
// Extensions.
const char *glext= (const char*)glGetString(GL_EXTENSIONS);
GLint ntext;

@ -33,8 +33,7 @@ namespace NLDRIVERGL3 {
/// The extensions used by NL3D.
struct CGlExtensions
{
// Is this driver a correct OpenGL 1.2 driver?
bool Version1_2;
std::string GLVersion;
// Required Extensions.
bool ARBMultiTexture;
@ -83,7 +82,6 @@ struct CGlExtensions
// ARB Extensions
bool ARBTextureCompression;
bool ARBFragmentProgram;
bool ARBVertexProgram;
bool ARBTextureNonPowerOfTwo;
bool ARBMultisample;
@ -98,7 +96,6 @@ public:
CGlExtensions()
{
// Fill all false by default.
Version1_2= false;
ARBMultiTexture= false;
NbTextureStages= 1;
EXTTextureEnvCombine= false;
@ -122,7 +119,6 @@ public:
ATIEnvMapBumpMap = false;
ATIFragmentShader = false;
ARBFragmentProgram = false;
ARBVertexProgram = false;
NVTextureRectangle = false;
EXTTextureRectangle = false;
EXTTextureFilterAnisotropic = false;
@ -144,7 +140,7 @@ public:
std::string toString()
{
std::string result = "OpenGL version ";
result += Version1_2 ? "1.2 or above(*)" : "1.1 or below";
result += GLVersion;
result += "; Available extensions:";
result += "\n Texturing: ";
@ -169,7 +165,7 @@ public:
result += NVTextureShader ? "NVTextureShader " : "";
result += ATIFragmentShader ? "ATIFragmentShader " : "";
result += ARBFragmentProgram ? "ARBFragmentProgram " : "";
result += ARBVertexProgram ? "ARBVertexProgram " : "";
result += "ARBVertexProgram";
result += "\n Misc: ";
result += EXTVertexWeighting ? "EXTVertexWeighting " : "";

@ -518,11 +518,8 @@ static inline GLenum translateWrapToGl(ITexture::TWrapMode mode, const CGlExtens
H_AUTO_OGL(translateWrapToGl)
if(mode== ITexture::Repeat)
return GL_REPEAT;
if(extensions.Version1_2)
return GL_CLAMP_TO_EDGE;
return GL_CLAMP;
return GL_CLAMP_TO_EDGE;
}
// ***************************************************************************

@ -41,11 +41,7 @@ CVertexProgamDrvInfosGL3::CVertexProgamDrvInfosGL3 (CDriverGL3 *drv, ItVtxPrgDrv
{
H_AUTO_OGL(CVertexProgamDrvInfosGL_CVertexProgamDrvInfosGL);
// Extension must exist
nlassert ( drv->_Extensions.ARBVertexProgram );
nglGenProgramsARB(1, &ID);
}
//=================================================================================================

Loading…
Cancel
Save