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

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

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

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

Loading…
Cancel
Save