Commit a86a0756 authored by hybrid's avatar hybrid

Some safety add-on to cope with bad OpenGL implementations.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2433 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 0fa0ac5c
...@@ -74,8 +74,13 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) ...@@ -74,8 +74,13 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
{ {
const char* t = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)); const char* t = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
const size_t len = strlen(t); size_t len = 0;
c8 *str = new c8[len+1]; c8 *str = 0;
if (t)
{
len = strlen(t);
str = new c8[len+1];
}
c8* p = str; c8* p = str;
for (size_t i=0; i<len; ++i) for (size_t i=0; i<len; ++i)
...@@ -199,8 +204,9 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) ...@@ -199,8 +204,9 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
#ifndef _IRR_GETPROCADDRESS_WORKAROUND_ #ifndef _IRR_GETPROCADDRESS_WORKAROUND_
__GLXextFuncPtr (*IRR_OGL_LOAD_EXTENSION)(const GLubyte*)=0; __GLXextFuncPtr (*IRR_OGL_LOAD_EXTENSION)(const GLubyte*)=0;
#ifdef GLX_VERSION_1_4 #ifdef GLX_VERSION_1_4
int major,minor; int major=0,minor=0;
glXQueryVersion(glXGetCurrentDisplay(), &major, &minor); if (glXGetCurrentDisplay())
glXQueryVersion(glXGetCurrentDisplay(), &major, &minor);
if ((major>1) || (minor>3)) if ((major>1) || (minor>3))
IRR_OGL_LOAD_EXTENSION=glXGetProcAddress; IRR_OGL_LOAD_EXTENSION=glXGetProcAddress;
else else
......
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