--- Irrlicht.old/COpenGLDriver.cpp 2005-03-28 11:39:08.000000000 +0200 +++ Irrlicht-0.9/COpenGLDriver.cpp 2005-04-06 13:16:27.057722522 +0200 @@ -14,8 +14,9 @@ #include "COpenGLNormalMapRenderer.h" #include "COpenGLParallaxMapRenderer.h" #include "os.h" -#include -#include +#include +#include +#include namespace irr { @@ -344,6 +345,21 @@ renderer->drop(); } +bool COpenGLDriver::hasExtension(const char *extensionName) +{ + const GLubyte* t = glGetString(GL_EXTENSIONS); + const char *p = (const char *)t; + const int length = strlen(extensionName); + + while ((p=strstr(p, extensionName))) + { + p+=length; + if ((!*p) || isspace(*p)) + return true; + } + return false; +} + void COpenGLDriver::loadExtensions() { if (atof((c8*)glGetString(GL_VERSION)) >= 1.2) @@ -322,41 +338,12 @@ else os::Printer::log("OpenGL driver version is not 1.2 or better.", ELL_WARNING); - const GLubyte* t = glGetString(GL_EXTENSIONS); - s32 len = (s32)strlen((const char*)t); - c8 *str = new c8[len+1]; - c8* p = str; - - for (s32 i=0; i getCurrentRenderTargetSize(); + bool hasExtension(const char* extensionName); void loadExtensions(); void createMaterialRenderers();