Commit d52e5124 authored by hybrid's avatar hybrid

Add the missing extension pointers for NV_occlusion_query

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3268 dfc29bdd-3216-0410-991c-e03cc46cb475
parent ab82717b
...@@ -67,7 +67,11 @@ COpenGLExtensionHandler::COpenGLExtensionHandler() : ...@@ -67,7 +67,11 @@ COpenGLExtensionHandler::COpenGLExtensionHandler() :
pGlProgramParameteriARB(0), pGlProgramParameteriEXT(0), pGlProgramParameteriARB(0), pGlProgramParameteriEXT(0),
pGlGenQueriesARB(0), pGlDeleteQueriesARB(0), pGlIsQueryARB(0), pGlGenQueriesARB(0), pGlDeleteQueriesARB(0), pGlIsQueryARB(0),
pGlBeginQueryARB(0), pGlEndQueryARB(0), pGlGetQueryivARB(0), pGlBeginQueryARB(0), pGlEndQueryARB(0), pGlGetQueryivARB(0),
pGlGetQueryObjectivARB(0), pGlGetQueryObjectuivARB(0) pGlGetQueryObjectivARB(0), pGlGetQueryObjectuivARB(0),
pGlGenOcclusionQueriesNV(0), pGlDeleteOcclusionQueriesNV(0),
pGlIsOcclusionQueryNV(0), pGlBeginOcclusionQueryNV(0),
pGlEndOcclusionQueryNV(0), pGlGetOcclusionQueryivNV(0),
pGlGetOcclusionQueryuivNV(0)
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
{ {
for (u32 i=0; i<IRR_OpenGL_Feature_Count; ++i) for (u32 i=0; i<IRR_OpenGL_Feature_Count; ++i)
...@@ -247,6 +251,13 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) ...@@ -247,6 +251,13 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
pGlGetQueryivARB = (PFNGLGETQUERYIVARBPROC) wglGetProcAddress("glGetQueryivARB"); pGlGetQueryivARB = (PFNGLGETQUERYIVARBPROC) wglGetProcAddress("glGetQueryivARB");
pGlGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC) wglGetProcAddress("glGetQueryObjectivARB"); pGlGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC) wglGetProcAddress("glGetQueryObjectivARB");
pGlGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC) wglGetProcAddress("glGetQueryObjectuivARB"); pGlGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC) wglGetProcAddress("glGetQueryObjectuivARB");
pGlGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC) wglGetProcAddress("glGenOcclusionQueriesNV");
pGlDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC) wglGetProcAddress("glDeleteOcclusionQueriesNV");
pGlIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC) wglGetProcAddress("glIsOcclusionQueryNV");
pGlBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC) wglGetProcAddress("glBeginOcclusionQueryNV");
pGlEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC) wglGetProcAddress("glEndOcclusionQueryNV");
pGlGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC) wglGetProcAddress("glGetOcclusionQueryivNV");
pGlGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC) wglGetProcAddress("glGetOcclusionQueryuivNV");
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined (_IRR_COMPILE_WITH_SDL_DEVICE_) #elif defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined (_IRR_COMPILE_WITH_SDL_DEVICE_)
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
...@@ -565,6 +576,27 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) ...@@ -565,6 +576,27 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
pGlGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC) pGlGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glGetQueryObjectuivARB")); IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glGetQueryObjectuivARB"));
pGlGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glGenOcclusionQueriesNV"));
pGlDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glDeleteOcclusionQueriesNV"));
pGlIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glIsOcclusionQueryNV"));
pGlBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glBeginOcclusionQueryNV"));
pGlEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glEndOcclusionQueryNV"));
pGlGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glGetOcclusionQueryivNV"));
pGlGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)
IRR_OGL_LOAD_EXTENSION(reinterpret_cast<const GLubyte*>("glGetOcclusionQueryuivNV"));
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
#endif // _IRR_WINDOWS_API_ #endif // _IRR_WINDOWS_API_
......
...@@ -1084,6 +1084,13 @@ class COpenGLExtensionHandler ...@@ -1084,6 +1084,13 @@ class COpenGLExtensionHandler
PFNGLGETQUERYIVARBPROC pGlGetQueryivARB; PFNGLGETQUERYIVARBPROC pGlGetQueryivARB;
PFNGLGETQUERYOBJECTIVARBPROC pGlGetQueryObjectivARB; PFNGLGETQUERYOBJECTIVARBPROC pGlGetQueryObjectivARB;
PFNGLGETQUERYOBJECTUIVARBPROC pGlGetQueryObjectuivARB; PFNGLGETQUERYOBJECTUIVARBPROC pGlGetQueryObjectuivARB;
PFNGLGENOCCLUSIONQUERIESNVPROC pGlGenOcclusionQueriesNV;
PFNGLDELETEOCCLUSIONQUERIESNVPROC pGlDeleteOcclusionQueriesNV;
PFNGLISOCCLUSIONQUERYNVPROC pGlIsOcclusionQueryNV;
PFNGLBEGINOCCLUSIONQUERYNVPROC pGlBeginOcclusionQueryNV;
PFNGLENDOCCLUSIONQUERYNVPROC pGlEndOcclusionQueryNV;
PFNGLGETOCCLUSIONQUERYIVNVPROC pGlGetOcclusionQueryivNV;
PFNGLGETOCCLUSIONQUERYUIVNVPROC pGlGetOcclusionQueryuivNV;
#endif #endif
}; };
...@@ -2110,12 +2117,14 @@ inline void COpenGLExtensionHandler::extGlGenQueries(GLsizei n, GLuint *ids) ...@@ -2110,12 +2117,14 @@ inline void COpenGLExtensionHandler::extGlGenQueries(GLsizei n, GLuint *ids)
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlGenQueriesARB) if (pGlGenQueriesARB)
pGlGenQueriesARB(n, ids); pGlGenQueriesARB(n, ids);
else if (pGlGenOcclusionQueriesNV)
pGlGenOcclusionQueriesNV(n, ids);
#elif defined(GL_ARB_occlusion_query) #elif defined(GL_ARB_occlusion_query)
glGenQueriesARB(n, ids); glGenQueriesARB(n, ids);
#elif defined(GL_NV_occlusion_query) #elif defined(GL_NV_occlusion_query)
glGenOcclusionQueriesNV(n, ids); glGenOcclusionQueriesNV(n, ids);
#else #else
os::Printer::log("glGenQueriesARB not supported", ELL_ERROR); os::Printer::log("glGenQueries not supported", ELL_ERROR);
#endif #endif
} }
...@@ -2124,12 +2133,14 @@ inline void COpenGLExtensionHandler::extGlDeleteQueries(GLsizei n, const GLuint ...@@ -2124,12 +2133,14 @@ inline void COpenGLExtensionHandler::extGlDeleteQueries(GLsizei n, const GLuint
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlDeleteQueriesARB) if (pGlDeleteQueriesARB)
pGlDeleteQueriesARB(n, ids); pGlDeleteQueriesARB(n, ids);
else if (pGlDeleteOcclusionQueriesNV)
pGlDeleteOcclusionQueriesNV(n, ids);
#elif defined(GL_ARB_occlusion_query) #elif defined(GL_ARB_occlusion_query)
glDeleteQueriesARB(n, ids); glDeleteQueriesARB(n, ids);
#elif defined(GL_NV_occlusion_query) #elif defined(GL_NV_occlusion_query)
glDeleteOcclusionQueriesNV(n, ids); glDeleteOcclusionQueriesNV(n, ids);
#else #else
os::Printer::log("glDeleteQueriesARB not supported", ELL_ERROR); os::Printer::log("glDeleteQueries not supported", ELL_ERROR);
#endif #endif
} }
...@@ -2138,6 +2149,8 @@ inline GLboolean COpenGLExtensionHandler::extGlIsQuery(GLuint id) ...@@ -2138,6 +2149,8 @@ inline GLboolean COpenGLExtensionHandler::extGlIsQuery(GLuint id)
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlIsQueryARB) if (pGlIsQueryARB)
return pGlIsQueryARB(id); return pGlIsQueryARB(id);
else if (pGlIsOcclusionQueryNV)
return pGlIsOcclusionQueryNV(id);
#elif defined(GL_ARB_occlusion_query) #elif defined(GL_ARB_occlusion_query)
return glIsQueryARB(id); return glIsQueryARB(id);
#elif defined(GL_NV_occlusion_query) #elif defined(GL_NV_occlusion_query)
...@@ -2152,12 +2165,14 @@ inline void COpenGLExtensionHandler::extGlBeginQuery(GLenum target, GLuint id) ...@@ -2152,12 +2165,14 @@ inline void COpenGLExtensionHandler::extGlBeginQuery(GLenum target, GLuint id)
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlBeginQueryARB) if (pGlBeginQueryARB)
pGlBeginQueryARB(target, id); pGlBeginQueryARB(target, id);
else if (pGlBeginOcclusionQueryNV)
pGlBeginOcclusionQueryNV(id);
#elif defined(GL_ARB_occlusion_query) #elif defined(GL_ARB_occlusion_query)
glBeginQueryARB(target, id); glBeginQueryARB(target, id);
#elif defined(GL_NV_occlusion_query) #elif defined(GL_NV_occlusion_query)
glBeginOcclusionQueryNV(id); glBeginOcclusionQueryNV(id);
#else #else
os::Printer::log("glBeginQueryARB not supported", ELL_ERROR); os::Printer::log("glBeginQuery not supported", ELL_ERROR);
#endif #endif
} }
...@@ -2166,12 +2181,14 @@ inline void COpenGLExtensionHandler::extGlEndQuery(GLenum target) ...@@ -2166,12 +2181,14 @@ inline void COpenGLExtensionHandler::extGlEndQuery(GLenum target)
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlEndQueryARB) if (pGlEndQueryARB)
pGlEndQueryARB(target); pGlEndQueryARB(target);
else if (pGlEndOcclusionQueryNV)
pGlEndOcclusionQueryNV();
#elif defined(GL_ARB_occlusion_query) #elif defined(GL_ARB_occlusion_query)
glEndQueryARB(target); glEndQueryARB(target);
#elif defined(GL_NV_occlusion_query) #elif defined(GL_NV_occlusion_query)
glEndOcclusionQueryNV(); glEndOcclusionQueryNV();
#else #else
os::Printer::log("glEndQueryARB not supported", ELL_ERROR); os::Printer::log("glEndQuery not supported", ELL_ERROR);
#endif #endif
} }
...@@ -2192,6 +2209,8 @@ inline void COpenGLExtensionHandler::extGlGetQueryObjectiv(GLuint id, GLenum pna ...@@ -2192,6 +2209,8 @@ inline void COpenGLExtensionHandler::extGlGetQueryObjectiv(GLuint id, GLenum pna
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlGetQueryObjectivARB) if (pGlGetQueryObjectivARB)
pGlGetQueryObjectivARB(id, pname, params); pGlGetQueryObjectivARB(id, pname, params);
else if (pGlGetOcclusionQueryivNV)
pGlGetOcclusionQueryivNV(id, pname, params);
#elif defined(GL_ARB_occlusion_query) #elif defined(GL_ARB_occlusion_query)
glGetQueryObjectivARB(id, pname, params); glGetQueryObjectivARB(id, pname, params);
#elif defined(GL_NV_occlusion_query) #elif defined(GL_NV_occlusion_query)
...@@ -2206,6 +2225,8 @@ inline void COpenGLExtensionHandler::extGlGetQueryObjectuiv(GLuint id, GLenum pn ...@@ -2206,6 +2225,8 @@ inline void COpenGLExtensionHandler::extGlGetQueryObjectuiv(GLuint id, GLenum pn
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlGetQueryObjectuivARB) if (pGlGetQueryObjectuivARB)
pGlGetQueryObjectuivARB(id, pname, params); pGlGetQueryObjectuivARB(id, pname, params);
else if (pGlGetOcclusionQueryuivNV)
pGlGetOcclusionQueryuivNV(id, pname, params);
#elif defined(GL_ARB_occlusion_query) #elif defined(GL_ARB_occlusion_query)
glGetQueryObjectuivARB(id, pname, params); glGetQueryObjectuivARB(id, pname, params);
#elif defined(GL_NV_occlusion_query) #elif defined(GL_NV_occlusion_query)
...@@ -2222,4 +2243,3 @@ inline void COpenGLExtensionHandler::extGlGetQueryObjectuiv(GLuint id, GLenum pn ...@@ -2222,4 +2243,3 @@ inline void COpenGLExtensionHandler::extGlGetQueryObjectuiv(GLuint id, GLenum pn
#endif #endif
#endif #endif
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