diff options
author | Eric Anholt <eric@anholt.net> | 2014-01-21 20:09:39 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2014-02-22 19:07:54 -0800 |
commit | d03da93a93f9a65a75f56fb6a7d4c8dee83904f7 (patch) | |
tree | a39626f5c767c9e1752405ab983ca6a23d3aa17c /tests/glean | |
parent | 530b798dc34e9cbae8f0c9563b0fb22d7d12bfe5 (diff) |
glean: Use piglit-dispatch instead of calling piglit_get_proc_address().
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'tests/glean')
-rw-r--r-- | tests/glean/geomrend.cpp | 6 | ||||
-rw-r--r-- | tests/glean/glutils.cpp | 13 | ||||
-rw-r--r-- | tests/glean/glutils.h | 5 | ||||
-rw-r--r-- | tests/glean/tapi2.cpp | 293 | ||||
-rw-r--r-- | tests/glean/tapi2.h | 1 | ||||
-rw-r--r-- | tests/glean/tblend.cpp | 47 | ||||
-rw-r--r-- | tests/glean/tbufferobject.cpp | 82 | ||||
-rw-r--r-- | tests/glean/tdepthstencil.cpp | 9 | ||||
-rw-r--r-- | tests/glean/tfbo.cpp | 255 | ||||
-rw-r--r-- | tests/glean/tfragprog1.cpp | 56 | ||||
-rw-r--r-- | tests/glean/tglsl1.cpp | 288 | ||||
-rw-r--r-- | tests/glean/tglsl1.h | 1 | ||||
-rw-r--r-- | tests/glean/toccluqry.cpp | 111 | ||||
-rw-r--r-- | tests/glean/tpbo.cpp | 329 | ||||
-rw-r--r-- | tests/glean/tpointatten.cpp | 18 | ||||
-rw-r--r-- | tests/glean/tpointsprite.cpp | 12 | ||||
-rw-r--r-- | tests/glean/tshaderapi.cpp | 171 | ||||
-rw-r--r-- | tests/glean/tshaderapi.h | 2 | ||||
-rw-r--r-- | tests/glean/tstencil2.cpp | 94 | ||||
-rw-r--r-- | tests/glean/tstencil2.h | 2 | ||||
-rw-r--r-- | tests/glean/ttexcombine.cpp | 14 | ||||
-rw-r--r-- | tests/glean/ttexswizzle.cpp | 19 | ||||
-rw-r--r-- | tests/glean/ttexunits.cpp | 29 | ||||
-rw-r--r-- | tests/glean/tvertattrib.cpp | 417 | ||||
-rw-r--r-- | tests/glean/tvertattrib.h | 1 | ||||
-rw-r--r-- | tests/glean/tvertprog1.cpp | 51 |
26 files changed, 649 insertions, 1677 deletions
diff --git a/tests/glean/geomrend.cpp b/tests/glean/geomrend.cpp index 4d6d0859f..dcd7f3070 100644 --- a/tests/glean/geomrend.cpp +++ b/tests/glean/geomrend.cpp @@ -247,10 +247,7 @@ bool GeomRenderer::renderPrimitives(GLenum mode) // Should we lock? if (compileArrays) { - PFNGLLOCKARRAYSEXTPROC glLockArraysEXT = 0; assert(GLUtils::haveExtension("GL_EXT_compiled_vertex_array")); - glLockArraysEXT = reinterpret_cast<PFNGLLOCKARRAYSEXTPROC> - (GLUtils::getProcAddress("glLockArraysEXT")); glLockArraysEXT(0, arrayLength); } @@ -277,10 +274,7 @@ bool GeomRenderer::renderPrimitives(GLenum mode) // Done. If we locked, unlock. if (compileArrays) { - PFNGLUNLOCKARRAYSEXTPROC glUnlockArraysEXT = 0; assert(GLUtils::haveExtension("GL_EXT_compiled_vertex_array")); - glUnlockArraysEXT = reinterpret_cast<PFNGLUNLOCKARRAYSEXTPROC> - (GLUtils::getProcAddress("glUnlockArraysEXT")); glUnlockArraysEXT(); } } diff --git a/tests/glean/glutils.cpp b/tests/glean/glutils.cpp index 81be2f015..12d9b8839 100644 --- a/tests/glean/glutils.cpp +++ b/tests/glean/glutils.cpp @@ -110,19 +110,6 @@ getVersion() return atof((const char *) version); } - -/////////////////////////////////////////////////////////////////////////////// -// getProcAddress: Get address of an OpenGL or window-system-binding function. -// This belongs here, rather than as a member of RenderingContext, because -// on Windows it must only be applied to the *current* context. (The -// return value on Windows is context-dependent, and wglGetProcAddress -// doesn't take a rendering context as an argument.) -/////////////////////////////////////////////////////////////////////////////// -void -(APIENTRY *getProcAddress(const char* name))() { - return piglit_get_proc_address(name); -} // getProcAddress - /////////////////////////////////////////////////////////////////////////////// // logGLErrors: Check for OpenGL errors and log any that have occurred. /////////////////////////////////////////////////////////////////////////////// diff --git a/tests/glean/glutils.h b/tests/glean/glutils.h index 0015d1386..b943a21b2 100644 --- a/tests/glean/glutils.h +++ b/tests/glean/glutils.h @@ -54,11 +54,6 @@ inline bool haveExtension(const char* name) { return haveExtensions(name); } -// Get a pointer to a function (usually, an extension function). -// Like haveExtension, we have to do this here rather than in -// RenderingContext. -void (APIENTRY *getProcAddress(const char* name))(); - // Return GL renderer version as a float (1.1, 2.0, etc) float getVersion(); diff --git a/tests/glean/tapi2.cpp b/tests/glean/tapi2.cpp index 9a88f9f2f..ab8727931 100644 --- a/tests/glean/tapi2.cpp +++ b/tests/glean/tapi2.cpp @@ -40,143 +40,6 @@ namespace GLEAN { - -static PFNGLATTACHSHADERPROC glAttachShader_func = NULL; -static PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation_func = NULL; -static PFNGLCOMPILESHADERPROC glCompileShader_func = NULL; -static PFNGLCREATEPROGRAMPROC glCreateProgram_func = NULL; -static PFNGLCREATESHADERPROC glCreateShader_func = NULL; -static PFNGLDELETEPROGRAMPROC glDeleteProgram_func = NULL; -static PFNGLDELETESHADERPROC glDeleteShader_func = NULL; -static PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray_func = NULL; -static PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray_func = NULL; -static PFNGLGETATTACHEDSHADERSPROC glGetAttachedShaders_func = NULL; -static PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation_func = NULL; -static PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog_func = NULL; -static PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog_func = NULL; -static PFNGLGETSHADERIVPROC glGetShaderiv_func = NULL; -static PFNGLGETPROGRAMIVPROC glGetProgramiv_func = NULL; -static PFNGLGETSHADERSOURCEPROC glGetShaderSource_func = NULL; -static PFNGLGETUNIFORMFVPROC glGetUniformfv_func = NULL; -static PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation_func = NULL; -static PFNGLISPROGRAMPROC glIsProgram_func = NULL; -static PFNGLISSHADERPROC glIsShader_func = NULL; -static PFNGLLINKPROGRAMPROC glLinkProgram_func = NULL; -static PFNGLSHADERSOURCEPROC glShaderSource_func = NULL; -static PFNGLUNIFORM1FVPROC glUniform1fv_func = NULL; -static PFNGLUNIFORM2FVPROC glUniform2fv_func = NULL; -static PFNGLUNIFORM3FVPROC glUniform3fv_func = NULL; -static PFNGLUNIFORM4FVPROC glUniform4fv_func = NULL; -static PFNGLUNIFORM1FPROC glUniform1f_func = NULL; -static PFNGLUNIFORM2FPROC glUniform2f_func = NULL; -static PFNGLUNIFORM3FPROC glUniform3f_func = NULL; -static PFNGLUNIFORM4FPROC glUniform4f_func = NULL; -static PFNGLUNIFORM1IPROC glUniform1i_func = NULL; -static PFNGLUNIFORM2IPROC glUniform2i_func = NULL; -static PFNGLUNIFORM3IPROC glUniform3i_func = NULL; -static PFNGLUNIFORM4IPROC glUniform4i_func = NULL; -static PFNGLUNIFORM1IVPROC glUniform1iv_func = NULL; -static PFNGLUNIFORM2IVPROC glUniform2iv_func = NULL; -static PFNGLUNIFORM3IVPROC glUniform3iv_func = NULL; -static PFNGLUNIFORM4IVPROC glUniform4iv_func = NULL; -static PFNGLUNIFORMMATRIX2FVPROC glUniformMatrix2fv_func = NULL; -static PFNGLUNIFORMMATRIX3FVPROC glUniformMatrix3fv_func = NULL; -static PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv_func = NULL; -static PFNGLUSEPROGRAMPROC glUseProgram_func = NULL; -static PFNGLVALIDATEPROGRAMPROC glValidateProgram_func = NULL; - -static PFNGLVERTEXATTRIB1FPROC glVertexAttrib1f_func = NULL; -static PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f_func = NULL; -static PFNGLVERTEXATTRIB3FPROC glVertexAttrib3f_func = NULL; -static PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f_func = NULL; -static PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer_func = NULL; - -static PFNGLSTENCILOPSEPARATEPROC glStencilOpSeparate_func = NULL; -static PFNGLSTENCILFUNCSEPARATEPROC glStencilFuncSeparate_func = NULL; -static PFNGLSTENCILMASKSEPARATEPROC glStencilMaskSeparate_func = NULL; - -static PFNGLBLENDEQUATIONSEPARATEPROC glBlendEquationSeparate_func = NULL; -static PFNGLDRAWBUFFERSPROC glDrawBuffers_func = NULL; - - - -// Get ptrs to 2.0 API functions. -// \param errorFunc returns name of API function in case of error -// \return true for success, false for error -bool -API2Test::getFunctions_2_0(const char **errorFunc) -{ -#define GET(PTR, TYPE, STR) \ - PTR = (TYPE) GLUtils::getProcAddress(STR); \ - if (!PTR) { \ - *errorFunc = STR; \ - return false; \ - } - - // shading language - GET(glAttachShader_func, PFNGLATTACHSHADERPROC, "glAttachShader"); - GET(glBindAttribLocation_func, PFNGLBINDATTRIBLOCATIONPROC, "glBindAttribLocation"); - GET(glCompileShader_func, PFNGLCOMPILESHADERPROC, "glCompileShader"); - GET(glCreateProgram_func, PFNGLCREATEPROGRAMPROC, "glCreateProgram"); - GET(glCreateShader_func, PFNGLCREATESHADERPROC, "glCreateShader"); - GET(glDeleteProgram_func, PFNGLDELETEPROGRAMPROC, "glDeleteProgram"); - GET(glDeleteShader_func, PFNGLDELETESHADERPROC, "glDeleteShader"); - GET(glDisableVertexAttribArray_func, PFNGLDISABLEVERTEXATTRIBARRAYPROC, "glDisableVertexAttribArray"); - GET(glEnableVertexAttribArray_func, PFNGLENABLEVERTEXATTRIBARRAYPROC, "glEnableVertexAttribArray"); - GET(glGetAttachedShaders_func, PFNGLGETATTACHEDSHADERSPROC, "glGetAttachedShaders"); - GET(glGetAttribLocation_func, PFNGLGETATTRIBLOCATIONPROC, "glGetAttribLocation"); - GET(glGetProgramInfoLog_func, PFNGLGETPROGRAMINFOLOGPROC, "glGetProgramInfoLog"); - GET(glGetShaderInfoLog_func, PFNGLGETSHADERINFOLOGPROC, "glGetShaderInfoLog"); - GET(glGetProgramiv_func, PFNGLGETPROGRAMIVPROC, "glGetProgramiv"); - GET(glGetShaderiv_func, PFNGLGETSHADERIVPROC, "glGetShaderiv"); - GET(glGetShaderSource_func, PFNGLGETSHADERSOURCEPROC, "glGetShaderSource"); - GET(glGetUniformLocation_func, PFNGLGETUNIFORMLOCATIONPROC, "glGetUniformLocation"); - GET(glGetUniformfv_func, PFNGLGETUNIFORMFVPROC, "glGetUniformfv"); - GET(glIsProgram_func, PFNGLISPROGRAMPROC, "glIsProgram"); - GET(glIsShader_func, PFNGLISSHADERPROC, "glIsShader"); - GET(glLinkProgram_func, PFNGLLINKPROGRAMPROC, "glLinkProgram"); - GET(glShaderSource_func, PFNGLSHADERSOURCEPROC, "glShaderSource"); - GET(glUniform1f_func, PFNGLUNIFORM1FPROC, "glUniform1f"); - GET(glUniform2f_func, PFNGLUNIFORM2FPROC, "glUniform2f"); - GET(glUniform3f_func, PFNGLUNIFORM3FPROC, "glUniform3f"); - GET(glUniform4f_func, PFNGLUNIFORM4FPROC, "glUniform4f"); - GET(glUniform1fv_func, PFNGLUNIFORM1FVPROC, "glUniform1fv"); - GET(glUniform2fv_func, PFNGLUNIFORM2FVPROC, "glUniform2fv"); - GET(glUniform3fv_func, PFNGLUNIFORM3FVPROC, "glUniform3fv"); - GET(glUniform4fv_func, PFNGLUNIFORM3FVPROC, "glUniform4fv"); - GET(glUniform1i_func, PFNGLUNIFORM1IPROC, "glUniform1i"); - GET(glUniform2i_func, PFNGLUNIFORM2IPROC, "glUniform2i"); - GET(glUniform3i_func, PFNGLUNIFORM3IPROC, "glUniform3i"); - GET(glUniform4i_func, PFNGLUNIFORM4IPROC, "glUniform4i"); - GET(glUniform1iv_func, PFNGLUNIFORM1IVPROC, "glUniform1iv"); - GET(glUniform2iv_func, PFNGLUNIFORM2IVPROC, "glUniform2iv"); - GET(glUniform3iv_func, PFNGLUNIFORM3IVPROC, "glUniform3iv"); - GET(glUniform4iv_func, PFNGLUNIFORM4IVPROC, "glUniform4iv"); - GET(glUniformMatrix2fv_func, PFNGLUNIFORMMATRIX2FVPROC, "glUniformMatrix2fv"); - GET(glUniformMatrix3fv_func, PFNGLUNIFORMMATRIX3FVPROC, "glUniformMatrix3fv"); - GET(glUniformMatrix4fv_func, PFNGLUNIFORMMATRIX4FVPROC, "glUniformMatrix4fv"); - GET(glUseProgram_func, PFNGLUSEPROGRAMPROC, "glUseProgram"); - GET(glValidateProgram_func, PFNGLVALIDATEPROGRAMPROC, "glValidateProgram"); - GET(glVertexAttrib1f_func, PFNGLVERTEXATTRIB1FPROC, "glVertexAttrib1f"); - GET(glVertexAttrib2f_func, PFNGLVERTEXATTRIB2FPROC, "glVertexAttrib2f"); - GET(glVertexAttrib3f_func, PFNGLVERTEXATTRIB3FPROC, "glVertexAttrib3f"); - GET(glVertexAttrib4f_func, PFNGLVERTEXATTRIB4FPROC, "glVertexAttrib4f"); - GET(glVertexAttribPointer_func, PFNGLVERTEXATTRIBPOINTERPROC, "glVertexAttribPointer"); - - // stencil - GET(glStencilOpSeparate_func, PFNGLSTENCILOPSEPARATEPROC, "glStencilOpSeparate"); - GET(glStencilFuncSeparate_func, PFNGLSTENCILFUNCSEPARATEPROC, "glStencilFuncSeparate"); - GET(glStencilMaskSeparate_func, PFNGLSTENCILMASKSEPARATEPROC, "glStencilMaskSeparate"); - - // misc - GET(glBlendEquationSeparate_func, PFNGLBLENDEQUATIONSEPARATEPROC, "glBlendEquationSeparate"); - GET(glDrawBuffers_func, PFNGLDRAWBUFFERSPROC, "glDrawBuffers"); - - return true; -#undef GET -} - - bool API2Test::setup(void) { @@ -186,14 +49,6 @@ API2Test::setup(void) return false; } - const char *errorFunc; - if (!getFunctions_2_0(&errorFunc)) { - env->log << "Unable to get pointer to OpenGL 2.0 function '" - << errorFunc - << "'\n"; - return false; - } - GLenum err = glGetError(); assert(!err); // should be OK @@ -311,14 +166,14 @@ API2Test::renderQuadWithArrays(GLint attr, const GLfloat value[4], glVertexPointer(3, GL_FLOAT, 0, vertcoords); glEnableClientState(GL_VERTEX_ARRAY); - glVertexAttribPointer_func(attr, 4, GL_FLOAT, GL_FALSE, 0, values); - glEnableVertexAttribArray_func(attr); + glVertexAttribPointer(attr, 4, GL_FLOAT, GL_FALSE, 0, values); + glEnableVertexAttribArray(attr); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glDrawArrays(GL_POLYGON, 0, 4); glDisableClientState(GL_VERTEX_ARRAY); - glDisableVertexAttribArray_func(attr); + glDisableVertexAttribArray(attr); // read a pixel from lower-left corner of rendered quad glReadPixels(windowSize / 2 - 2, windowSize / 2 - 2, 1, 1, @@ -330,34 +185,34 @@ GLuint API2Test::loadAndCompileShader(GLenum target, const char *text) { GLint stat, val; - GLuint shader = glCreateShader_func(target); + GLuint shader = glCreateShader(target); if (!shader) { REPORT_FAILURE("glCreateShader failed (fragment)"); return 0; } - glShaderSource_func(shader, 1, - (const GLchar **) &text, NULL); - glCompileShader_func(shader); - glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat); + glShaderSource(shader, 1, + (const GLchar **) &text, NULL); + glCompileShader(shader); + glGetShaderiv(shader, GL_COMPILE_STATUS, &stat); if (!stat) { REPORT_FAILURE_T("glShaderSource or glCompileShader failed", target); return 0; } - if (!glIsShader_func(shader)) { + if (!glIsShader(shader)) { REPORT_FAILURE("glIsShader failed (fragment)"); return false; } - glGetShaderiv_func(shader, GL_SHADER_TYPE, &val); + glGetShaderiv(shader, GL_SHADER_TYPE, &val); if (val != (GLint) target) { REPORT_FAILURE_T("glGetShaderiv(GL_SHADER_TYPE) failed", target); return 0; } - glGetShaderiv_func(shader, GL_COMPILE_STATUS, &val); + glGetShaderiv(shader, GL_COMPILE_STATUS, &val); if (val != GL_TRUE) { REPORT_FAILURE_T("glGetShaderiv(GL_COMPILE_STATUS) failed", target); return 0; } - glGetShaderiv_func(shader, GL_SHADER_SOURCE_LENGTH, &val); + glGetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &val); // Note: some OpenGLs return a 1-char shorter length than strlen(text) if (abs(val - (int) strlen(text)) > 1) { REPORT_FAILURE_T("glGetShaderiv(GL_SHADER_SOURCE_LENGTH) failed", target); @@ -370,12 +225,12 @@ API2Test::loadAndCompileShader(GLenum target, const char *text) GLuint API2Test::createProgram(GLuint vertShader, GLuint fragShader) { - GLuint program = glCreateProgram_func(); + GLuint program = glCreateProgram(); if (vertShader) - glAttachShader_func(program, vertShader); + glAttachShader(program, vertShader); if (fragShader) - glAttachShader_func(program, fragShader); - glLinkProgram_func(program); + glAttachShader(program, fragShader); + glLinkProgram(program); return program; } @@ -407,12 +262,12 @@ API2Test::testShaderObjectFuncs(void) REPORT_FAILURE("glCreateProgram failed"); return false; } - glGetProgramiv_func(program, GL_LINK_STATUS, &stat); + glGetProgramiv(program, GL_LINK_STATUS, &stat); if (!stat) { REPORT_FAILURE("glLinkProgram failed"); return false; } - glUseProgram_func(program); + glUseProgram(program); glGetIntegerv(GL_CURRENT_PROGRAM, &val); if (val != (GLint) program) { @@ -426,19 +281,19 @@ API2Test::testShaderObjectFuncs(void) return false; } - if (!glIsProgram_func(program)) { + if (!glIsProgram(program)) { REPORT_FAILURE("glIsProgram failed"); return false; } GLuint objects[2]; GLsizei count; - glGetProgramiv_func(program, GL_ATTACHED_SHADERS, &val); + glGetProgramiv(program, GL_ATTACHED_SHADERS, &val); if (val != 2) { REPORT_FAILURE("glGetProgramiv(GL_ATTACHED_SHADERS) failed"); return false; } - glGetAttachedShaders_func(program, 2, &count, objects); + glGetAttachedShaders(program, 2, &count, objects); if (count != 2) { REPORT_FAILURE("glGetAttachedShaders failed (wrong count)"); return false; @@ -452,52 +307,52 @@ API2Test::testShaderObjectFuncs(void) return false; } - glValidateProgram_func(program); - glGetProgramiv_func(program, GL_VALIDATE_STATUS, &stat); + glValidateProgram(program); + glGetProgramiv(program, GL_VALIDATE_STATUS, &stat); if (!stat) { REPORT_FAILURE("glValidateProgram failed"); return false; } // Delete vertex shader - glDeleteShader_func(vertShader); - if (!glIsShader_func(vertShader)) { + glDeleteShader(vertShader); + if (!glIsShader(vertShader)) { // the shader is still attached so the handle should be valid REPORT_FAILURE("glIsShader(deleted shader) failed"); return false; } - glGetShaderiv_func(vertShader, GL_DELETE_STATUS, &stat); + glGetShaderiv(vertShader, GL_DELETE_STATUS, &stat); if (stat != GL_TRUE) { REPORT_FAILURE("Incorrect shader delete status"); return false; } // Delete fragment shader - glDeleteShader_func(fragShader); + glDeleteShader(fragShader); // Delete program object - glDeleteProgram_func(program); - if (!glIsProgram_func(program)) { + glDeleteProgram(program); + if (!glIsProgram(program)) { // the program is still in use so the handle should be valid REPORT_FAILURE("glIsProgram(deleted program) failed"); return false; } - glGetProgramiv_func(program, GL_DELETE_STATUS, &stat); + glGetProgramiv(program, GL_DELETE_STATUS, &stat); if (stat != GL_TRUE) { REPORT_FAILURE("Incorrect program delete status"); return false; } // now unbind the program - glUseProgram_func(0); - stat = glIsProgram_func(program); + glUseProgram(0); + stat = glIsProgram(program); if (stat) { // the program and handle should have really been deleted now REPORT_FAILURE("glIsProgram(deleted program) failed"); return false; } - glGetProgramiv_func(program, GL_DELETE_STATUS, &stat); + glGetProgramiv(program, GL_DELETE_STATUS, &stat); err = glGetError(); if (!err) { // the program and handle should have been deleted now @@ -534,24 +389,24 @@ API2Test::testUniformfFuncs(void) REPORT_FAILURE("glCreateProgram (uniform test) failed"); return false; } - glUseProgram_func(program); + glUseProgram(program); - uf1 = glGetUniformLocation_func(program, "uf1"); + uf1 = glGetUniformLocation(program, "uf1"); if (uf1 < 0) { REPORT_FAILURE("glGetUniform \"uf1\" failed"); return false; } - uf2 = glGetUniformLocation_func(program, "uf2"); + uf2 = glGetUniformLocation(program, "uf2"); if (uf2 < 0) { REPORT_FAILURE("glGetUniform \"uf2\" failed"); return false; } - uf3 = glGetUniformLocation_func(program, "uf3"); + uf3 = glGetUniformLocation(program, "uf3"); if (uf3 < 0) { REPORT_FAILURE("glGetUniform \"uf3\" failed"); return false; } - uf4 = glGetUniformLocation_func(program, "uf4"); + uf4 = glGetUniformLocation(program, "uf4"); if (uf4 < 0) { REPORT_FAILURE("glGetUniform \"uf4\" failed"); return false; @@ -565,10 +420,10 @@ API2Test::testUniformfFuncs(void) expected[1] = 0.2; expected[2] = 0.3; expected[3] = 0.4; - glUniform1f_func(uf1, expected[0]); - glUniform2f_func(uf2, 0.0, expected[1]); - glUniform3f_func(uf3, 0.0, 0.0, expected[2]); - glUniform4f_func(uf4, 0.0, 0.0, 0.0, expected[3]); + glUniform1f(uf1, expected[0]); + glUniform2f(uf2, 0.0, expected[1]); + glUniform3f(uf3, 0.0, 0.0, expected[2]); + glUniform4f(uf4, 0.0, 0.0, 0.0, expected[3]); renderQuad(pixel); if (!equalColors(pixel, expected)) { REPORT_FAILURE("glUniform[1234]f failed"); @@ -585,13 +440,13 @@ API2Test::testUniformfFuncs(void) expected[2] = 0.7; expected[3] = 0.6; u[0] = expected[0]; - glUniform1fv_func(uf1, 1, u); + glUniform1fv(uf1, 1, u); u[0] = 0.0; u[1] = expected[1]; - glUniform2fv_func(uf2, 1, u); + glUniform2fv(uf2, 1, u); u[0] = 0.0; u[1] = 0.0; u[2] = expected[2]; - glUniform3fv_func(uf3, 1, u); + glUniform3fv(uf3, 1, u); u[0] = 0.0; u[1] = 0.0; u[2] = 0.0; u[3] = expected[3]; - glUniform4fv_func(uf4, 1, u); + glUniform4fv(uf4, 1, u); renderQuad(pixel); if (!equalColors(pixel, expected)) { REPORT_FAILURE("glUniform[1234]f failed"); @@ -599,8 +454,8 @@ API2Test::testUniformfFuncs(void) } // Test glGetUniformfv - glUniform4fv_func(uf4, 1, expected); - glGetUniformfv_func(program, uf4, value); + glUniform4fv(uf4, 1, expected); + glGetUniformfv(program, uf4, value); if (value[0] != expected[0] || value[1] != expected[1] || value[2] != expected[2] || @@ -636,24 +491,24 @@ API2Test::testUniformiFuncs(void) REPORT_FAILURE("glCreateProgram (uniform test) failed"); return false; } - glUseProgram_func(program); + glUseProgram(program); - ui1 = glGetUniformLocation_func(program, "ui1"); + ui1 = glGetUniformLocation(program, "ui1"); if (ui1 < 0) { REPORT_FAILURE("glGetUniform \"ui1\" failed"); return false; } - ui2 = glGetUniformLocation_func(program, "ui2"); + ui2 = glGetUniformLocation(program, "ui2"); if (ui2 < 0) { REPORT_FAILURE("glGetUniform \"ui2\" failed"); return false; } - ui3 = glGetUniformLocation_func(program, "ui3"); + ui3 = glGetUniformLocation(program, "ui3"); if (ui3 < 0) { REPORT_FAILURE("glGetUniform \"ui3\" failed"); return false; } - ui4 = glGetUniformLocation_func(program, "ui4"); + ui4 = glGetUniformLocation(program, "ui4"); if (ui4 < 0) { REPORT_FAILURE("glGetUniform \"ui4\" failed"); return false; @@ -671,10 +526,10 @@ API2Test::testUniformiFuncs(void) expected[1] = 0.2; expected[2] = 0.3; expected[3] = 0.4; - glUniform1i_func(ui1, expectedInt[0]); - glUniform2i_func(ui2, 0, expectedInt[1]); - glUniform3i_func(ui3, 0, 0, expectedInt[2]); - glUniform4i_func(ui4, 0, 0, 0, expectedInt[3]); + glUniform1i(ui1, expectedInt[0]); + glUniform2i(ui2, 0, expectedInt[1]); + glUniform3i(ui3, 0, 0, expectedInt[2]); + glUniform4i(ui4, 0, 0, 0, expectedInt[3]); renderQuad(pixel); if (!equalColors(pixel, expected)) { REPORT_FAILURE("glUniform[1234]i failed"); @@ -693,13 +548,13 @@ API2Test::testUniformiFuncs(void) expected[2] = 0.7; expected[3] = 0.6; u[0] = expectedInt[0]; - glUniform1iv_func(ui1, 1, u); + glUniform1iv(ui1, 1, u); u[0] = 0; u[1] = expectedInt[1]; - glUniform2iv_func(ui2, 1, u); + glUniform2iv(ui2, 1, u); u[0] = 0; u[1] = 0; u[2] = expectedInt[2]; - glUniform3iv_func(ui3, 1, u); + glUniform3iv(ui3, 1, u); u[0] = 0; u[1] = 0; u[2] = 0; u[3] = expectedInt[3]; - glUniform4iv_func(ui4, 1, u); + glUniform4iv(ui4, 1, u); renderQuad(pixel); if (!equalColors(pixel, expected)) { REPORT_FAILURE("glUniform[1234]i failed"); @@ -736,7 +591,7 @@ API2Test::testShaderAttribs(void) REPORT_FAILURE("glCreateProgram (uniform test) failed"); return false; } - glUseProgram_func(program); + glUseProgram(program); static const GLfloat testColors[3][4] = { { 1.0, 0.5, 0.25, 0.0 }, @@ -745,7 +600,7 @@ API2Test::testShaderAttribs(void) }; // let compiler allocate the attribute location - const GLint attr = glGetAttribLocation_func(program, "generic"); + const GLint attr = glGetAttribLocation(program, "generic"); if (attr < 0) { REPORT_FAILURE("glGetAttribLocation failed"); return false; @@ -769,9 +624,9 @@ API2Test::testShaderAttribs(void) // Test explicit attribute binding. const GLint bindAttr = 6; // XXX a non-colliding alias - glBindAttribLocation_func(program, bindAttr, "generic"); - glLinkProgram_func(program); - GLint loc = glGetAttribLocation_func(program, "generic"); + glBindAttribLocation(program, bindAttr, "generic"); + glLinkProgram(program); + GLint loc = glGetAttribLocation(program, "generic"); if (loc != bindAttr) { REPORT_FAILURE("glBindAttribLocation failed"); return false; @@ -799,8 +654,8 @@ API2Test::testStencilFuncSeparate(void) glGetIntegerv(GL_STENCIL_BITS, &stencilBits); stencilMax = (1 << stencilBits) - 1; - glStencilFuncSeparate_func(GL_FRONT, GL_LEQUAL, 12, 0xf); - glStencilFuncSeparate_func(GL_BACK, GL_GEQUAL, 13, 0xe); + glStencilFuncSeparate(GL_FRONT, GL_LEQUAL, 12, 0xf); + glStencilFuncSeparate(GL_BACK, GL_GEQUAL, 13, 0xe); glGetIntegerv(GL_STENCIL_BACK_FUNC, &val); if (val != GL_GEQUAL) { @@ -848,8 +703,8 @@ API2Test::testStencilOpSeparate(void) GLint val; // face, fail, zfail, zpass - glStencilOpSeparate_func(GL_FRONT, GL_INVERT, GL_ZERO, GL_INCR); - glStencilOpSeparate_func(GL_BACK, GL_INCR, GL_KEEP, GL_REPLACE); + glStencilOpSeparate(GL_FRONT, GL_INVERT, GL_ZERO, GL_INCR); + glStencilOpSeparate(GL_BACK, GL_INCR, GL_KEEP, GL_REPLACE); glGetIntegerv(GL_STENCIL_BACK_FAIL, &val); if (val != GL_INCR) { @@ -897,8 +752,8 @@ API2Test::testStencilMaskSeparate(void) GLint val; // face, fail, zfail, zpass - glStencilMaskSeparate_func(GL_BACK, 0xa); - glStencilMaskSeparate_func(GL_FRONT, 0xb); + glStencilMaskSeparate(GL_BACK, 0xa); + glStencilMaskSeparate(GL_FRONT, 0xb); glGetIntegerv(GL_STENCIL_BACK_WRITEMASK, &val); if (val != 0xa) { @@ -921,7 +776,7 @@ API2Test::testBlendEquationSeparate(void) { GLint val; - glBlendEquationSeparate_func(GL_MAX, GL_FUNC_SUBTRACT); + glBlendEquationSeparate(GL_MAX, GL_FUNC_SUBTRACT); glGetIntegerv(GL_BLEND_EQUATION, &val); if (val != GL_MAX) { @@ -960,7 +815,7 @@ API2Test::testDrawBuffers(void) for (i = 0; i < n; i++) { buffers[i] = (i & 1) ? GL_FRONT_LEFT : GL_BACK_LEFT; } - glDrawBuffers_func(n, buffers); + glDrawBuffers(n, buffers); for (i = 0; i < n; i++) { glGetIntegerv(GL_DRAW_BUFFER0 + i, &val); diff --git a/tests/glean/tapi2.h b/tests/glean/tapi2.h index 6e84fd5fa..36cf58725 100644 --- a/tests/glean/tapi2.h +++ b/tests/glean/tapi2.h @@ -55,7 +55,6 @@ private: typedef bool (API2Test::*TestFunc)(void); GLfloat tolerance[5]; - bool getFunctions_2_0(const char **errorFunc); GLuint loadAndCompileShader(GLenum target, const char *str); GLuint createProgram(GLuint vertShader, GLuint fragShader); diff --git a/tests/glean/tblend.cpp b/tests/glean/tblend.cpp index a0f67b703..e96c2ab20 100644 --- a/tests/glean/tblend.cpp +++ b/tests/glean/tblend.cpp @@ -40,13 +40,6 @@ #define HUGE_STEP 1000 -namespace GLEAN { -static PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate_func = NULL; -static PFNGLBLENDCOLORPROC glBlendColor_func = NULL; -static PFNGLBLENDEQUATIONPROC glBlendEquation_func = NULL; -static PFNGLBLENDEQUATIONSEPARATEPROC glBlendEquationSeparate_func = NULL; -} - //namespace { struct enumNameMapping { @@ -520,15 +513,15 @@ BlendFuncTest::runFactors(GLenum srcFactorRGB, GLenum srcFactorA, RandomBitsDouble srcARand(16, 42); if (haveSepFunc) - glBlendFuncSeparate_func(srcFactorRGB, dstFactorRGB, - srcFactorA, dstFactorA); + glBlendFuncSeparate(srcFactorRGB, dstFactorRGB, + srcFactorA, dstFactorA); else glBlendFunc(srcFactorRGB, dstFactorRGB); if (haveBlendEquationSep) - glBlendEquationSeparate_func(opRGB, opA); + glBlendEquationSeparate(opRGB, opA); else if (haveBlendEquation) - glBlendEquation_func(opRGB); + glBlendEquation(opRGB); glEnable(GL_BLEND); @@ -725,49 +718,29 @@ BlendFuncTest::runOne(BlendFuncResult& r, Window& w) { unsigned testNo, testStride; // test for features, get function pointers - if (GLUtils::getVersion() >= 1.4) { + if (GLUtils::getVersion() >= 1.4 || + GLUtils::haveExtension("GL_EXT_blend_func_separate")) { haveSepFunc = true; - glBlendFuncSeparate_func = (PFNGLBLENDFUNCSEPARATEPROC) - GLUtils::getProcAddress("glBlendFuncSeparate"); - } - else if (GLUtils::haveExtension("GL_EXT_blend_func_separate")) { - haveSepFunc = true; - glBlendFuncSeparate_func = (PFNGLBLENDFUNCSEPARATEPROC) - GLUtils::getProcAddress("glBlendFuncSeparateEXT"); } - if (GLUtils::getVersion() >= 1.4) { - haveBlendColor = true; - glBlendColor_func = (PFNGLBLENDCOLORPROC) - GLUtils::getProcAddress("glBlendColor"); - } - else if (GLUtils::haveExtension("GL_EXT_blend_color")) { + if (GLUtils::getVersion() >= 1.4 || + GLUtils::haveExtension("GL_EXT_blend_color")) { haveBlendColor = true; - glBlendColor_func = (PFNGLBLENDCOLORPROC) - GLUtils::getProcAddress("glBlendColorEXT"); } if (GLUtils::getVersion() >= 1.4) { haveBlendEquation = true; - glBlendEquation_func = (PFNGLBLENDEQUATIONPROC) - GLUtils::getProcAddress("glBlendEquation"); } else if (GLUtils::haveExtension("GL_EXT_blend_subtract") && GLUtils::haveExtension("GL_EXT_blend_min_max")) { haveBlendEquation = true; - glBlendEquation_func = (PFNGLBLENDEQUATIONPROC) - GLUtils::getProcAddress("glBlendEquationEXT"); } if (GLUtils::getVersion() >= 2.0) { haveBlendEquationSep = true; - glBlendEquationSeparate_func = (PFNGLBLENDEQUATIONSEPARATEPROC) - GLUtils::getProcAddress("glBlendEquationSeparate"); } else if (GLUtils::haveExtension("GL_EXT_blend_equation_separate")) { haveBlendEquationSep = true; - glBlendEquationSeparate_func = (PFNGLBLENDEQUATIONSEPARATEPROC) - GLUtils::getProcAddress("glBlendEquationSeparateEXT"); } if (haveBlendColor) { @@ -776,8 +749,8 @@ BlendFuncTest::runOne(BlendFuncResult& r, Window& w) { p.constColor[1] = 0.0; p.constColor[2] = 1.0; p.constColor[3] = 0.75; - glBlendColor_func(p.constColor[0], p.constColor[1], - p.constColor[2], p.constColor[3]); + glBlendColor(p.constColor[0], p.constColor[1], + p.constColor[2], p.constColor[3]); } if (haveSepFunc) { diff --git a/tests/glean/tbufferobject.cpp b/tests/glean/tbufferobject.cpp index 3ed464b1f..1d4bd2448 100644 --- a/tests/glean/tbufferobject.cpp +++ b/tests/glean/tbufferobject.cpp @@ -40,23 +40,6 @@ namespace GLEAN { - -// GL_ARB_vertex/fragment_program -static PFNGLGENBUFFERSARBPROC glGenBuffersARB_func = NULL; -static PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB_func = NULL; -static PFNGLBINDBUFFERARBPROC glBindBufferARB_func = NULL; -static PFNGLBUFFERDATAARBPROC glBufferDataARB_func = NULL; -static PFNGLMAPBUFFERARBPROC glMapBufferARB_func = NULL; -static PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB_func = NULL; - -// GL_ARB_copy_buffer -static PFNGLCOPYBUFFERSUBDATAPROC glCopyBufferSubData_func = NULL; - -// GL_ARB_map_buffer_range -static PFNGLMAPBUFFERRANGEPROC glMapBufferRange_func = NULL; -static PFNGLFLUSHMAPPEDBUFFERRANGEPROC glFlushMappedBufferRange_func = NULL; - - BufferObjectResult::BufferObjectResult() { pass = false; @@ -83,23 +66,6 @@ BufferObjectTest::setup(void) return false; } - - glGenBuffersARB_func = (PFNGLGENBUFFERSARBPROC) GLUtils::getProcAddress("glGenBuffersARB"); - glDeleteBuffersARB_func = (PFNGLDELETEBUFFERSARBPROC) GLUtils::getProcAddress("glDeleteBuffersARB"); - glBindBufferARB_func = (PFNGLBINDBUFFERARBPROC) GLUtils::getProcAddress("glBindBufferARB"); - glBufferDataARB_func = (PFNGLBUFFERDATAARBPROC) GLUtils::getProcAddress("glBufferDataARB"); - glMapBufferARB_func = (PFNGLMAPBUFFERARBPROC) GLUtils::getProcAddress("glMapBufferARB"); - glUnmapBufferARB_func = (PFNGLUNMAPBUFFERARBPROC) GLUtils::getProcAddress("glUnmapBufferARB"); - - if (have_ARB_copy_buffer) { - glCopyBufferSubData_func = (PFNGLCOPYBUFFERSUBDATAPROC) GLUtils::getProcAddress("glCopyBufferSubData"); - } - - if (have_ARB_map_buffer_range) { - glMapBufferRange_func = (PFNGLMAPBUFFERRANGEPROC) GLUtils::getProcAddress("glMapBufferRange"); - glFlushMappedBufferRange_func = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC) GLUtils::getProcAddress("glFlushMappedBufferRange"); - } - return true; } @@ -115,25 +81,25 @@ BufferObjectTest::testCopyBuffer(void) GLint i; bool pass; - glGenBuffersARB_func(2, bufs); + glGenBuffersARB(2, bufs); // setup first buffer - glBindBufferARB_func(target1, bufs[0]); - glBufferDataARB_func(target1, size1, NULL, GL_STATIC_DRAW); - map = (GLubyte *) glMapBufferARB_func(target1, GL_WRITE_ONLY_ARB); + glBindBufferARB(target1, bufs[0]); + glBufferDataARB(target1, size1, NULL, GL_STATIC_DRAW); + map = (GLubyte *) glMapBufferARB(target1, GL_WRITE_ONLY_ARB); for (i = 0; i < size1; i++) { map[i] = buf1[i] = i & 0xff; } - glUnmapBufferARB_func(target1); + glUnmapBufferARB(target1); // setup second buffer - glBindBufferARB_func(target2, bufs[1]); - glBufferDataARB_func(target2, size2, NULL, GL_STATIC_DRAW); - map = (GLubyte *) glMapBufferARB_func(target2, GL_WRITE_ONLY_ARB); + glBindBufferARB(target2, bufs[1]); + glBufferDataARB(target2, size2, NULL, GL_STATIC_DRAW); + map = (GLubyte *) glMapBufferARB(target2, GL_WRITE_ONLY_ARB); for (i = 0; i < size2; i++) { map[i] = buf2[i] = 0; } - glUnmapBufferARB_func(target2); + glUnmapBufferARB(target2); // copy random sections of first buffer to second buffer for (i = 0; i < 50; i++) { @@ -146,7 +112,7 @@ BufferObjectTest::testCopyBuffer(void) assert(dstOffset + size <= size2); // test copy from first buffer to second - glCopyBufferSubData_func(target1, // src target + glCopyBufferSubData(target1, // src target target2, // dst target srcOffset, // src start dstOffset, // dst start @@ -163,7 +129,7 @@ BufferObjectTest::testCopyBuffer(void) } // check results in second buffer object - map = (GLubyte *) glMapBufferARB_func(target2, GL_READ_ONLY_ARB); + map = (GLubyte *) glMapBufferARB(target2, GL_READ_ONLY_ARB); pass = true; for (i = 0; i < size2; i++) { if (map[i] != buf2[i]) { @@ -172,9 +138,9 @@ BufferObjectTest::testCopyBuffer(void) break; } } - glUnmapBufferARB_func(target2); + glUnmapBufferARB(target2); - glDeleteBuffersARB_func(2, bufs); + glDeleteBuffersARB(2, bufs); return pass; } @@ -193,16 +159,16 @@ BufferObjectTest::testMapBufferRange(void) bool pass = true; // create buffer - glGenBuffersARB_func(1, &buffer); - glBindBufferARB_func(target1, buffer); - glBufferDataARB_func(target1, size, NULL, GL_STATIC_DRAW); + glGenBuffersARB(1, &buffer); + glBindBufferARB(target1, buffer); + glBufferDataARB(target1, size, NULL, GL_STATIC_DRAW); // initialize to zeros - map = (GLubyte *) glMapBufferRange_func(target1, 0, size, GL_MAP_WRITE_BIT); + map = (GLubyte *) glMapBufferRange(target1, 0, size, GL_MAP_WRITE_BIT); for (i = 0; i < size; i++) { map[i] = buf[i] = 0; } - glUnmapBufferARB_func(target1); + glUnmapBufferARB(target1); // write to random ranges for (i = 0; i < 50; i++) { @@ -212,16 +178,16 @@ BufferObjectTest::testMapBufferRange(void) assert(mapOffset + mapSize <= size); map = (GLubyte *) - glMapBufferRange_func(target1, mapOffset, mapSize, + glMapBufferRange(target1, mapOffset, mapSize, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT); for (j = 0; j < mapSize; j++) { map[j] = buf[mapOffset + j] = (mapOffset + j) & 0xff; } - glFlushMappedBufferRange_func(target1, 0, mapSize); + glFlushMappedBufferRange(target1, 0, mapSize); - glUnmapBufferARB_func(target1); + glUnmapBufferARB(target1); } if (glGetError()) @@ -234,7 +200,7 @@ BufferObjectTest::testMapBufferRange(void) assert(mapOffset + mapSize <= size); - map = (GLubyte *) glMapBufferRange_func(target1, mapOffset, + map = (GLubyte *) glMapBufferRange(target1, mapOffset, mapSize, GL_MAP_READ_BIT); for (j = 0; j < mapSize; j++) { @@ -243,10 +209,10 @@ BufferObjectTest::testMapBufferRange(void) break; } } - glUnmapBufferARB_func(target1); + glUnmapBufferARB(target1); } - glDeleteBuffersARB_func(1, &buffer); + glDeleteBuffersARB(1, &buffer); if (glGetError()) pass = false; diff --git a/tests/glean/tdepthstencil.cpp b/tests/glean/tdepthstencil.cpp index 8b60b4f79..41f869b26 100644 --- a/tests/glean/tdepthstencil.cpp +++ b/tests/glean/tdepthstencil.cpp @@ -40,9 +40,6 @@ namespace GLEAN { -static PFNGLWINDOWPOS2IARBPROC WindowPos2i = NULL; - - DepthStencilResult::DepthStencilResult() { pass = false; @@ -69,10 +66,6 @@ DepthStencilTest::setup(void) { glGetIntegerv(GL_DEPTH_BITS, &depthBits); glGetIntegerv(GL_STENCIL_BITS, &stencilBits); - - WindowPos2i = (PFNGLWINDOWPOS2IARBPROC) - GLUtils::getProcAddress("glWindowPos2iARB"); - assert(WindowPos2i); } @@ -168,7 +161,7 @@ DepthStencilTest::testDrawAndRead(void) }; GLuint readback[4]; - WindowPos2i(0, 0); + glWindowPos2i(0, 0); glDrawPixels(2, 2, GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, image); if (checkError("glDrawPixels in testDrawAndRead")) diff --git a/tests/glean/tfbo.cpp b/tests/glean/tfbo.cpp index 0472802bf..d39eb6f19 100644 --- a/tests/glean/tfbo.cpp +++ b/tests/glean/tfbo.cpp @@ -43,32 +43,6 @@ namespace GLEAN { -// GL_VERSION_1_2 -static PFNGLTEXIMAGE3DPROC glTexImage3D_func = NULL; -static PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D_func = NULL; - -// GL_VERSION_1_3 -static PFNGLACTIVETEXTUREPROC glActiveTexture_func = NULL; -static PFNGLMULTITEXCOORD2FPROC glMultiTexCoord2f_func = NULL; - -// GL_EXT_framebuffer_object -static PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT_func = NULL; -static PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT_func = NULL; -static PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT_func = NULL; -static PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT_func = NULL; -static PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT_func = NULL; -static PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glGetRenderbufferParameterivEXT_func = NULL; -static PFNGLISFRAMEBUFFEREXTPROC glIsFramebufferEXT_func = NULL; -static PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT_func = NULL; -static PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT_func = NULL; -static PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT_func = NULL; -static PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT_func = NULL; -static PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT_func = NULL; -static PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT_func = NULL; -static PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glFramebufferTexture3DEXT_func = NULL; -static PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT_func = NULL; -static PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetFramebufferAttachmentParameterivEXT_func = NULL; - static int useFramebuffer; bool @@ -124,49 +98,6 @@ FBOTest::setup(void) else printf("GL_ARB_framebuffer_object is not supported\n"); - glTexImage3D_func = (PFNGLTEXIMAGE3DPROC) GLUtils::getProcAddress("glTexImage3D"); - assert(glTexImage3D_func); - glCopyTexSubImage3D_func = (PFNGLCOPYTEXSUBIMAGE3DPROC) GLUtils::getProcAddress("glCopyTexSubImage3D"); - assert(glCopyTexSubImage3D_func); - - glActiveTexture_func = (PFNGLACTIVETEXTUREPROC) GLUtils::getProcAddress("glActiveTexture"); - assert(glActiveTexture_func); - glMultiTexCoord2f_func = (PFNGLMULTITEXCOORD2FPROC) GLUtils::getProcAddress("glMultiTexCoord2f"); - assert(glMultiTexCoord2f_func); - - glIsRenderbufferEXT_func = (PFNGLISRENDERBUFFEREXTPROC) GLUtils::getProcAddress("glIsRenderbufferEXT"); - assert(glIsRenderbufferEXT_func); - glBindRenderbufferEXT_func = (PFNGLBINDRENDERBUFFEREXTPROC) GLUtils::getProcAddress("glBindRenderbufferEXT"); - assert(glBindRenderbufferEXT_func); - glDeleteRenderbuffersEXT_func = (PFNGLDELETERENDERBUFFERSEXTPROC) GLUtils::getProcAddress("glDeleteRenderbuffersEXT"); - assert(glDeleteRenderbuffersEXT_func); - glGenRenderbuffersEXT_func = (PFNGLGENRENDERBUFFERSEXTPROC) GLUtils::getProcAddress("glGenRenderbuffersEXT"); - assert(glGenRenderbuffersEXT_func); - glRenderbufferStorageEXT_func = (PFNGLRENDERBUFFERSTORAGEEXTPROC) GLUtils::getProcAddress("glRenderbufferStorageEXT"); - assert(glRenderbufferStorageEXT_func); - glGetRenderbufferParameterivEXT_func = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) GLUtils::getProcAddress("glGetRenderbufferParameterivEXT"); - assert(glGetRenderbufferParameterivEXT_func); - glIsFramebufferEXT_func = (PFNGLISFRAMEBUFFEREXTPROC) GLUtils::getProcAddress("glIsFramebufferEXT"); - assert(glIsFramebufferEXT_func); - glBindFramebufferEXT_func = (PFNGLBINDFRAMEBUFFEREXTPROC) GLUtils::getProcAddress("glBindFramebufferEXT"); - assert(glBindFramebufferEXT_func); - glDeleteFramebuffersEXT_func = (PFNGLDELETEFRAMEBUFFERSEXTPROC) GLUtils::getProcAddress("glDeleteFramebuffersEXT"); - assert(glDeleteFramebuffersEXT_func); - glGenFramebuffersEXT_func = (PFNGLGENFRAMEBUFFERSEXTPROC) GLUtils::getProcAddress("glGenFramebuffersEXT"); - assert(glGenFramebuffersEXT_func); - glCheckFramebufferStatusEXT_func = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) GLUtils::getProcAddress("glCheckFramebufferStatusEXT"); - assert(glCheckFramebufferStatusEXT_func); - glFramebufferTexture1DEXT_func = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) GLUtils::getProcAddress("glFramebufferTexture1DEXT"); - assert(glFramebufferTexture1DEXT_func); - glFramebufferTexture2DEXT_func = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) GLUtils::getProcAddress("glFramebufferTexture2DEXT"); - assert(glFramebufferTexture2DEXT_func); - glFramebufferTexture3DEXT_func = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) GLUtils::getProcAddress("glFramebufferTexture3DEXT"); - assert(glFramebufferTexture3DEXT_func); - glFramebufferRenderbufferEXT_func = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) GLUtils::getProcAddress("glFramebufferRenderbufferEXT"); - assert(glFramebufferRenderbufferEXT_func); - glGetFramebufferAttachmentParameterivEXT_func = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) GLUtils::getProcAddress("glGetFramebufferAttachmentParameterivEXT"); - assert(glGetFramebufferAttachmentParameterivEXT_func); - return true; } @@ -252,7 +183,7 @@ static GLenum CheckFramebufferStatus(const char *func, int line) { GLenum status; - status = glCheckFramebufferStatusEXT_func(GL_FRAMEBUFFER_EXT); + status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); switch(status) { case GL_FRAMEBUFFER_COMPLETE_EXT: @@ -329,23 +260,23 @@ FBOTest::testSanity(void) return false; } - glGenFramebuffersEXT_func(1, fbs); + glGenFramebuffersEXT(1, fbs); - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, fbs[0]); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbs[0]); glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, (GLint *) & fb_binding); if (fb_binding != fbs[0]) { printf(" fb_binding = %d\n", fb_binding); REPORT_FAILURE("Binding framebuffer failed"); return false; } - if (glIsFramebufferEXT_func(fbs[0]) != GL_TRUE) + if (glIsFramebufferEXT(fbs[0]) != GL_TRUE) { REPORT_FAILURE("Call glIsFramebufferEXT failed"); return false; } - glDeleteFramebuffersEXT_func(1, fbs); + glDeleteFramebuffersEXT(1, fbs); GLint maxRenderbufferSize; @@ -364,7 +295,7 @@ FBOTest::testSanity(void) void FBOTest::reset(void) { - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, 0); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); glDisable(GL_DEPTH_TEST); glDisable(GL_STENCIL_TEST); } @@ -400,7 +331,7 @@ FBOTest::testRender2SingleTexture(void) continue; if (useFramebuffer) - glGenFramebuffersEXT_func(1, fbs); + glGenFramebuffersEXT(1, fbs); glGenTextures(1, textures); glBindTexture(textureModes[mode], @@ -427,7 +358,7 @@ FBOTest::testRender2SingleTexture(void) GL_RGB, GL_INT, NULL); break; case GL_TEXTURE_3D: - glTexImage3D_func(GL_TEXTURE_3D, + glTexImage3D(GL_TEXTURE_3D, 0, GL_RGB, TEXSIZE, TEXSIZE, @@ -470,7 +401,7 @@ FBOTest::testRender2SingleTexture(void) if (useFramebuffer) { - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, fbs[0]); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbs[0]); int height = TEXSIZE; if (textureModes[mode] == GL_TEXTURE_1D) @@ -479,28 +410,28 @@ FBOTest::testRender2SingleTexture(void) if (depthBuffer) { int params; - glGenRenderbuffersEXT_func(1, depth_rb); + glGenRenderbuffersEXT(1, depth_rb); - glBindRenderbufferEXT_func + glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, depth_rb[0]); - if (glIsRenderbufferEXT_func(depth_rb[0]) != GL_TRUE) + if (glIsRenderbufferEXT(depth_rb[0]) != GL_TRUE) { REPORT_FAILURE("Call glIsRenderbufferEXT failed\n"); return false; } - glRenderbufferStorageEXT_func + glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, TEXSIZE, height); - glFramebufferRenderbufferEXT_func + glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depth_rb[0]); - glGetRenderbufferParameterivEXT_func + glGetRenderbufferParameterivEXT (GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_WIDTH_EXT, ¶ms); @@ -510,7 +441,7 @@ FBOTest::testRender2SingleTexture(void) printf("width = %d\n", params); return false; } - glGetRenderbufferParameterivEXT_func + glGetRenderbufferParameterivEXT (GL_RENDERBUFFER_EXT, GL_RENDERBUFFER_HEIGHT_EXT, ¶ms); @@ -525,18 +456,18 @@ FBOTest::testRender2SingleTexture(void) int type; type = -1; - glGenRenderbuffersEXT_func(1, stencil_rb); - glBindRenderbufferEXT_func(GL_RENDERBUFFER_EXT, stencil_rb[0]); - glRenderbufferStorageEXT_func + glGenRenderbuffersEXT(1, stencil_rb); + glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, stencil_rb[0]); + glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX, TEXSIZE, height); - glFramebufferRenderbufferEXT_func + glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, stencil_rb[0]); - glGetFramebufferAttachmentParameterivEXT_func + glGetFramebufferAttachmentParameterivEXT (GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT, @@ -554,12 +485,12 @@ FBOTest::testRender2SingleTexture(void) int name; name = -1; - glFramebufferTexture1DEXT_func + glFramebufferTexture1DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_1D, textures[0], 0); - glGetFramebufferAttachmentParameterivEXT_func + glGetFramebufferAttachmentParameterivEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT, @@ -576,12 +507,12 @@ FBOTest::testRender2SingleTexture(void) int level; level = -1; - glFramebufferTexture2DEXT_func + glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, textures[0], 0); - glGetFramebufferAttachmentParameterivEXT_func + glGetFramebufferAttachmentParameterivEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT, @@ -598,7 +529,7 @@ FBOTest::testRender2SingleTexture(void) int zoffset; zoffset = -1; - glFramebufferTexture3DEXT_func + glFramebufferTexture3DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_3D, @@ -606,7 +537,7 @@ FBOTest::testRender2SingleTexture(void) 0, maxzoffset-1); - glGetFramebufferAttachmentParameterivEXT_func + glGetFramebufferAttachmentParameterivEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT, @@ -622,12 +553,12 @@ FBOTest::testRender2SingleTexture(void) case GL_TEXTURE_CUBE_MAP: int face = 0; - glFramebufferTexture2DEXT_func + glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, textures[0], 0); - glGetFramebufferAttachmentParameterivEXT_func + glGetFramebufferAttachmentParameterivEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT, @@ -654,11 +585,11 @@ FBOTest::testRender2SingleTexture(void) if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { glDeleteTextures(1, textures); if (useFramebuffer) - glDeleteFramebuffersEXT_func(1, fbs); + glDeleteFramebuffersEXT(1, fbs); if (depthBuffer) - glDeleteRenderbuffersEXT_func(1, depth_rb); + glDeleteRenderbuffersEXT(1, depth_rb); if (stencilBuffer) - glDeleteRenderbuffersEXT_func(1, stencil_rb); + glDeleteRenderbuffersEXT(1, stencil_rb); continue; } @@ -756,7 +687,7 @@ FBOTest::testRender2SingleTexture(void) glBindTexture(textureModes[mode], textures[0]); if (useFramebuffer) { - glBindFramebufferEXT_func + glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0); glBindTexture(textureModes [mode], textures[0]); @@ -778,7 +709,7 @@ FBOTest::testRender2SingleTexture(void) TEXSIZE, 0); break; case GL_TEXTURE_3D: - glCopyTexSubImage3D_func + glCopyTexSubImage3D (GL_TEXTURE_3D, 0, 0, 0, 0, 0, 0, @@ -838,11 +769,11 @@ FBOTest::testRender2SingleTexture(void) glDeleteTextures(1, textures); if (useFramebuffer) - glDeleteFramebuffersEXT_func(1, fbs); + glDeleteFramebuffersEXT(1, fbs); if (depthBuffer) - glDeleteRenderbuffersEXT_func(1, depth_rb); + glDeleteRenderbuffersEXT(1, depth_rb); if (stencilBuffer) - glDeleteRenderbuffersEXT_func(1, stencil_rb); + glDeleteRenderbuffersEXT(1, stencil_rb); // getchar(); if (checkResult(colors[RED], depthBuffer, stencilBuffer) == false) { @@ -892,7 +823,7 @@ FBOTest::testRender2MultiTexture(void) numFBO = 1; if (useFramebuffer) - glGenFramebuffersEXT_func(numFBO, fbs); + glGenFramebuffersEXT(numFBO, fbs); GLint maxTexUnits; @@ -908,7 +839,7 @@ FBOTest::testRender2MultiTexture(void) else idx = i; - glActiveTexture_func(GL_TEXTURE0 + idx); + glActiveTexture(GL_TEXTURE0 + idx); glBindTexture(GL_TEXTURE_2D, textures[idx]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, TEXSIZE, TEXSIZE, 0, GL_RGB, @@ -916,18 +847,18 @@ FBOTest::testRender2MultiTexture(void) if (useFramebuffer) { if (mode == MULTI_FBO) - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, fbs[i]); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbs[i]); else - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, fbs[0]); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbs[0]); if (mode != SINGLE_COLOR_ATTACH) - glFramebufferTexture2DEXT_func + glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT + i, GL_TEXTURE_2D, textures[idx], 0); else - glFramebufferTexture2DEXT_func + glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, @@ -957,9 +888,9 @@ FBOTest::testRender2MultiTexture(void) if (useFramebuffer) { if (mode == MULTI_FBO) - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, fbs[i]); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbs[i]); else - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, fbs[0]); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbs[0]); if (mode == MULTI_COLOR_ATTACH) { glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT + idx); @@ -968,7 +899,7 @@ FBOTest::testRender2MultiTexture(void) CheckFramebufferStatus("FBOTest::testRender2MultiTexture", __LINE__); if (mode == SINGLE_COLOR_ATTACH) { - glFramebufferTexture2DEXT_func + glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, @@ -994,7 +925,7 @@ FBOTest::testRender2MultiTexture(void) glEnable(GL_TEXTURE_2D); if (useFramebuffer) { - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, 0); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); glBindTexture(GL_TEXTURE_2D, textures[idx]); } else { @@ -1007,7 +938,7 @@ FBOTest::testRender2MultiTexture(void) } // Clean up if (useFramebuffer) - glDeleteFramebuffersEXT_func(numFBO, fbs); + glDeleteFramebuffersEXT(numFBO, fbs); // Render to the window @@ -1019,7 +950,7 @@ FBOTest::testRender2MultiTexture(void) else idx = i; - glActiveTexture_func(GL_TEXTURE0 + idx); + glActiveTexture(GL_TEXTURE0 + idx); glEnable(GL_TEXTURE_2D); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); @@ -1032,13 +963,13 @@ FBOTest::testRender2MultiTexture(void) glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_POLYGON); - glMultiTexCoord2f_func(GL_TEXTURE0 + idx, 0, 0); + glMultiTexCoord2f(GL_TEXTURE0 + idx, 0, 0); glVertex3f(0, 0, 1); - glMultiTexCoord2f_func(GL_TEXTURE0 + idx, 1, 0); + glMultiTexCoord2f(GL_TEXTURE0 + idx, 1, 0); glVertex3f(TEXSIZE, 0, 1); - glMultiTexCoord2f_func(GL_TEXTURE0 + idx, 1, 1); + glMultiTexCoord2f(GL_TEXTURE0 + idx, 1, 1); glVertex3f(TEXSIZE, TEXSIZE, 1); - glMultiTexCoord2f_func(GL_TEXTURE0 + idx, 0, 1); + glMultiTexCoord2f(GL_TEXTURE0 + idx, 0, 1); glVertex3f(0, TEXSIZE, 1); glEnd(); @@ -1053,7 +984,7 @@ FBOTest::testRender2MultiTexture(void) } glDisable(GL_TEXTURE_2D); - glActiveTexture_func(GL_TEXTURE0); + glActiveTexture(GL_TEXTURE0); } glDeleteTextures(maxTexUnits, textures); @@ -1071,7 +1002,7 @@ FBOTest::testRender2depthTexture(void) reset(); if (useFramebuffer) - glGenFramebuffersEXT_func(1, fbs); + glGenFramebuffersEXT(1, fbs); glGenTextures(1, textures); glBindTexture(GL_TEXTURE_2D, textures[0]); @@ -1079,8 +1010,8 @@ FBOTest::testRender2depthTexture(void) TEXSIZE, 0, GL_DEPTH_COMPONENT, GL_INT, NULL); if (useFramebuffer) { - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, fbs[0]); - glFramebufferTexture2DEXT_func(GL_FRAMEBUFFER_EXT, + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbs[0]); + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, textures[0], 0); glDrawBuffer(GL_NONE); @@ -1105,7 +1036,7 @@ FBOTest::testRender2depthTexture(void) glEnd(); if (useFramebuffer) { - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, 0); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); glBindTexture(GL_TEXTURE_2D, textures[0]); } else { @@ -1146,7 +1077,7 @@ FBOTest::testRender2depthTexture(void) // Clean up if (useFramebuffer) - glDeleteFramebuffersEXT_func(1, fbs); + glDeleteFramebuffersEXT(1, fbs); glDeleteTextures(1, textures); // Check result @@ -1170,13 +1101,13 @@ FBOTest::testRender2MipmapTexture(void) reset(); if (useFramebuffer) - glGenFramebuffersEXT_func(1, fbs); + glGenFramebuffersEXT(1, fbs); glGenTextures(1, textures); glBindTexture(GL_TEXTURE_2D, textures[0]); if (useFramebuffer) - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, fbs[0]); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbs[0]); glDisable(GL_TEXTURE_2D); @@ -1186,7 +1117,7 @@ FBOTest::testRender2MipmapTexture(void) if (useFramebuffer) { glTexImage2D(GL_TEXTURE_2D, level, GL_RGB, i, i, 0, GL_RGB, GL_INT, NULL); - glFramebufferTexture2DEXT_func + glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, textures[0], level); @@ -1224,7 +1155,7 @@ FBOTest::testRender2MipmapTexture(void) } if (useFramebuffer) { - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, 0); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); glBindTexture(GL_TEXTURE_2D, textures[0]); } glEnable(GL_TEXTURE_2D); @@ -1258,7 +1189,7 @@ FBOTest::testRender2MipmapTexture(void) // Clean up if (useFramebuffer) - glDeleteFramebuffersEXT_func(1, fbs); + glDeleteFramebuffersEXT(1, fbs); glDeleteTextures(1, textures); // Check result @@ -1301,13 +1232,13 @@ FBOTest::testErrorHandling(void) // At least one image attached to the framebuffer - glGenFramebuffersEXT_func(1, fbs); - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, fbs[0]); + glGenFramebuffersEXT(1, fbs); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbs[0]); glDrawBuffer(GL_NONE); glReadBuffer(GL_NONE); - status = glCheckFramebufferStatusEXT_func(GL_FRAMEBUFFER_EXT); - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, 0); - glDeleteFramebuffersEXT_func(1, fbs); + status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + glDeleteFramebuffersEXT(1, fbs); if (status != GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT) { REPORT_FAILURE @@ -1317,25 +1248,25 @@ FBOTest::testErrorHandling(void) // All attached images have the same width and height, // unless GL_ARB_framebuffer object is supported. - glGenFramebuffersEXT_func(1, fbs); - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, fbs[0]); + glGenFramebuffersEXT(1, fbs); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbs[0]); glGenTextures(2, textures); glBindTexture(GL_TEXTURE_2D, textures[0]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, TEXSIZE, TEXSIZE, 0, GL_RGB, GL_INT, NULL); - glFramebufferTexture2DEXT_func(GL_FRAMEBUFFER_EXT, + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, textures[0], 0); glBindTexture(GL_TEXTURE_2D, textures[1]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, TEXSIZE / 2, TEXSIZE / 2, 0, GL_RGB, GL_INT, NULL); - glFramebufferTexture2DEXT_func(GL_FRAMEBUFFER_EXT, + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT + maxColorAttachment - 1, GL_TEXTURE_2D, textures[1], 0); - status = glCheckFramebufferStatusEXT_func(GL_FRAMEBUFFER_EXT); - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, 0); - glDeleteFramebuffersEXT_func(1, fbs); + status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + glDeleteFramebuffersEXT(1, fbs); glDeleteTextures(2, textures); if (!haveARBfbo && status != GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT) { @@ -1347,25 +1278,25 @@ FBOTest::testErrorHandling(void) // All images attached to the attachment points // COLOR_ATTACHMENT0_EXT through COLOR_ATTACHMENTn_EXT must // have the same internal format, unless ARB_fbo is supported. - glGenFramebuffersEXT_func(1, fbs); - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, fbs[0]); + glGenFramebuffersEXT(1, fbs); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbs[0]); glGenTextures(2, textures); glBindTexture(GL_TEXTURE_2D, textures[0]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, TEXSIZE, TEXSIZE, 0, GL_RGB, GL_INT, NULL); - glFramebufferTexture2DEXT_func(GL_FRAMEBUFFER_EXT, + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, textures[0], 0); glBindTexture(GL_TEXTURE_2D, textures[1]); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TEXSIZE, TEXSIZE, 0, GL_RGBA, GL_INT, NULL); - glFramebufferTexture2DEXT_func(GL_FRAMEBUFFER_EXT, + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT + maxColorAttachment - 1, GL_TEXTURE_2D, textures[1], 0); - status = glCheckFramebufferStatusEXT_func(GL_FRAMEBUFFER_EXT); - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, 0); - glDeleteFramebuffersEXT_func(1, fbs); + status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + glDeleteFramebuffersEXT(1, fbs); glDeleteTextures(2, textures); if (!haveARBfbo && status != GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT) { @@ -1378,13 +1309,13 @@ FBOTest::testErrorHandling(void) // The value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT must not // be NONE for any color attachment point(s) named by // DRAW_BUFFERi. - glGenFramebuffersEXT_func(1, fbs); - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, fbs[0]); + glGenFramebuffersEXT(1, fbs); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbs[0]); glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT + maxColorAttachment - 1); - status = glCheckFramebufferStatusEXT_func(GL_FRAMEBUFFER_EXT); - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, 0); - glDeleteFramebuffersEXT_func(1, fbs); + status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + glDeleteFramebuffersEXT(1, fbs); if (status != GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT && !have_ARB_ES2) { REPORT_FAILURE @@ -1395,14 +1326,14 @@ FBOTest::testErrorHandling(void) // If READ_BUFFER is not NONE, then the value of // FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT must not be NONE for // the color attachment point named by READ_BUFFER. - glGenFramebuffersEXT_func(1, fbs); - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, fbs[0]); + glGenFramebuffersEXT(1, fbs); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbs[0]); glDrawBuffer(GL_NONE); glReadBuffer(GL_COLOR_ATTACHMENT0_EXT + maxColorAttachment - 1); - status = glCheckFramebufferStatusEXT_func(GL_FRAMEBUFFER_EXT); - glBindFramebufferEXT_func(GL_FRAMEBUFFER_EXT, 0); - glDeleteFramebuffersEXT_func(1, fbs); + status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + glDeleteFramebuffersEXT(1, fbs); if (status != GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT && !have_ARB_ES2) { REPORT_FAILURE diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp index dc152a5bd..837382c14 100644 --- a/tests/glean/tfragprog1.cpp +++ b/tests/glean/tfragprog1.cpp @@ -48,17 +48,6 @@ namespace GLEAN { - -static PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB_func; -static PFNGLGENPROGRAMSARBPROC glGenProgramsARB_func; -static PFNGLPROGRAMSTRINGARBPROC glProgramStringARB_func; -static PFNGLBINDPROGRAMARBPROC glBindProgramARB_func; -static PFNGLISPROGRAMARBPROC glIsProgramARB_func; -static PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB_func; -static PFNGLGETPROGRAMIVARBPROC glGetProgramivARB_func; -static PFNGLFOGCOORDFPROC glFogCoordf_func; - - // Clamp X to [0, 1] #define CLAMP01( X ) ( (X)<(0.0) ? (0.0) : ((X)>(1.0) ? (1.0) : (X)) ) // Absolute value @@ -911,41 +900,18 @@ FragmentProgramTest::setup(void) InfNan[3] = 1.0 / HUGE_VAL; // get function pointers - glProgramLocalParameter4fvARB_func = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) GLUtils::getProcAddress("glProgramLocalParameter4fvARB"); - assert(glProgramLocalParameter4fvARB_func); - - glGenProgramsARB_func = (PFNGLGENPROGRAMSARBPROC) GLUtils::getProcAddress("glGenProgramsARB"); - assert(glGenProgramsARB_func); - - glProgramStringARB_func = (PFNGLPROGRAMSTRINGARBPROC) GLUtils::getProcAddress("glProgramStringARB"); - assert(glProgramStringARB_func); - - glBindProgramARB_func = (PFNGLBINDPROGRAMARBPROC) GLUtils::getProcAddress("glBindProgramARB"); - assert(glBindProgramARB_func); - - glIsProgramARB_func = (PFNGLISPROGRAMARBPROC) GLUtils::getProcAddress("glIsProgramARB"); - assert(glIsProgramARB_func); - - glDeleteProgramsARB_func = (PFNGLDELETEPROGRAMSARBPROC) GLUtils::getProcAddress("glDeleteProgramsARB"); - assert(glDeleteProgramsARB_func); - - glGetProgramivARB_func = (PFNGLGETPROGRAMIVARBPROC) GLUtils::getProcAddress("glGetProgramivARB"); - assert(glGetProgramivARB_func); - - glFogCoordf_func = (PFNGLFOGCOORDFPROC) GLUtils::getProcAddress("glFogCoordf"); - assert(glFogCoordf_func); GLuint progID; - glGenProgramsARB_func(1, &progID); - glBindProgramARB_func(GL_FRAGMENT_PROGRAM_ARB, progID); + glGenProgramsARB(1, &progID); + glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, progID); glEnable(GL_FRAGMENT_PROGRAM_ARB); // load program inputs glColor4fv(FragColor); - glProgramLocalParameter4fvARB_func(GL_FRAGMENT_PROGRAM_ARB, 0, Param0); - glProgramLocalParameter4fvARB_func(GL_FRAGMENT_PROGRAM_ARB, 1, Param1); - glProgramLocalParameter4fvARB_func(GL_FRAGMENT_PROGRAM_ARB, 2, Param2); - glProgramLocalParameter4fvARB_func(GL_FRAGMENT_PROGRAM_ARB, 9, InfNan); + glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 0, Param0); + glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 1, Param1); + glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 2, Param2); + glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 9, InfNan); GLenum err = glGetError(); assert(!err); // should be OK @@ -969,7 +935,7 @@ FragmentProgramTest::setup(void) glFogf(GL_FOG_DENSITY, FogDensity); glFogfv(GL_FOG_COLOR, FogColor); glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT); - glFogCoordf_func(FogCoord); + glFogCoordf(FogCoord); // compute error tolerances (may need fine-tuning) int bufferBits[5]; @@ -1053,10 +1019,10 @@ FragmentProgramTest::equalDepth(GLfloat z0, GLfloat z1) const bool FragmentProgramTest::testProgram(const FragmentProgram &p) { - glProgramStringARB_func(GL_FRAGMENT_PROGRAM_ARB, - GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(p.progString), - (const GLubyte *) p.progString); + glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, + GL_PROGRAM_FORMAT_ASCII_ARB, + strlen(p.progString), + (const GLubyte *) p.progString); GLenum err = glGetError(); if (err) { diff --git a/tests/glean/tglsl1.cpp b/tests/glean/tglsl1.cpp index 6ccfb8e27..4cb2ad097 100644 --- a/tests/glean/tglsl1.cpp +++ b/tests/glean/tglsl1.cpp @@ -41,52 +41,6 @@ namespace GLEAN { -static PFNGLTEXIMAGE3DPROC glTexImage3D_func = NULL; - -static PFNGLACTIVETEXTUREPROC glActiveTexture_func = NULL; - -static PFNGLPOINTPARAMETERFPROC glPointParameterf_func = NULL; -static PFNGLPOINTPARAMETERFVPROC glPointParameterfv_func = NULL; -static PFNGLSECONDARYCOLOR3FVPROC glSecondaryColor3fv_func = NULL; - -static PFNGLATTACHSHADERPROC glAttachShader_func = NULL; -static PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation_func = NULL; -static PFNGLCOMPILESHADERPROC glCompileShader_func = NULL; -static PFNGLCREATEPROGRAMPROC glCreateProgram_func = NULL; -static PFNGLCREATESHADERPROC glCreateShader_func = NULL; -static PFNGLDELETEPROGRAMPROC glDeleteProgram_func = NULL; -static PFNGLDELETESHADERPROC glDeleteShader_func = NULL; -static PFNGLGETATTACHEDSHADERSPROC glGetAttachedShaders_func = NULL; -static PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation_func = NULL; -static PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog_func = NULL; -static PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog_func = NULL; -static PFNGLGETSHADERIVPROC glGetShaderiv_func = NULL; -static PFNGLGETPROGRAMIVPROC glGetProgramiv_func = NULL; -static PFNGLGETSHADERSOURCEPROC glGetShaderSource_func = NULL; -static PFNGLGETUNIFORMFVPROC glGetUniformfv_func = NULL; -static PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation_func = NULL; -static PFNGLISPROGRAMPROC glIsProgram_func = NULL; -static PFNGLISSHADERPROC glIsShader_func = NULL; -static PFNGLLINKPROGRAMPROC glLinkProgram_func = NULL; -static PFNGLSHADERSOURCEPROC glShaderSource_func = NULL; -static PFNGLUNIFORM1IPROC glUniform1i_func = NULL; -static PFNGLUNIFORM1FVPROC glUniform1fv_func = NULL; -static PFNGLUNIFORM2FVPROC glUniform2fv_func = NULL; -static PFNGLUNIFORM3FVPROC glUniform3fv_func = NULL; -static PFNGLUNIFORM4FVPROC glUniform4fv_func = NULL; -static PFNGLUNIFORMMATRIX2FVPROC glUniformMatrix2fv_func = NULL; -static PFNGLUNIFORMMATRIX3FVPROC glUniformMatrix3fv_func = NULL; -static PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv_func = NULL; -static PFNGLUSEPROGRAMPROC glUseProgram_func = NULL; -static PFNGLVERTEXATTRIB1FPROC glVertexAttrib1f_func = NULL; -static PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f_func = NULL; -static PFNGLVERTEXATTRIB3FPROC glVertexAttrib3f_func = NULL; -static PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f_func = NULL; - -static PFNGLUNIFORMMATRIX2X4FVPROC glUniformMatrix2x4fv_func = NULL; -static PFNGLUNIFORMMATRIX4X3FVPROC glUniformMatrix4x3fv_func = NULL; - - #define FLAG_NONE 0x0 #define FLAG_LOOSE 0x1 // to indicate a looser tolerance test is needed #define FLAG_ILLEGAL_SHADER 0x2 // the shader test should not compile @@ -4067,138 +4021,6 @@ static const ShaderProgram Programs[] = { }; - -// Get ptrs to API functions. -bool -GLSLTest::getFunctions(void) -{ - glTexImage3D_func = (PFNGLTEXIMAGE3DPROC) GLUtils::getProcAddress("glTexImage3D"); - if (!glTexImage3D_func) - return false; - glActiveTexture_func = (PFNGLACTIVETEXTUREPROC) GLUtils::getProcAddress("glActiveTexture"); - if (!glActiveTexture_func) - return false; - glPointParameterf_func = (PFNGLPOINTPARAMETERFPROC) GLUtils::getProcAddress("glPointParameterf"); - if (!glPointParameterf_func) - return false; - glPointParameterfv_func = (PFNGLPOINTPARAMETERFVPROC) GLUtils::getProcAddress("glPointParameterfv"); - if (!glPointParameterfv_func) - return false; - glSecondaryColor3fv_func = (PFNGLSECONDARYCOLOR3FVPROC) GLUtils::getProcAddress("glSecondaryColor3fv"); - if (!glSecondaryColor3fv_func) - return false; - glAttachShader_func = (PFNGLATTACHSHADERPROC) GLUtils::getProcAddress("glAttachShader"); - if (!glAttachShader_func) - return false; - glBindAttribLocation_func = (PFNGLBINDATTRIBLOCATIONPROC) GLUtils::getProcAddress("glBindAttribLocation"); - if (!glBindAttribLocation_func) - return false; - glCompileShader_func = (PFNGLCOMPILESHADERPROC) GLUtils::getProcAddress("glCompileShader"); - if (!glCompileShader_func) - return false; - glCreateProgram_func = (PFNGLCREATEPROGRAMPROC) GLUtils::getProcAddress("glCreateProgram"); - if (!glCreateProgram_func) - return false; - glCreateShader_func = (PFNGLCREATESHADERPROC) GLUtils::getProcAddress("glCreateShader"); - if (!glCreateShader_func) - return false; - glDeleteProgram_func = (PFNGLDELETEPROGRAMPROC) GLUtils::getProcAddress("glDeleteProgram"); - if (!glDeleteProgram_func) - return false; - glDeleteShader_func = (PFNGLDELETESHADERPROC) GLUtils::getProcAddress("glDeleteShader"); - if (!glDeleteShader_func) - return false; - glGetAttachedShaders_func = (PFNGLGETATTACHEDSHADERSPROC) GLUtils::getProcAddress("glGetAttachedShaders"); - if (!glGetAttachedShaders_func) - return false; - glGetAttribLocation_func = (PFNGLGETATTRIBLOCATIONPROC) GLUtils::getProcAddress("glGetAttribLocation"); - if (!glGetAttribLocation_func) - return false; - glGetProgramInfoLog_func = (PFNGLGETPROGRAMINFOLOGPROC) GLUtils::getProcAddress("glGetProgramInfoLog"); - if (!glGetProgramInfoLog_func) - return false; - glGetShaderInfoLog_func = (PFNGLGETSHADERINFOLOGPROC) GLUtils::getProcAddress("glGetShaderInfoLog"); - if (!glGetShaderInfoLog_func) - return false; - glGetProgramiv_func = (PFNGLGETPROGRAMIVPROC) GLUtils::getProcAddress("glGetProgramiv"); - if (!glGetProgramiv_func) - return false; - glGetShaderiv_func = (PFNGLGETSHADERIVPROC) GLUtils::getProcAddress("glGetShaderiv"); - if (!glGetShaderiv_func) - return false; - glGetShaderSource_func = (PFNGLGETSHADERSOURCEPROC) GLUtils::getProcAddress("glGetShaderSource"); - if (!glGetShaderSource_func) - return false; - glGetUniformLocation_func = (PFNGLGETUNIFORMLOCATIONPROC) GLUtils::getProcAddress("glGetUniformLocation"); - if (!glGetUniformLocation_func) - return false; - glGetUniformfv_func = (PFNGLGETUNIFORMFVPROC) GLUtils::getProcAddress("glGetUniformfv"); - if (!glGetUniformfv_func) - return false; - glIsProgram_func = (PFNGLISPROGRAMPROC) GLUtils::getProcAddress("glIsProgram"); - if (!glIsProgram_func) - return false; - glIsShader_func = (PFNGLISSHADERPROC) GLUtils::getProcAddress("glIsShader"); - if (!glIsShader_func) - return false; - glLinkProgram_func = (PFNGLLINKPROGRAMPROC) GLUtils::getProcAddress("glLinkProgram"); - if (!glLinkProgram_func) - return false; - glShaderSource_func = (PFNGLSHADERSOURCEPROC) GLUtils::getProcAddress("glShaderSource"); - if (!glShaderSource_func) - return false; - glUniform1i_func = (PFNGLUNIFORM1IPROC) GLUtils::getProcAddress("glUniform1i"); - if (!glUniform1i_func) - return false; - glUniform1fv_func = (PFNGLUNIFORM1FVPROC) GLUtils::getProcAddress("glUniform1fv"); - if (!glUniform1fv_func) - return false; - glUniform2fv_func = (PFNGLUNIFORM2FVPROC) GLUtils::getProcAddress("glUniform2fv"); - if (!glUniform2fv_func) - return false; - glUniform3fv_func = (PFNGLUNIFORM3FVPROC) GLUtils::getProcAddress("glUniform3fv"); - if (!glUniform3fv_func) - return false; - glUniform4fv_func = (PFNGLUNIFORM3FVPROC) GLUtils::getProcAddress("glUniform4fv"); - if (!glUniform4fv_func) - return false; - glUniformMatrix2fv_func = (PFNGLUNIFORMMATRIX2FVPROC) GLUtils::getProcAddress("glUniformMatrix2fv"); - if (!glUniformMatrix2fv_func) - return false; - glUniformMatrix3fv_func = (PFNGLUNIFORMMATRIX3FVPROC) GLUtils::getProcAddress("glUniformMatrix3fv"); - if (!glUniformMatrix3fv_func) - return false; - glUniformMatrix4fv_func = (PFNGLUNIFORMMATRIX4FVPROC) GLUtils::getProcAddress("glUniformMatrix4fv"); - if (!glUniformMatrix4fv_func) - return false; - glUseProgram_func = (PFNGLUSEPROGRAMPROC) GLUtils::getProcAddress("glUseProgram"); - if (!glUseProgram_func) - return false; - glVertexAttrib1f_func = (PFNGLVERTEXATTRIB1FPROC) GLUtils::getProcAddress("glVertexAttrib1f"); - if (!glVertexAttrib1f_func) - return false; - glVertexAttrib2f_func = (PFNGLVERTEXATTRIB2FPROC) GLUtils::getProcAddress("glVertexAttrib2f"); - if (!glVertexAttrib2f_func) - return false; - glVertexAttrib3f_func = (PFNGLVERTEXATTRIB3FPROC) GLUtils::getProcAddress("glVertexAttrib3f"); - if (!glVertexAttrib3f_func) - return false; - glVertexAttrib4f_func = (PFNGLVERTEXATTRIB4FPROC) GLUtils::getProcAddress("glVertexAttrib4f"); - if (!glVertexAttrib4f_func) - return false; - - /* 2.1 */ - glUniformMatrix2x4fv_func = (PFNGLUNIFORMMATRIX2X4FVPROC) GLUtils::getProcAddress("glUniformMatrix2x4fv"); - if (!glUniformMatrix2x4fv_func) - return false; - glUniformMatrix4x3fv_func = (PFNGLUNIFORMMATRIX4X3FVPROC) GLUtils::getProcAddress("glUniformMatrix4x3fv"); - if (!glUniformMatrix4x3fv_func) - return false; - - return true; -} - - void GLSLTest::setupTextures(void) { @@ -4215,7 +4037,7 @@ GLSLTest::setupTextures(void) glGenTextures(1, &obj3D); glGenTextures(1, &objZ); - glActiveTexture_func(GL_TEXTURE0); + glActiveTexture(GL_TEXTURE0); // // 2D texture, w/ mipmap @@ -4334,7 +4156,7 @@ GLSLTest::setupTextures(void) } } glBindTexture(GL_TEXTURE_3D, obj3D); - glTexImage3D_func(GL_TEXTURE_3D, 0, GL_RGBA, 16, 16, 16, 0, + glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, 16, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, teximage3D); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); @@ -4352,7 +4174,7 @@ GLSLTest::setupTextures(void) teximageZ[i][j] = 0.75; } } - glActiveTexture_func(GL_TEXTURE1); // NOTE: Unit 1 + glActiveTexture(GL_TEXTURE1); // NOTE: Unit 1 glBindTexture(GL_TEXTURE_2D, objZ); glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 16, 16, 0, GL_DEPTH_COMPONENT, GL_FLOAT, teximageZ); @@ -4361,7 +4183,7 @@ GLSLTest::setupTextures(void) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE_ARB); - glActiveTexture_func(GL_TEXTURE0); + glActiveTexture(GL_TEXTURE0); } @@ -4376,9 +4198,9 @@ GLSLTest::setupTextureMatrix1(void) 0.1, 0.2, 0.3, 1.0 // col 3 }; glMatrixMode(GL_TEXTURE); - glActiveTexture_func(GL_TEXTURE1); + glActiveTexture(GL_TEXTURE1); glLoadMatrixf(m); - glActiveTexture_func(GL_TEXTURE0); + glActiveTexture(GL_TEXTURE0); glMatrixMode(GL_MODELVIEW); } @@ -4400,27 +4222,22 @@ GLSLTest::setup(void) glsl_120 = version >= 1.20; glsl_130 = version >= 1.30; - if (!getFunctions()) { - env->log << "Unable to get pointer to an OpenGL 2.0 API function\n"; - return false; - } - setupTextures(); setupTextureMatrix1(); // load program inputs glColor4fv(PrimaryColor); - glSecondaryColor3fv_func(SecondaryColor); + glSecondaryColor3fv(SecondaryColor); // other GL state glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, Ambient); glLightfv(GL_LIGHT0, GL_DIFFUSE, LightDiffuse); glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MatDiffuse); glPointSize(PSIZE); - glPointParameterf_func(GL_POINT_SIZE_MIN, PSIZE_MIN); - glPointParameterf_func(GL_POINT_SIZE_MAX, PSIZE_MAX); - glPointParameterf_func(GL_POINT_FADE_THRESHOLD_SIZE, PSIZE_THRESH); - glPointParameterfv_func(GL_POINT_DISTANCE_ATTENUATION, PointAtten); + glPointParameterf(GL_POINT_SIZE_MIN, PSIZE_MIN); + glPointParameterf(GL_POINT_SIZE_MAX, PSIZE_MAX); + glPointParameterf(GL_POINT_FADE_THRESHOLD_SIZE, PSIZE_THRESH); + glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, PointAtten); glFogf(GL_FOG_START, FOG_START); glFogf(GL_FOG_END, FOG_END); glFogfv(GL_FOG_COLOR, FogColor); @@ -4529,10 +4346,9 @@ GLuint GLSLTest::loadAndCompileShader(GLenum target, const char *str) { GLuint shader; - shader = glCreateShader_func(target); - glShaderSource_func(shader, 1, - (const GLchar **) &str, NULL); - glCompileShader_func(shader); + shader = glCreateShader(target); + glShaderSource(shader, 1, (const GLchar **) &str, NULL); + glCompileShader(shader); return shader; } @@ -4547,9 +4363,9 @@ GLSLTest::checkCompileStatus(GLenum target, GLuint shader, GLchar infoLog[1000]; GLsizei len; - glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat); + glGetShaderiv(shader, GL_COMPILE_STATUS, &stat); if (!stat) { - glGetShaderInfoLog_func(shader, 1000, &len, infoLog); + glGetShaderInfoLog(shader, 1000, &len, infoLog); // env->log << infoLog << "\n"; } @@ -4636,17 +4452,17 @@ GLSLTest::testProgram(const ShaderProgram &p) goto cleanup; } - program = glCreateProgram_func(); + program = glCreateProgram(); if (fragShader) - glAttachShader_func(program, fragShader); + glAttachShader(program, fragShader); if (vertShader) - glAttachShader_func(program, vertShader); - glLinkProgram_func(program); + glAttachShader(program, vertShader); + glLinkProgram(program); // check link { GLint stat; - glGetProgramiv_func(program, GL_LINK_STATUS, &stat); + glGetProgramiv(program, GL_LINK_STATUS, &stat); if (!stat) { if (p.flags & FLAG_ILLEGAL_LINK) { // this is the expected outcome @@ -4656,7 +4472,7 @@ GLSLTest::testProgram(const ShaderProgram &p) else { GLchar log[1000]; GLsizei len; - glGetProgramInfoLog_func(program, 1000, &len, log); + glGetProgramInfoLog(program, 1000, &len, log); env->log << "FAILURE:\n"; env->log << " Shader test: " << p.name << "\n"; env->log << " Link error: "; @@ -4678,7 +4494,7 @@ GLSLTest::testProgram(const ShaderProgram &p) } } - glUseProgram_func(program); + glUseProgram(program); if (p.flags & FLAG_VERTEX_TEXTURE) { // check if vertex texture units are available @@ -4692,57 +4508,57 @@ GLSLTest::testProgram(const ShaderProgram &p) } // load uniform vars - u1 = glGetUniformLocation_func(program, "uniform1"); + u1 = glGetUniformLocation(program, "uniform1"); if (u1 >= 0) - glUniform4fv_func(u1, 1, Uniform1); + glUniform4fv(u1, 1, Uniform1); - uArray = glGetUniformLocation_func(program, "uniformArray"); + uArray = glGetUniformLocation(program, "uniformArray"); if (uArray >= 0) - glUniform1fv_func(uArray, 4, UniformArray); + glUniform1fv(uArray, 4, UniformArray); - uArray4 = glGetUniformLocation_func(program, "uniformArray4"); + uArray4 = glGetUniformLocation(program, "uniformArray4"); if (uArray4 >= 0) - glUniform4fv_func(uArray4, 4, (float *) UniformArray4); + glUniform4fv(uArray4, 4, (float *) UniformArray4); - utex1d = glGetUniformLocation_func(program, "tex1d"); + utex1d = glGetUniformLocation(program, "tex1d"); if (utex1d >= 0) - glUniform1i_func(utex1d, 0); // bind to tex unit 0 + glUniform1i(utex1d, 0); // bind to tex unit 0 - utex2d = glGetUniformLocation_func(program, "tex2d"); + utex2d = glGetUniformLocation(program, "tex2d"); if (utex2d >= 0) - glUniform1i_func(utex2d, 0); // bind to tex unit 0 + glUniform1i(utex2d, 0); // bind to tex unit 0 - utex3d = glGetUniformLocation_func(program, "tex3d"); + utex3d = glGetUniformLocation(program, "tex3d"); if (utex3d >= 0) - glUniform1i_func(utex3d, 0); // bind to tex unit 0 + glUniform1i(utex3d, 0); // bind to tex unit 0 - utexZ = glGetUniformLocation_func(program, "texZ"); + utexZ = glGetUniformLocation(program, "texZ"); if (utexZ >= 0) - glUniform1i_func(utexZ, 1); // bind to tex unit 1 + glUniform1i(utexZ, 1); // bind to tex unit 1 - umat4 = glGetUniformLocation_func(program, "uniformMat4"); + umat4 = glGetUniformLocation(program, "uniformMat4"); if (umat4 >= 0) - glUniformMatrix4fv_func(umat4, 1, GL_FALSE, uniformMatrix); + glUniformMatrix4fv(umat4, 1, GL_FALSE, uniformMatrix); - umat4t = glGetUniformLocation_func(program, "uniformMat4t"); + umat4t = glGetUniformLocation(program, "uniformMat4t"); if (umat4t >= 0) - glUniformMatrix4fv_func(umat4t, 1, GL_TRUE, uniformMatrix); + glUniformMatrix4fv(umat4t, 1, GL_TRUE, uniformMatrix); - umat2x4 = glGetUniformLocation_func(program, "uniformMat2x4"); + umat2x4 = glGetUniformLocation(program, "uniformMat2x4"); if (umat2x4 >= 0) - glUniformMatrix2x4fv_func(umat2x4, 1, GL_FALSE, uniformMatrix2x4); + glUniformMatrix2x4fv(umat2x4, 1, GL_FALSE, uniformMatrix2x4); - umat2x4t = glGetUniformLocation_func(program, "uniformMat2x4t"); + umat2x4t = glGetUniformLocation(program, "uniformMat2x4t"); if (umat2x4t >= 0) - glUniformMatrix2x4fv_func(umat2x4t, 1, GL_TRUE, uniformMatrix2x4); + glUniformMatrix2x4fv(umat2x4t, 1, GL_TRUE, uniformMatrix2x4); - umat4x3 = glGetUniformLocation_func(program, "uniformMat4x3"); + umat4x3 = glGetUniformLocation(program, "uniformMat4x3"); if (umat4x3 >= 0) - glUniformMatrix4x3fv_func(umat4x3, 1, GL_FALSE, uniformMatrix4x3); + glUniformMatrix4x3fv(umat4x3, 1, GL_FALSE, uniformMatrix4x3); - umat4x3t = glGetUniformLocation_func(program, "uniformMat4x3t"); + umat4x3t = glGetUniformLocation(program, "uniformMat4x3t"); if (umat4x3t >= 0) - glUniformMatrix4x3fv_func(umat4x3t, 1, GL_TRUE, uniformMatrix4x3); + glUniformMatrix4x3fv(umat4x3t, 1, GL_TRUE, uniformMatrix4x3); // to avoid potential issue with undefined result.depth.z @@ -4810,10 +4626,10 @@ GLSLTest::testProgram(const ShaderProgram &p) cleanup: if (fragShader) - glDeleteShader_func(fragShader); + glDeleteShader(fragShader); if (vertShader) - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(vertShader); + glDeleteProgram(program); return retVal; } diff --git a/tests/glean/tglsl1.h b/tests/glean/tglsl1.h index 57cf66d7e..933fa3ee3 100644 --- a/tests/glean/tglsl1.h +++ b/tests/glean/tglsl1.h @@ -75,7 +75,6 @@ private: GLfloat looseTolerance[5]; bool glsl_120; // GLSL 1.20 or higher supported? bool glsl_130; // GLSL 1.30 or higher supported? - bool getFunctions(void); void setupTextures(void); void setupTextureMatrix1(void); bool setup(void); diff --git a/tests/glean/toccluqry.cpp b/tests/glean/toccluqry.cpp index 0ea2d3751..d97b7eeb5 100644 --- a/tests/glean/toccluqry.cpp +++ b/tests/glean/toccluqry.cpp @@ -43,31 +43,15 @@ #define START_QUERY(id)\ - glBeginQueryARB_func(GL_SAMPLES_PASSED_ARB, id); + glBeginQueryARB(GL_SAMPLES_PASSED_ARB, id); #define TERM_QUERY()\ - glEndQueryARB_func(GL_SAMPLES_PASSED_ARB);\ + glEndQueryARB(GL_SAMPLES_PASSED_ARB);\ namespace GLEAN { - -// GL_VERSION_1_5 -static PFNGLBEGINQUERYPROC glBeginQuery_func = NULL; -static PFNGLENDQUERYPROC glEndQuery_func = NULL; - -// GL_ARB_occlusion_query -static PFNGLGENQUERIESARBPROC glGenQueriesARB_func = NULL; -static PFNGLDELETEQUERIESARBPROC glDeleteQueriesARB_func = NULL; -static PFNGLISQUERYARBPROC glIsQueryARB_func = NULL; -static PFNGLBEGINQUERYARBPROC glBeginQueryARB_func = NULL; -static PFNGLENDQUERYARBPROC glEndQueryARB_func = NULL; -static PFNGLGETQUERYIVARBPROC glGetQueryivARB_func = NULL; -static PFNGLGETQUERYOBJECTIVARBPROC glGetQueryObjectivARB_func = NULL; -static PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB_func = NULL; - - void OccluQryTest::reportError(const char *msg) { @@ -110,27 +94,6 @@ bool OccluQryTest::chk_ext() void OccluQryTest::setup() { - glBeginQuery_func = (PFNGLBEGINQUERYPROC) GLUtils::getProcAddress("glBeginQuery"); - assert(glBeginQuery_func); - glEndQuery_func = (PFNGLENDQUERYPROC) GLUtils::getProcAddress("glEndQuery"); - assert(glEndQuery_func); - - glGenQueriesARB_func = (PFNGLGENQUERIESARBPROC) GLUtils::getProcAddress("glGenQueriesARB"); - assert(glGenQueriesARB_func); - glDeleteQueriesARB_func = (PFNGLDELETEQUERIESARBPROC) GLUtils::getProcAddress("glDeleteQueriesARB"); - assert(glDeleteQueriesARB_func); - glIsQueryARB_func = (PFNGLISQUERYARBPROC) GLUtils::getProcAddress("glIsQueryARB"); - assert(glIsQueryARB_func); - glBeginQueryARB_func = (PFNGLBEGINQUERYARBPROC) GLUtils::getProcAddress("glBeginQueryARB"); - assert(glBeginQueryARB_func); - glEndQueryARB_func = (PFNGLENDQUERYARBPROC) GLUtils::getProcAddress("glEndQueryARB"); - assert(glEndQueryARB_func); - glGetQueryivARB_func = (PFNGLGETQUERYIVARBPROC) GLUtils::getProcAddress("glGetQueryivARB"); - assert(glGetQueryivARB_func); - glGetQueryObjectivARB_func = (PFNGLGETQUERYOBJECTIVARBPROC) GLUtils::getProcAddress("glGetQueryObjectivARB"); - assert(glGetQueryObjectivARB_func); - glGetQueryObjectuivARB_func = (PFNGLGETQUERYOBJECTUIVARBPROC) GLUtils::getProcAddress("glGetQueryObjectuivARB"); - assert(glGetQueryObjectuivARB_func); } GLuint OccluQryTest::find_unused_id() @@ -144,7 +107,7 @@ GLuint OccluQryTest::find_unused_id() while (1) { /* assuming that at least 2^32-1 <id> can be generated */ id = idRand.next(); - if (id != 0 && glIsQueryARB_func(id) == GL_FALSE) + if (id != 0 && glIsQueryARB(id) == GL_FALSE) return id; if (++ counter >= MAX_FIND_ID_ROUND) { char str[1000]; @@ -210,9 +173,9 @@ bool OccluQryTest::conformOQ_GetObjivAval_multi1(GLuint id) glPopMatrix(); do { - glGetQueryObjectivARB_func(id, GL_QUERY_RESULT_AVAILABLE_ARB, &ready); + glGetQueryObjectivARB(id, GL_QUERY_RESULT_AVAILABLE_ARB, &ready); } while (!ready); - glGetQueryObjectuivARB_func(id, GL_QUERY_RESULT_ARB, &passed); + glGetQueryObjectuivARB(id, GL_QUERY_RESULT_ARB, &passed); // 'passed' should be zero return passed > 0 ? false : true; @@ -275,16 +238,16 @@ bool OccluQryTest::conformOQ_GetObjivAval_multi2() glPopMatrix(); - glGetQueryObjectuivARB_func(id1, GL_QUERY_RESULT_ARB, &passed1); - glGetQueryObjectuivARB_func(id2, GL_QUERY_RESULT_ARB, &passed2); - glGetQueryObjectuivARB_func(id3, GL_QUERY_RESULT_ARB, &passed3); + glGetQueryObjectuivARB(id1, GL_QUERY_RESULT_ARB, &passed1); + glGetQueryObjectuivARB(id2, GL_QUERY_RESULT_ARB, &passed2); + glGetQueryObjectuivARB(id3, GL_QUERY_RESULT_ARB, &passed3); glDepthMask(GL_TRUE); - glDeleteQueriesARB_func(1, &id1); - glDeleteQueriesARB_func(1, &id2); - glDeleteQueriesARB_func(1, &id3); + glDeleteQueriesARB(1, &id1); + glDeleteQueriesARB(1, &id2); + glDeleteQueriesARB(1, &id3); glPopMatrix(); glMatrixMode( GL_PROJECTION ); @@ -318,7 +281,7 @@ bool OccluQryTest::conformOQ_GetQry_CnterBit() /* get the minimum bit number supported by the implementation, * and check the legality of result of GL_QUERY_COUNTER_BITS_ARB */ - glGetQueryivARB_func(GL_SAMPLES_PASSED_ARB, GL_QUERY_COUNTER_BITS_ARB, &bit_num); + glGetQueryivARB(GL_SAMPLES_PASSED_ARB, GL_QUERY_COUNTER_BITS_ARB, &bit_num); glGetIntegerv(GL_MAX_VIEWPORT_DIMS, dims); err = glGetError(); if (err == GL_INVALID_OPERATION || err == GL_INVALID_ENUM) @@ -346,14 +309,14 @@ bool OccluQryTest::conformOQ_Begin_unused_id() if (id == 0) return false; - glBeginQuery_func(GL_SAMPLES_PASSED_ARB, id); + glBeginQuery(GL_SAMPLES_PASSED_ARB, id); - if (glIsQueryARB_func(id) == GL_FALSE) { + if (glIsQueryARB(id) == GL_FALSE) { reportError("Begin with a unused id failed."); pass = false; } - glEndQuery_func(GL_SAMPLES_PASSED_ARB); + glEndQuery(GL_SAMPLES_PASSED_ARB); return pass; } @@ -365,7 +328,7 @@ bool OccluQryTest::conformOQ_EndAfter(GLuint id) START_QUERY(id); TERM_QUERY(); - glEndQueryARB_func(GL_SAMPLES_PASSED_ARB); + glEndQueryARB(GL_SAMPLES_PASSED_ARB); if (glGetError() != GL_INVALID_OPERATION) { reportError("No GL_INVALID_OPERATION generated if " @@ -385,7 +348,7 @@ bool OccluQryTest::conformOQ_GenIn(GLuint id) START_QUERY(id); - glGenQueriesARB_func(1, &id); + glGenQueriesARB(1, &id); if (glGetError() != GL_NO_ERROR) { reportError("Error generated when GenQueries called " "in the progress of another."); @@ -408,8 +371,8 @@ bool OccluQryTest::conformOQ_DeleteIn(GLuint id) START_QUERY(id); if (id > 0) { - glGenQueriesARB_func(1, &another_id); - glDeleteQueriesARB_func(1, &another_id); + glGenQueriesARB(1, &another_id); + glDeleteQueriesARB(1, &another_id); if (glGetError() != GL_NO_ERROR) { reportError("Error generated when DeleteQueries called " @@ -434,7 +397,7 @@ bool OccluQryTest::conformOQ_BeginIn(GLuint id) /* Issue another BeginQueryARB while another query is already in progress */ - glBeginQueryARB_func(GL_SAMPLES_PASSED_ARB, id); + glBeginQueryARB(GL_SAMPLES_PASSED_ARB, id); if (glGetError() != GL_INVALID_OPERATION) { reportError("No GL_INVALID_OPERATION generated if " @@ -456,11 +419,11 @@ bool OccluQryTest::conformOQ_GetObjAvalIn(GLuint id) START_QUERY(id); - glGetQueryObjectivARB_func(id, GL_QUERY_RESULT_AVAILABLE_ARB, ¶m); + glGetQueryObjectivARB(id, GL_QUERY_RESULT_AVAILABLE_ARB, ¶m); if (glGetError() != GL_INVALID_OPERATION) pass = false; - glGetQueryObjectuivARB_func(id, GL_QUERY_RESULT_AVAILABLE_ARB, (GLuint *)¶m); + glGetQueryObjectuivARB(id, GL_QUERY_RESULT_AVAILABLE_ARB, (GLuint *)¶m); if (glGetError() != GL_INVALID_OPERATION) pass = false; @@ -484,11 +447,11 @@ bool OccluQryTest::conformOQ_GetObjResultIn(GLuint id) START_QUERY(id); - glGetQueryObjectivARB_func(id, GL_QUERY_RESULT_ARB, ¶m); + glGetQueryObjectivARB(id, GL_QUERY_RESULT_ARB, ¶m); if (glGetError() != GL_INVALID_OPERATION) pass = false; - glGetQueryObjectuivARB_func(id, GL_QUERY_RESULT_ARB, (GLuint *)¶m); + glGetQueryObjectuivARB(id, GL_QUERY_RESULT_ARB, (GLuint *)¶m); if (glGetError() != GL_INVALID_OPERATION) pass = false; @@ -518,7 +481,7 @@ bool OccluQryTest::conformOQ_GetObjivAval(GLuint id) if (id_tmp == 0) return false; - glGetQueryObjectivARB_func(id_tmp, GL_QUERY_RESULT_AVAILABLE_ARB, ¶m); + glGetQueryObjectivARB(id_tmp, GL_QUERY_RESULT_AVAILABLE_ARB, ¶m); if (glGetError() != GL_INVALID_OPERATION) { reportError("No GL_INVALID_OPERATION generated if " @@ -550,8 +513,8 @@ bool OccluQryTest::conformOQ_Gen_Delete(unsigned int id_n) return false; } - glGenQueriesARB_func(id_n, ids1); - glGenQueriesARB_func(id_n, ids2); + glGenQueriesARB(id_n, ids1); + glGenQueriesARB(id_n, ids2); /* compare whether <id> generated during the previous 2 rounds are * duplicated */ @@ -574,7 +537,7 @@ bool OccluQryTest::conformOQ_Gen_Delete(unsigned int id_n) #if 0 /* Checkout whether the Query ID just generated is valid */ for (i = 0; i < id_n; i ++) { - if (glIsQueryARB_func(ids1[i]) == GL_FALSE) { + if (glIsQueryARB(ids1[i]) == GL_FALSE) { char str[1000]; sprintf(str, "id [%d] just generated is not valid.", ids1[i]); reportError(str); @@ -585,9 +548,9 @@ bool OccluQryTest::conformOQ_Gen_Delete(unsigned int id_n) /* if <id> is a non-zero value that is not the name of a query object, * IsQueryARB returns FALSE. */ - glDeleteQueriesARB_func(id_n, ids1); + glDeleteQueriesARB(id_n, ids1); for (i = 0; i < id_n; i ++) { - if (glIsQueryARB_func(ids1[i]) == GL_TRUE) { + if (glIsQueryARB(ids1[i]) == GL_TRUE) { char str[1000]; sprintf(str, "id [%d] just deleted is still valid.", ids1[i]); reportError(str); @@ -596,7 +559,7 @@ bool OccluQryTest::conformOQ_Gen_Delete(unsigned int id_n) } /* Delete only for sanity purpose */ - glDeleteQueriesARB_func(id_n, ids2); + glDeleteQueriesARB(id_n, ids2); if (ids1) free(ids1); @@ -609,7 +572,7 @@ bool OccluQryTest::conformOQ_Gen_Delete(unsigned int id_n) return false; for (i = 0; i < id_n; i ++) { - glGenQueriesARB_func(1, ids1 + i); + glGenQueriesARB(1, ids1 + i); for (j = 0; j < i; j ++) { if (ids1[i] == ids1[j]) { char str[1000]; @@ -620,7 +583,7 @@ bool OccluQryTest::conformOQ_Gen_Delete(unsigned int id_n) } } - glDeleteQueriesARB_func(id_n, ids1); + glDeleteQueriesARB(id_n, ids1); if (ids1) free(ids1); @@ -631,7 +594,7 @@ bool OccluQryTest::conformOQ_Gen_Delete(unsigned int id_n) /* If <id> is zero, IsQueryARB should return FALSE.*/ bool OccluQryTest::conformOQ_IsIdZero(void) { - if (glIsQueryARB_func(0) == GL_TRUE) { + if (glIsQueryARB(0) == GL_TRUE) { reportError("zero is treated as a valid id by glIsQueryARB()."); return false; } @@ -644,7 +607,7 @@ bool OccluQryTest::conformOQ_IsIdZero(void) * should be generated. */ bool OccluQryTest::conformOQ_BeginIdZero(void) { - glBeginQueryARB_func(GL_SAMPLES_PASSED_ARB, 0); + glBeginQueryARB(GL_SAMPLES_PASSED_ARB, 0); if (glGetError() != GL_INVALID_OPERATION) { reportError("No GL_INVALID_OPERATION generated if " "BeginQuery with zero ID."); @@ -665,7 +628,7 @@ void OccluQryTest::runOne(MultiTestResult &r, Window &w) return; setup(); glEnable(GL_DEPTH_TEST); - glGenQueriesARB_func(1, &queryId); + glGenQueriesARB(1, &queryId); if (queryId == 0) return; @@ -713,7 +676,7 @@ void OccluQryTest::runOne(MultiTestResult &r, Window &w) result = conformOQ_BeginIdZero(); reportPassFail(r, result, "conformOQ_BeginIdZero"); - glDeleteQueriesARB_func(1, &queryId); + glDeleteQueriesARB(1, &queryId); r.pass = (r.numFailed == 0); #endif diff --git a/tests/glean/tpbo.cpp b/tests/glean/tpbo.cpp index e93d6a202..002c44483 100644 --- a/tests/glean/tpbo.cpp +++ b/tests/glean/tpbo.cpp @@ -44,19 +44,6 @@ namespace GLEAN { -// GL_VERSION_1_5 -static PFNGLBINDBUFFERPROC glBindBuffer_func = NULL; -static PFNGLMAPBUFFERPROC glMapBuffer_func = NULL; -static PFNGLUNMAPBUFFERPROC glUnmapBuffer_func = NULL; - -// GL_ARB_vertex_buffer_object -static PFNGLBINDBUFFERARBPROC glBindBufferARB_func = NULL; -static PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB_func = NULL; -static PFNGLGENBUFFERSARBPROC glGenBuffersARB_func = NULL; -static PFNGLISBUFFERARBPROC glIsBufferARB_func = NULL; -static PFNGLBUFFERDATAARBPROC glBufferDataARB_func = NULL; -static PFNGLMAPBUFFERARBPROC glMapBufferARB_func = NULL; -static PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB_func = NULL; static int usePBO; #define BUFFER_OFFSET(i) ((char *)NULL + (i)) @@ -104,28 +91,6 @@ bool PBOTest::setup(void) usePBO = 1; } - glBindBuffer_func = (PFNGLBINDBUFFERPROC) GLUtils::getProcAddress("glBindBuffer"); - assert(glBindBuffer_func); - glMapBuffer_func = (PFNGLMAPBUFFERPROC) GLUtils::getProcAddress("glMapBuffer"); - assert(glMapBuffer_func); - glUnmapBuffer_func = (PFNGLUNMAPBUFFERPROC) GLUtils::getProcAddress("glUnmapBuffer"); - assert(glUnmapBuffer_func); - - glBindBufferARB_func = (PFNGLBINDBUFFERARBPROC) GLUtils::getProcAddress("glBindBufferARB"); - assert(glBindBufferARB_func); - glDeleteBuffersARB_func = (PFNGLDELETEBUFFERSARBPROC) GLUtils::getProcAddress("glDeleteBuffersARB"); - assert(glDeleteBuffersARB_func); - glGenBuffersARB_func = (PFNGLGENBUFFERSARBPROC) GLUtils::getProcAddress("glGenBuffersARB"); - assert(glGenBuffersARB_func); - glIsBufferARB_func = (PFNGLISBUFFERARBPROC) GLUtils::getProcAddress("glIsBufferARB"); - assert(glIsBufferARB_func); - glBufferDataARB_func = (PFNGLBUFFERDATAARBPROC) GLUtils::getProcAddress("glBufferDataARB"); - assert(glBufferDataARB_func); - glMapBufferARB_func = (PFNGLMAPBUFFERARBPROC) GLUtils::getProcAddress("glMapBufferARB"); - assert(glMapBufferARB_func); - glUnmapBufferARB_func = (PFNGLUNMAPBUFFERARBPROC) GLUtils::getProcAddress("glUnmapBufferARB"); - assert(glUnmapBufferARB_func); - return true; } @@ -197,32 +162,32 @@ bool PBOTest::testSanity(void) return false; } - glGenBuffersARB_func(1, pbs); + glGenBuffersARB(1, pbs); - if (glIsBufferARB_func(pbs[0]) != GL_FALSE) { + if (glIsBufferARB(pbs[0]) != GL_FALSE) { REPORT_FAILURE("glIsBufferARB failed"); return false; } - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, pbs[0]); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pbs[0]); glGetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING_ARB, (GLint *) & pb_binding); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); if (pb_binding != pbs[0]) { REPORT_FAILURE("Failed to bind unpack pixel buffer object"); return false; } - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, pbs[0]); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pbs[0]); glGetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING_ARB, (GLint *) & pb_binding); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); if (pb_binding != pbs[0]) { REPORT_FAILURE("Failed to bind unpack pixel buffer object"); return false; } - glDeleteBuffersARB_func(1, pbs); + glDeleteBuffersARB(1, pbs); - if (glIsBufferARB_func(pbs[0]) == GL_TRUE) { + if (glIsBufferARB(pbs[0]) == GL_TRUE) { REPORT_FAILURE("glIsBufferARB failed"); return false; } @@ -243,24 +208,24 @@ bool PBOTest::testDrawPixels(void) GLubyte * pboPackMem = NULL; GLubyte black[3] = { 0, 0, 0 }; - glBindBuffer_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); - glBindBuffer_func(GL_PIXEL_PACK_BUFFER_ARB, 0); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, 0); for (useUnpackBuffer = 0; useUnpackBuffer < usePBO + 1; useUnpackBuffer++) { for (usePackBuffer = 0; usePackBuffer < usePBO + 1; usePackBuffer++) { glClearColor(0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); if (useUnpackBuffer) { - glGenBuffersARB_func(1, pb_unpack); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, pb_unpack[0]); - glBufferDataARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, + glGenBuffersARB(1, pb_unpack); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pb_unpack[0]); + glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, TEXSIZE * TEXSIZE * 4 * sizeof(GLubyte), NULL, GL_STREAM_DRAW); } GLubyte *pboMem = NULL; if (useUnpackBuffer) { - pboMem = (GLubyte *) glMapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, - GL_WRITE_ONLY); + pboMem = (GLubyte *) glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, + GL_WRITE_ONLY); } else { pboMem = t; @@ -275,28 +240,28 @@ bool PBOTest::testDrawPixels(void) } if (useUnpackBuffer) { - glUnmapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); } if (useUnpackBuffer) { - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, pb_unpack[0]); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pb_unpack[0]); glDrawPixels(TEXSIZE, TEXSIZE, GL_BGRA, GL_UNSIGNED_BYTE, NULL); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); } else glDrawPixels(TEXSIZE, TEXSIZE, GL_BGRA, GL_UNSIGNED_BYTE, pboMem); // Check the result if (usePackBuffer) { - glGenBuffersARB_func(1, pb_pack); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, pb_pack[0]); - glBufferDataARB_func(GL_PIXEL_PACK_BUFFER_ARB, - windowSize * windowSize * 4 * - sizeof(GL_UNSIGNED_BYTE), NULL, GL_STREAM_DRAW); + glGenBuffersARB(1, pb_pack); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pb_pack[0]); + glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, + windowSize * windowSize * 4 * + sizeof(GL_UNSIGNED_BYTE), NULL, GL_STREAM_DRAW); glReadPixels(0, 0, windowSize, windowSize, GL_BGRA, GL_UNSIGNED_BYTE, NULL); - pboPackMem = (GLubyte *) glMapBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, + pboPackMem = (GLubyte *) glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY); } else { @@ -342,13 +307,13 @@ bool PBOTest::testDrawPixels(void) if (usePackBuffer) { - glBindBuffer_func(GL_PIXEL_PACK_BUFFER_ARB, 0); - glDeleteBuffersARB_func(1, pb_pack); + glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, 0); + glDeleteBuffersARB(1, pb_pack); } if (useUnpackBuffer) { - glBindBuffer_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); - glDeleteBuffersARB_func(1, pb_unpack); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glDeleteBuffersARB(1, pb_unpack); } } @@ -368,8 +333,8 @@ bool PBOTest::testPixelMap(void) int size; int max; - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); glGetIntegerv(GL_MAX_PIXEL_MAP_TABLE, &max); @@ -379,15 +344,15 @@ bool PBOTest::testPixelMap(void) glClearColor(0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); if (useUnpackBuffer) { - glGenBuffersARB_func(1, pb_unpack); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, pb_unpack[0]); - glBufferDataARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, max * sizeof(GLushort), - NULL, GL_STREAM_DRAW); + glGenBuffersARB(1, pb_unpack); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pb_unpack[0]); + glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, max * sizeof(GLushort), + NULL, GL_STREAM_DRAW); } GLushort *pboMem = NULL; if (useUnpackBuffer) { - pboMem = (GLushort *) glMapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, - GL_WRITE_ONLY); + pboMem = (GLushort *) glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, + GL_WRITE_ONLY); } else { pboMem = (GLushort *) malloc(sizeof(GLushort) * max); @@ -396,12 +361,12 @@ bool PBOTest::testPixelMap(void) pboMem[i] = max - i - 1; if (useUnpackBuffer) { - glUnmapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB); + glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB); glPixelMapusv(GL_PIXEL_MAP_R_TO_R, max, NULL); glPixelMapusv(GL_PIXEL_MAP_G_TO_G, max, NULL); glPixelMapusv(GL_PIXEL_MAP_B_TO_B, max, NULL); glPixelMapusv(GL_PIXEL_MAP_A_TO_A, max, NULL); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); } else { glPixelMapusv(GL_PIXEL_MAP_R_TO_R, max, pboMem); @@ -421,13 +386,13 @@ bool PBOTest::testPixelMap(void) // Read back pixel map if (usePackBuffer) { - glGenBuffersARB_func(1, pb_pack); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, pb_pack[0]); - glBufferDataARB_func(GL_PIXEL_PACK_BUFFER_ARB, max * sizeof(GLushort), - NULL, GL_STREAM_DRAW); + glGenBuffersARB(1, pb_pack); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pb_pack[0]); + glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, max * sizeof(GLushort), + NULL, GL_STREAM_DRAW); glGetPixelMapusv(GL_PIXEL_MAP_R_TO_R, NULL); - pboMem = (GLushort *) glMapBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, - GL_READ_ONLY); + pboMem = (GLushort *) glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, + GL_READ_ONLY); } else { pboMem = (GLushort *) malloc(sizeof(GLushort) * max); @@ -443,17 +408,17 @@ bool PBOTest::testPixelMap(void) if (usePackBuffer) { - glUnmapBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, 0); - glDeleteBuffersARB_func(1, pb_pack); + glUnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); + glDeleteBuffersARB(1, pb_pack); } else { free(pboMem); } if (useUnpackBuffer) { - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); - glDeleteBuffersARB_func(1, pb_unpack); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glDeleteBuffersARB(1, pb_unpack); } } @@ -476,8 +441,8 @@ bool PBOTest::testBitmap(void) GLubyte *pboUnpackMem = NULL; GLfloat *pboPackMem = NULL; - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); for (usePackBuffer = 0; usePackBuffer < usePBO + 1; usePackBuffer++) { for (useUnpackBuffer = 0; useUnpackBuffer < usePBO + 1; @@ -486,12 +451,12 @@ bool PBOTest::testBitmap(void) glClear(GL_COLOR_BUFFER_BIT); if (useUnpackBuffer) { - glGenBuffersARB_func(1, pb_unpack); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, pb_unpack[0]); - glBufferDataARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, TEXSIZE * TEXSIZE, NULL, - GL_STREAM_DRAW); - pboUnpackMem = (GLubyte *) glMapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, - GL_WRITE_ONLY); + glGenBuffersARB(1, pb_unpack); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pb_unpack[0]); + glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, TEXSIZE * TEXSIZE, NULL, + GL_STREAM_DRAW); + pboUnpackMem = (GLubyte *) glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, + GL_WRITE_ONLY); } else { pboUnpackMem = bitmap; @@ -505,26 +470,26 @@ bool PBOTest::testBitmap(void) glColor4f(1.0, 1.0, 1.0, 0.0); glRasterPos2f(0.0, 0.0); if (useUnpackBuffer) { - glUnmapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB); + glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB); glBitmap(TEXSIZE, TEXSIZE, 0, 0, 0, 0, NULL); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); } else glBitmap(TEXSIZE, TEXSIZE, 0, 0, 0, 0, pboUnpackMem); // Check the result if (usePackBuffer) { - glGenBuffersARB_func(1, pb_pack); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, pb_pack[0]); - glBufferDataARB_func(GL_PIXEL_PACK_BUFFER_ARB, + glGenBuffersARB(1, pb_pack); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pb_pack[0]); + glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, windowSize * windowSize * 4 * sizeof(GLfloat), NULL, GL_STREAM_DRAW); glReadPixels(0, 0, windowSize, windowSize, GL_RGB, GL_FLOAT, NULL); pboPackMem = - (GLfloat *) glMapBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, - GL_READ_ONLY); + (GLfloat *) glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, + GL_READ_ONLY); } else { pboPackMem = buf; @@ -568,14 +533,14 @@ bool PBOTest::testBitmap(void) } } if (usePackBuffer) { - glUnmapBuffer_func(GL_PIXEL_PACK_BUFFER_ARB); - glBindBuffer_func(GL_PIXEL_PACK_BUFFER_ARB, 0); - glDeleteBuffersARB_func(1, pb_pack); + glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB); + glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, 0); + glDeleteBuffersARB(1, pb_pack); } if (useUnpackBuffer) { - glBindBuffer_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); - glDeleteBuffersARB_func(1, pb_unpack); + glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glDeleteBuffersARB(1, pb_unpack); } } } @@ -597,8 +562,8 @@ bool PBOTest::testTexImage(void) GLfloat black[3] = { 0.0, 0.0, 0.0 }; GLfloat buf[windowSize * windowSize * 3]; - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); glClearColor(0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); @@ -613,11 +578,11 @@ bool PBOTest::testTexImage(void) breakCOWTexture < useTexUnpackBuffer + 1; breakCOWTexture++) { if (useTexUnpackBuffer) { - glGenBuffersARB_func(1, unpack_pb); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, unpack_pb[0]); - glBufferDataARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, - TEXSIZE * TEXSIZE * 3 * sizeof(GLfloat), NULL, - GL_STREAM_DRAW); + glGenBuffersARB(1, unpack_pb); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, unpack_pb[0]); + glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, + TEXSIZE * TEXSIZE * 3 * sizeof(GLfloat), NULL, + GL_STREAM_DRAW); } glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, @@ -627,8 +592,8 @@ bool PBOTest::testTexImage(void) if (useTexUnpackBuffer) { pboMem = - (GLfloat *) glMapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, - GL_WRITE_ONLY); + (GLfloat *) glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, + GL_WRITE_ONLY); } else { pboMem = t1; @@ -641,10 +606,10 @@ bool PBOTest::testTexImage(void) } if (useTexUnpackBuffer) { - glUnmapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB); + glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, TEXSIZE, TEXSIZE, 0, GL_RGB, GL_FLOAT, NULL); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); } else glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, TEXSIZE, TEXSIZE, 0, @@ -652,14 +617,14 @@ bool PBOTest::testTexImage(void) if (useTexUnpackBuffer) { if (breakCOWPBO) { - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, unpack_pb[0]); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, unpack_pb[0]); pboMem = - (GLfloat *) glMapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, - GL_WRITE_ONLY); + (GLfloat *) glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, + GL_WRITE_ONLY); for (i = 0; i < TEXSIZE * TEXSIZE * 3; i++) pboMem[i] = 0.2; - glUnmapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); } } @@ -675,9 +640,9 @@ bool PBOTest::testTexImage(void) // Check PBO's content if (useTexUnpackBuffer) { - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, unpack_pb[0]); - pboMem = (GLfloat *) glMapBuffer_func(GL_PIXEL_UNPACK_BUFFER_ARB, - GL_READ_ONLY); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, unpack_pb[0]); + pboMem = (GLfloat *) glMapBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, + GL_READ_ONLY); if (breakCOWPBO) { for (i = 0; i < TEXSIZE * TEXSIZE * 3; i++) if (fabsf(pboMem[i] - 0.2) > tolerance[0]) { @@ -686,21 +651,21 @@ bool PBOTest::testTexImage(void) return false; } } - glUnmapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); } // Read texture back if (useTexPackBuffer) { - glGenBuffersARB_func(1, pack_pb); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, pack_pb[0]); - glBufferDataARB_func(GL_PIXEL_PACK_BUFFER_ARB, - TEXSIZE * TEXSIZE * 3 * sizeof(GLfloat), NULL, - GL_STREAM_DRAW); + glGenBuffersARB(1, pack_pb); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pack_pb[0]); + glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, + TEXSIZE * TEXSIZE * 3 * sizeof(GLfloat), NULL, + GL_STREAM_DRAW); glGetTexImage(GL_TEXTURE_2D, 0, GL_RGB, GL_FLOAT, NULL); - pboMem = (GLfloat *) glMapBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, - GL_READ_ONLY); + pboMem = (GLfloat *) glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, + GL_READ_ONLY); } else { glGetTexImage(GL_TEXTURE_2D, 0, GL_RGB, GL_FLOAT, t2); @@ -738,12 +703,12 @@ bool PBOTest::testTexImage(void) } if (useTexPackBuffer) { - glUnmapBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, 0); - glDeleteBuffersARB_func(1, pack_pb); + glUnmapBufferARB(GL_PIXEL_PACK_BUFFER_ARB); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); + glDeleteBuffersARB(1, pack_pb); } if (useTexUnpackBuffer) { - glDeleteBuffersARB_func(1, unpack_pb); + glDeleteBuffersARB(1, unpack_pb); } glEnable(GL_TEXTURE_2D); @@ -822,19 +787,19 @@ bool PBOTest::testTexSubImage(void) GLfloat green[3] = { 0.0, 1.0, 0.0 }; GLfloat black[3] = { 0.0, 0.0, 0.0 }; - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); for (useUnpackBuffer = 0; useUnpackBuffer < usePBO + 1; useUnpackBuffer++) { glClearColor(0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); if (useUnpackBuffer) { - glGenBuffersARB_func(1, pbs); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, pbs[0]); - glBufferDataARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, TEXSIZE * TEXSIZE * 3 * sizeof(GLfloat), - NULL, GL_STREAM_DRAW); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glGenBuffersARB(1, pbs); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pbs[0]); + glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, TEXSIZE * TEXSIZE * 3 * sizeof(GLfloat), + NULL, GL_STREAM_DRAW); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); } glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); @@ -844,9 +809,9 @@ bool PBOTest::testTexSubImage(void) GLfloat *pboMem = NULL; if (useUnpackBuffer) { - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, pbs[0]); - pboMem = (GLfloat *) glMapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, - GL_WRITE_ONLY); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, pbs[0]); + pboMem = (GLfloat *) glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, + GL_WRITE_ONLY); } else { pboMem = t; @@ -859,10 +824,10 @@ bool PBOTest::testTexSubImage(void) } if (useUnpackBuffer) { - glUnmapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB); + glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, TEXSIZE, TEXSIZE, GL_RGB, GL_FLOAT, NULL); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); } else glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, TEXSIZE, TEXSIZE, GL_RGB, @@ -931,8 +896,8 @@ bool PBOTest::testPolygonStip(void) GLfloat white[3] = { 1.0, 1.0, 1.0 }; GLfloat black[3] = { 0.0, 0.0, 0.0 }; - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); for (useUnpackBuffer = 0; useUnpackBuffer < usePBO + 1; useUnpackBuffer++) { for (usePackBuffer = 0; usePackBuffer < usePBO + 1; usePackBuffer++) { @@ -940,12 +905,12 @@ bool PBOTest::testPolygonStip(void) glClear(GL_COLOR_BUFFER_BIT); if (useUnpackBuffer) { - glGenBuffersARB_func(1, unpack_pb); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, unpack_pb[0]); - glBufferDataARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 32 * 32 / 8, NULL, - GL_STREAM_DRAW); - pboMem = (GLubyte *) glMapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, - GL_WRITE_ONLY); + glGenBuffersARB(1, unpack_pb); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, unpack_pb[0]); + glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, 32 * 32 / 8, NULL, + GL_STREAM_DRAW); + pboMem = (GLubyte *) glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, + GL_WRITE_ONLY); } else { pboMem = t1; @@ -958,7 +923,7 @@ bool PBOTest::testPolygonStip(void) } if (useUnpackBuffer) { - glUnmapBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB); + glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB); glPolygonStipple(NULL); } else { @@ -967,13 +932,13 @@ bool PBOTest::testPolygonStip(void) // Read back the stipple pattern if (usePackBuffer) { - glGenBuffersARB_func(1, pack_pb); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, pack_pb[0]); - glBufferDataARB_func(GL_PIXEL_PACK_BUFFER_ARB, 32 * 32 / 8, NULL, - GL_STREAM_DRAW); + glGenBuffersARB(1, pack_pb); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, pack_pb[0]); + glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, 32 * 32 / 8, NULL, + GL_STREAM_DRAW); glGetPolygonStipple(NULL); - pboMem = (GLubyte *) glMapBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, - GL_READ_ONLY); + pboMem = (GLubyte *) glMapBufferARB(GL_PIXEL_PACK_BUFFER_ARB, + GL_READ_ONLY); } else { glGetPolygonStipple(t2); @@ -989,12 +954,12 @@ bool PBOTest::testPolygonStip(void) if (useUnpackBuffer) { - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); - glDeleteBuffersARB_func(1, unpack_pb); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glDeleteBuffersARB(1, unpack_pb); } if (usePackBuffer) { - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, 0); - glDeleteBuffersARB_func(1, pack_pb); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); + glDeleteBuffersARB(1, pack_pb); } glEnable(GL_POLYGON_STIPPLE); @@ -1057,33 +1022,33 @@ bool PBOTest::testErrorHandling(void) { GLuint fbs[1]; - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 0); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0); if (usePBO) { /* test that glDrawPixels from too small of buffer raises error */ - glGenBuffersARB_func(1, fbs); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER, fbs[0]); - glBufferDataARB_func(GL_PIXEL_UNPACK_BUFFER_ARB, 32 * 32 * 4, NULL, - GL_STREAM_DRAW); + glGenBuffersARB(1, fbs); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, fbs[0]); + glBufferDataARB(GL_PIXEL_UNPACK_BUFFER_ARB, 32 * 32 * 4, NULL, + GL_STREAM_DRAW); glDrawPixels(32, 32 + 1, GL_BGRA, GL_UNSIGNED_BYTE, NULL); if (glGetError() != GL_INVALID_OPERATION) return false; - glDeleteBuffersARB_func(1, fbs); - glBindBufferARB_func(GL_PIXEL_UNPACK_BUFFER, 0); + glDeleteBuffersARB(1, fbs); + glBindBufferARB(GL_PIXEL_UNPACK_BUFFER, 0); /* test that glReadPixels into too small of buffer raises error */ - glGenBuffersARB_func(1, fbs); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER, fbs[0]); - glBufferDataARB_func(GL_PIXEL_PACK_BUFFER_ARB, 32 * 32 * 4, NULL, - GL_STREAM_DRAW); + glGenBuffersARB(1, fbs); + glBindBufferARB(GL_PIXEL_PACK_BUFFER, fbs[0]); + glBufferDataARB(GL_PIXEL_PACK_BUFFER_ARB, 32 * 32 * 4, NULL, + GL_STREAM_DRAW); glReadPixels(0, 0, 32, 32 + 1, GL_BGRA, GL_UNSIGNED_BYTE, NULL); if (glGetError() != GL_INVALID_OPERATION) return false; - glDeleteBuffersARB_func(1, fbs); - glBindBufferARB_func(GL_PIXEL_PACK_BUFFER, 0); + glDeleteBuffersARB(1, fbs); + glBindBufferARB(GL_PIXEL_PACK_BUFFER, 0); } return true; } diff --git a/tests/glean/tpointatten.cpp b/tests/glean/tpointatten.cpp index 0dee92295..49d9dacb7 100644 --- a/tests/glean/tpointatten.cpp +++ b/tests/glean/tpointatten.cpp @@ -44,21 +44,9 @@ namespace GLEAN { /* Clamp X to [MIN,MAX] */ #define CLAMP( X, MIN, MAX ) ( (X)<(MIN) ? (MIN) : ((X)>(MAX) ? (MAX) : (X)) ) - -static PFNGLPOINTPARAMETERFVARBPROC PointParameterfvARB = NULL; -static PFNGLPOINTPARAMETERFARBPROC PointParameterfARB = NULL; - - void PointAttenuationTest::setup(void) { - PointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC) - GLUtils::getProcAddress("glPointParameterfvARB"); - assert(PointParameterfvARB); - PointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC) - GLUtils::getProcAddress("glPointParameterfARB"); - assert(PointParameterfARB); - glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, aliasedLimits); glGetFloatv(GL_SMOOTH_POINT_SIZE_RANGE, smoothLimits); glMatrixMode(GL_PROJECTION); @@ -198,11 +186,11 @@ PointAttenuationTest::testPointRendering(GLboolean smooth) atten[1] = (b == -1) ? 0.0 : pow(10.0, -b); for (int c = -2; c < 3; c++) { atten[2] = (c == -1) ? 0.0 : pow(10.0, -c); - PointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, atten); + glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, atten); for (float min = 1.0; min < MAX_SIZE; min += 10) { - PointParameterfARB(GL_POINT_SIZE_MIN_ARB, min); + glPointParameterfARB(GL_POINT_SIZE_MIN_ARB, min); for (float max = min; max < MAX_SIZE; max += 10) { - PointParameterfARB(GL_POINT_SIZE_MAX_ARB, max); + glPointParameterfARB(GL_POINT_SIZE_MAX_ARB, max); for (float size = 1.0; size < MAX_SIZE; size += 8) { glPointSize(size); diff --git a/tests/glean/tpointsprite.cpp b/tests/glean/tpointsprite.cpp index 155b41612..774c0cb5c 100644 --- a/tests/glean/tpointsprite.cpp +++ b/tests/glean/tpointsprite.cpp @@ -50,8 +50,6 @@ namespace GLEAN { -static PFNGLPOINTPARAMETERIPROC glPointParameteri_func = NULL; - //background color static GLfloat bgColor[4] = {0.0, 0.0, 0.0, 0.0}; @@ -350,12 +348,6 @@ PointSpriteTest::runOne(MultiTestResult &r, Window &w) (void) w; have_2_0 = (strtod((const char *) glGetString(GL_VERSION), NULL) > 2.0); - if (have_2_0) { - glPointParameteri_func = (PFNGLPOINTPARAMETERIPROC) - GLUtils::getProcAddress("glPointParameteri"); - - assert(glPointParameteri_func); - } CheckDefaultState(r); @@ -399,8 +391,8 @@ PointSpriteTest::runOne(MultiTestResult &r, Window &w) for (coordOrigin = 0; coordOrigin < numOrigin; coordOrigin++) { if (have_2_0) { - glPointParameteri_func(GL_POINT_SPRITE_COORD_ORIGIN, - origin[coordOrigin]); + glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, + origin[coordOrigin]); } pointSize = 1.85; diff --git a/tests/glean/tshaderapi.cpp b/tests/glean/tshaderapi.cpp index fcd6547ff..64db5445f 100644 --- a/tests/glean/tshaderapi.cpp +++ b/tests/glean/tshaderapi.cpp @@ -39,110 +39,11 @@ namespace GLEAN { -static PFNGLATTACHSHADERPROC glAttachShader_func = NULL; -static PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation_func = NULL; -static PFNGLCOMPILESHADERPROC glCompileShader_func = NULL; -static PFNGLCREATEPROGRAMPROC glCreateProgram_func = NULL; -static PFNGLCREATESHADERPROC glCreateShader_func = NULL; -static PFNGLDELETEPROGRAMPROC glDeleteProgram_func = NULL; -static PFNGLDELETESHADERPROC glDeleteShader_func = NULL; -static PFNGLDETACHSHADERPROC glDetachShader_func = NULL; -static PFNGLDISABLEVERTEXATTRIBARRAYPROC glDisableVertexAttribArray_func = NULL; -static PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray_func = NULL; -static PFNGLGETACTIVEATTRIBPROC glGetActiveAttrib_func = NULL; -static PFNGLGETACTIVEUNIFORMPROC glGetActiveUniform_func = NULL; -static PFNGLGETATTACHEDSHADERSPROC glGetAttachedShaders_func = NULL; -static PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation_func = NULL; -static PFNGLGETPROGRAMIVPROC glGetProgramiv_func = NULL; -static PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog_func = NULL; -static PFNGLGETSHADERIVPROC glGetShaderiv_func = NULL; -static PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog_func = NULL; -static PFNGLGETSHADERSOURCEPROC glGetShaderSource_func = NULL; -static PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation_func = NULL; -static PFNGLGETUNIFORMFVPROC glGetUniformfv_func = NULL; -static PFNGLGETUNIFORMIVPROC glGetUniformiv_func = NULL; -static PFNGLLINKPROGRAMPROC glLinkProgram_func = NULL; -static PFNGLSHADERSOURCEPROC glShaderSource_func = NULL; -static PFNGLUSEPROGRAMPROC glUseProgram_func = NULL; -static PFNGLUNIFORM1FPROC glUniform1f_func = NULL; -static PFNGLUNIFORM2FPROC glUniform2f_func = NULL; -static PFNGLUNIFORM3FPROC glUniform3f_func = NULL; -static PFNGLUNIFORM4FPROC glUniform4f_func = NULL; -static PFNGLUNIFORM1IPROC glUniform1i_func = NULL; -static PFNGLUNIFORM2IPROC glUniform2i_func = NULL; -static PFNGLUNIFORM3IPROC glUniform3i_func = NULL; -static PFNGLUNIFORM4IPROC glUniform4i_func = NULL; -static PFNGLUNIFORM1FVPROC glUniform1fv_func = NULL; -static PFNGLUNIFORM2FVPROC glUniform2fv_func = NULL; -static PFNGLUNIFORM3FVPROC glUniform3fv_func = NULL; -static PFNGLUNIFORM4FVPROC glUniform4fv_func = NULL; -static PFNGLUNIFORM1IVPROC glUniform1iv_func = NULL; -static PFNGLUNIFORM2IVPROC glUniform2iv_func = NULL; -static PFNGLUNIFORM3IVPROC glUniform3iv_func = NULL; -static PFNGLUNIFORM4IVPROC glUniform4iv_func = NULL; -static PFNGLUNIFORMMATRIX2FVPROC glUniformMatrix2fv_func = NULL; -static PFNGLUNIFORMMATRIX3FVPROC glUniformMatrix3fv_func = NULL; -static PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv_func = NULL; -static PFNGLVALIDATEPROGRAMPROC glValidateProgram_func = NULL; - - ShaderAPIResult::ShaderAPIResult() { pass = false; } - -void -ShaderAPITest::get_ext_procs(void) -{ - glAttachShader_func = (PFNGLATTACHSHADERPROC) GLUtils::getProcAddress("glAttachShader"); - glBindAttribLocation_func = (PFNGLBINDATTRIBLOCATIONPROC) GLUtils::getProcAddress("glBindAttribLocation"); - glCompileShader_func = (PFNGLCOMPILESHADERPROC) GLUtils::getProcAddress("glCompileShader"); - glCreateProgram_func = (PFNGLCREATEPROGRAMPROC) GLUtils::getProcAddress("glCreateProgram"); - glCreateShader_func = (PFNGLCREATESHADERPROC) GLUtils::getProcAddress("glCreateShader"); - glDeleteProgram_func = (PFNGLDELETEPROGRAMPROC) GLUtils::getProcAddress("glDeleteProgram"); - glDeleteShader_func = (PFNGLDELETESHADERPROC) GLUtils::getProcAddress("glDeleteShader"); - glDetachShader_func = (PFNGLDETACHSHADERPROC) GLUtils::getProcAddress("glDetachShader"); - glDisableVertexAttribArray_func = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) GLUtils::getProcAddress("glDisableVertexAttribArray"); - glEnableVertexAttribArray_func = (PFNGLENABLEVERTEXATTRIBARRAYPROC) GLUtils::getProcAddress("glEnableVertexAttribArray"); - glGetActiveAttrib_func = (PFNGLGETACTIVEATTRIBPROC) GLUtils::getProcAddress("glGetActiveAttrib"); - glGetActiveUniform_func = (PFNGLGETACTIVEUNIFORMPROC) GLUtils::getProcAddress("glGetActiveUniform"); - glGetAttachedShaders_func = (PFNGLGETATTACHEDSHADERSPROC) GLUtils::getProcAddress("glGetAttachedShaders"); - glGetAttribLocation_func = (PFNGLGETATTRIBLOCATIONPROC) GLUtils::getProcAddress("glGetAttribLocation"); - glGetProgramiv_func = (PFNGLGETPROGRAMIVPROC) GLUtils::getProcAddress("glGetProgramiv"); - glGetProgramInfoLog_func = (PFNGLGETPROGRAMINFOLOGPROC) GLUtils::getProcAddress("glGetProgramInfoLog"); - glGetShaderiv_func = (PFNGLGETSHADERIVPROC) GLUtils::getProcAddress("glGetShaderiv"); - glGetShaderInfoLog_func = (PFNGLGETSHADERINFOLOGPROC) GLUtils::getProcAddress("glGetShaderInfoLog"); - glGetShaderSource_func = (PFNGLGETSHADERSOURCEPROC) GLUtils::getProcAddress("glGetShaderSource"); - glGetUniformLocation_func = (PFNGLGETUNIFORMLOCATIONPROC) GLUtils::getProcAddress("glGetUniformLocation"); - glGetUniformfv_func = (PFNGLGETUNIFORMFVPROC) GLUtils::getProcAddress("glGetUniformfv"); - glGetUniformiv_func = (PFNGLGETUNIFORMIVPROC) GLUtils::getProcAddress("glGetUniformiv"); - glLinkProgram_func = (PFNGLLINKPROGRAMPROC) GLUtils::getProcAddress("glLinkProgram"); - glShaderSource_func = (PFNGLSHADERSOURCEPROC) GLUtils::getProcAddress("glShaderSource"); - glUseProgram_func = (PFNGLUSEPROGRAMPROC) GLUtils::getProcAddress("glUseProgram"); - glUniform1f_func = (PFNGLUNIFORM1FPROC) GLUtils::getProcAddress("glUniform1f"); - glUniform2f_func = (PFNGLUNIFORM2FPROC) GLUtils::getProcAddress("glUniform2f"); - glUniform3f_func = (PFNGLUNIFORM3FPROC) GLUtils::getProcAddress("glUniform3f"); - glUniform4f_func = (PFNGLUNIFORM4FPROC) GLUtils::getProcAddress("glUniform4f"); - glUniform1i_func = (PFNGLUNIFORM1IPROC) GLUtils::getProcAddress("glUniform1i"); - glUniform2i_func = (PFNGLUNIFORM2IPROC) GLUtils::getProcAddress("glUniform2i"); - glUniform3i_func = (PFNGLUNIFORM3IPROC) GLUtils::getProcAddress("glUniform3i"); - glUniform4i_func = (PFNGLUNIFORM4IPROC) GLUtils::getProcAddress("glUniform4i"); - glUniform1fv_func = (PFNGLUNIFORM1FVPROC) GLUtils::getProcAddress("glUniform1fv"); - glUniform2fv_func = (PFNGLUNIFORM2FVPROC) GLUtils::getProcAddress("glUniform2fv"); - glUniform3fv_func = (PFNGLUNIFORM3FVPROC) GLUtils::getProcAddress("glUniform3fv"); - glUniform4fv_func = (PFNGLUNIFORM4FVPROC) GLUtils::getProcAddress("glUniform4fv"); - glUniform1iv_func = (PFNGLUNIFORM1IVPROC) GLUtils::getProcAddress("glUniform1iv"); - glUniform2iv_func = (PFNGLUNIFORM2IVPROC) GLUtils::getProcAddress("glUniform2iv"); - glUniform3iv_func = (PFNGLUNIFORM3IVPROC) GLUtils::getProcAddress("glUniform3iv"); - glUniform4iv_func = (PFNGLUNIFORM4IVPROC) GLUtils::getProcAddress("glUniform4iv"); - glUniformMatrix2fv_func = (PFNGLUNIFORMMATRIX2FVPROC) GLUtils::getProcAddress("glUniformMatrix2fv"); - glUniformMatrix3fv_func = (PFNGLUNIFORMMATRIX3FVPROC) GLUtils::getProcAddress("glUniformMatrix3fv"); - glUniformMatrix4fv_func = (PFNGLUNIFORMMATRIX4FVPROC) GLUtils::getProcAddress("glUniformMatrix4fv"); - glValidateProgram_func = (PFNGLVALIDATEPROGRAMPROC) GLUtils::getProcAddress("glValidateProgram"); -} - - void ShaderAPITest::assert_test(const char *file, int line, int cond, const char *msg) { @@ -214,16 +115,16 @@ ShaderAPITest::check_status(GLuint id, GLenum pname, void ShaderAPITest::check_compile_status(GLuint id) { - check_status(id, GL_COMPILE_STATUS, glGetShaderiv_func, - glGetShaderInfoLog_func); + check_status(id, GL_COMPILE_STATUS, glGetShaderiv, + glGetShaderInfoLog); } void ShaderAPITest::check_link_status(GLuint id) { - check_status(id, GL_LINK_STATUS, glGetProgramiv_func, - glGetProgramInfoLog_func); + check_status(id, GL_LINK_STATUS, glGetProgramiv, + glGetProgramInfoLog); } @@ -233,9 +134,9 @@ ShaderAPITest::make_shader(GLenum type, const char *src) GLuint id; assert_no_error(); - id = glCreateShader_func(type); - glShaderSource_func(id, 1, &src, NULL); - glCompileShader_func(id); + id = glCreateShader(type); + glShaderSource(id, 1, &src, NULL); + glCompileShader(id); check_compile_status(id); assert_no_error(); return id; @@ -248,21 +149,21 @@ ShaderAPITest::make_program(const char *vs_src, const char *fs_src) GLuint id, vs, fs; assert_no_error(); - id = glCreateProgram_func(); + id = glCreateProgram(); if (vs_src) { vs = make_shader(GL_VERTEX_SHADER, vs_src); - glAttachShader_func(id, vs); - glDeleteShader_func(vs); + glAttachShader(id, vs); + glDeleteShader(vs); } if (fs_src) { fs = make_shader(GL_FRAGMENT_SHADER, fs_src); - glAttachShader_func(id, fs); - glDeleteShader_func(fs); + glAttachShader(id, fs); + glDeleteShader(fs); } - glLinkProgram_func(id); + glLinkProgram(id); check_link_status(id); - glUseProgram_func(id); - glDeleteProgram_func(id); + glUseProgram(id); + glDeleteProgram(id); assert_no_error(); return id; } @@ -281,12 +182,12 @@ ShaderAPITest::test_uniform_size_type1(const char *glslType, GLenum glType, cons glslType, el); program = make_program(buffer, NULL); - glGetProgramiv_func(program, GL_ACTIVE_UNIFORMS, &active); + glGetProgramiv(program, GL_ACTIVE_UNIFORMS, &active); assert_no_error(); for (i = 0; i < active; i++) { GLint size = -1; GLenum type = 0; - glGetActiveUniform_func(program, i, sizeof(buffer), NULL, + glGetActiveUniform(program, i, sizeof(buffer), NULL, &size, &type, buffer); assert_no_error(); assert(type == glType); @@ -340,12 +241,12 @@ ShaderAPITest::test_attrib_size_type1(const char *glslType, GLenum glType, const glslType, el); program = make_program(buffer, NULL); - glGetProgramiv_func(program, GL_ACTIVE_ATTRIBUTES, &active); + glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &active); assert_no_error(); for (i = 0; i < active; i++) { GLint size = -1; GLenum type = 0; - glGetActiveAttrib_func(program, i, sizeof(buffer), NULL, + glGetActiveAttrib(program, i, sizeof(buffer), NULL, &size, &type, buffer); assert_no_error(); assert(type == glType); @@ -384,9 +285,9 @@ ShaderAPITest::test_uniform_array_overflow(void) GLfloat data[128]; program = make_program("#version 120\nuniform vec2 x[10];\nvoid main() { gl_Position.xy = x[9]; }\n", NULL); - location = glGetUniformLocation_func(program, "x"); + location = glGetUniformLocation(program, "x"); assert_no_error(); - glUniform2fv_func(location, 64, data); + glUniform2fv(location, 64, data); assert_no_error(); } @@ -399,9 +300,9 @@ ShaderAPITest::test_uniform_scalar_count(void) GLfloat data[128]; program = make_program("#version 110\nuniform vec2 x;\nvoid main() { gl_Position.xy = x; }\n", NULL); - location = glGetUniformLocation_func(program, "x"); + location = glGetUniformLocation(program, "x"); assert_no_error(); - glUniform2fv_func(location, 64, data); + glUniform2fv(location, 64, data); assert_error(GL_INVALID_OPERATION); } @@ -415,16 +316,16 @@ ShaderAPITest::test_uniform_query_matrix(void) GLint location; program = make_program("#version 110\nuniform mat3 m[2];\nvoid main() { gl_Position.xyz = m[1][2]; }\n", NULL); - location = glGetUniformLocation_func(program, "m"); + location = glGetUniformLocation(program, "m"); for (i = 0; i < 9; i++) data[i] = i; for (i = 9; i < 18; i++) data[i] = 321.0; - glUniformMatrix3fv_func(location, 1, GL_TRUE, data); + glUniformMatrix3fv(location, 1, GL_TRUE, data); for (i = 0; i < 18; i++) data[i] = 123.0; - glGetUniformfv_func(program, location, data); + glGetUniformfv(program, location, data); for (c = 0; c < 3; c++) for (r = 0; r < 3; r++) assert(data[c * 3 + r] == r * 3 + c); @@ -442,13 +343,13 @@ ShaderAPITest::test_uniform_neg_location(void) program = make_program("#version 110\nvoid main() { gl_Position = vec4(1.0, 1.0, 1.0, 1.0); }\n", NULL); (void) program; assert_no_error(); - glUniform1i_func(-1, 1); + glUniform1i(-1, 1); assert_no_error(); - glUniform1i_func(-200, 1); + glUniform1i(-200, 1); assert_error(GL_INVALID_OPERATION); - glUniformMatrix2fv_func(-1, 1, GL_FALSE, data); + glUniformMatrix2fv(-1, 1, GL_FALSE, data); assert_no_error(); - glUniformMatrix2fv_func(-200, 1, GL_FALSE, data); + glUniformMatrix2fv(-200, 1, GL_FALSE, data); assert_error(GL_INVALID_OPERATION); } @@ -462,12 +363,12 @@ ShaderAPITest::test_uniform_bool_conversion(void) assert_no_error(); program = make_program("uniform bool b;\nvoid main() { gl_Position.x = b ? 1.5 : 0.5; }\n", NULL); - location = glGetUniformLocation_func(program, "b"); + location = glGetUniformLocation(program, "b"); assert(location != -1); assert_no_error(); - glUniform1i_func(location, 5); + glUniform1i(location, 5); assert_no_error(); - glGetUniformiv_func(program, location, &value[0]); + glGetUniformiv(program, location, &value[0]); assert_no_error(); assert(value[0] == 1); } @@ -482,10 +383,10 @@ ShaderAPITest::test_uniform_multiple_samplers(void) assert_no_error(); program = make_program(NULL, "uniform sampler2D s[2];\nvoid main() { gl_FragColor = texture2D(s[1], vec2(0.0, 0.0)); }\n"); - location = glGetUniformLocation_func(program, "s[0]"); + location = glGetUniformLocation(program, "s[0]"); assert(location != -1); assert_no_error(); - glUniform1iv_func(location, 2, values); + glUniform1iv(location, 2, values); assert_no_error(); } @@ -512,8 +413,6 @@ ShaderAPITest::runOne(ShaderAPIResult &r, Window &w) // error will be set to true if any of the assert functions below fail. error = false; - get_ext_procs(); - run_tests(); r.pass = !error; diff --git a/tests/glean/tshaderapi.h b/tests/glean/tshaderapi.h index 11ccc2f41..876876a45 100644 --- a/tests/glean/tshaderapi.h +++ b/tests/glean/tshaderapi.h @@ -90,8 +90,6 @@ private: void test_uniform_bool_conversion(void); void test_uniform_multiple_samplers(void); void run_tests(void); - - void get_ext_procs(void); }; } // namespace GLEAN diff --git a/tests/glean/tstencil2.cpp b/tests/glean/tstencil2.cpp index 2d3b29478..aaf978fe7 100644 --- a/tests/glean/tstencil2.cpp +++ b/tests/glean/tstencil2.cpp @@ -46,19 +46,6 @@ namespace GLEAN { -// ATI -static PFNGLSTENCILOPSEPARATEATIPROC glStencilOpSeparateATI_func; -static PFNGLSTENCILFUNCSEPARATEATIPROC glStencilFuncSeparateATI_func; - -// EXT -static PFNGLACTIVESTENCILFACEEXTPROC glActiveStencilFaceEXT_func; - -// GL2 -static PFNGLSTENCILOPSEPARATEPROC glStencilOpSeparate_func; -static PFNGLSTENCILFUNCSEPARATEPROC glStencilFuncSeparate_func; -static PFNGLSTENCILMASKSEPARATEPROC glStencilMaskSeparate_func; - - // two-sided methods: #define ATI 1 #define EXT 2 @@ -71,33 +58,6 @@ Stencil2Result::Stencil2Result() } -void -Stencil2Test::get_ext_functions(void) -{ - if (have_ATI_separate_stencil()) { - glStencilOpSeparateATI_func = (PFNGLSTENCILOPSEPARATEATIPROC) - GLUtils::getProcAddress("glStencilOpSeparateATI"); - glStencilFuncSeparateATI_func = (PFNGLSTENCILFUNCSEPARATEATIPROC) - GLUtils::getProcAddress("glStencilFuncSeparateATI"); - } - - if (have_EXT_stencil_two_side()) { - glActiveStencilFaceEXT_func = (PFNGLACTIVESTENCILFACEEXTPROC) - GLUtils::getProcAddress("glActiveStencilFaceEXT"); - } - - // GL2 - glStencilOpSeparate_func = (PFNGLSTENCILOPSEPARATEPROC) - GLUtils::getProcAddress("glStencilOpSeparate"); - - glStencilFuncSeparate_func = (PFNGLSTENCILFUNCSEPARATEPROC) - GLUtils::getProcAddress("glStencilFuncSeparate"); - - glStencilMaskSeparate_func= (PFNGLSTENCILMASKSEPARATEPROC) - GLUtils::getProcAddress("glStencilMaskSeparate"); -} - - bool Stencil2Test::have_ATI_separate_stencil(void) const { @@ -312,17 +272,17 @@ Stencil2Test::set_stencil_state(int method, assert(frontWriteMask == backWriteMask); // set state - glStencilOpSeparateATI_func(GL_FRONT, - frontStencilFail, - frontZFail, - frontZPass); + glStencilOpSeparateATI(GL_FRONT, + frontStencilFail, + frontZFail, + frontZPass); - glStencilOpSeparateATI_func(GL_BACK, - backStencilFail, - backZFail, - backZPass); + glStencilOpSeparateATI(GL_BACK, + backStencilFail, + backZFail, + backZPass); - glStencilFuncSeparateATI_func(frontFunc, backFunc, frontRef, frontMask); + glStencilFuncSeparateATI(frontFunc, backFunc, frontRef, frontMask); glStencilMask(frontWriteMask); @@ -349,18 +309,18 @@ Stencil2Test::set_stencil_state(int method, // set state glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT); - glActiveStencilFaceEXT_func(GL_FRONT); + glActiveStencilFaceEXT(GL_FRONT); glStencilOp(frontStencilFail, frontZFail, frontZPass); glStencilFunc(frontFunc, frontRef, frontMask); glStencilMask(frontWriteMask); - glActiveStencilFaceEXT_func(GL_BACK); + glActiveStencilFaceEXT(GL_BACK); glStencilOp(backStencilFail, backZFail, backZPass); glStencilFunc(backFunc, backRef, backMask); glStencilMask(backWriteMask); // get state - glActiveStencilFaceEXT_func(GL_FRONT); + glActiveStencilFaceEXT(GL_FRONT); glGetIntegerv(GL_STENCIL_FAIL, &get_frontStencilFail); glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, &get_frontZFail); glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, &get_frontZPass); @@ -368,7 +328,7 @@ Stencil2Test::set_stencil_state(int method, glGetIntegerv(GL_STENCIL_REF, &get_frontRef); glGetIntegerv(GL_STENCIL_VALUE_MASK, &get_frontMask); glGetIntegerv(GL_STENCIL_WRITEMASK, &get_frontWriteMask); - glActiveStencilFaceEXT_func(GL_BACK); + glActiveStencilFaceEXT(GL_BACK); glGetIntegerv(GL_STENCIL_FAIL, &get_backStencilFail); glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, &get_backZFail); glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, &get_backZPass); @@ -381,18 +341,18 @@ Stencil2Test::set_stencil_state(int method, case GL2: // set state - glStencilOpSeparate_func(GL_FRONT, - frontStencilFail, - frontZFail, - frontZPass); - glStencilOpSeparate_func(GL_BACK, - backStencilFail, - backZFail, - backZPass); - glStencilFuncSeparate_func(GL_FRONT, frontFunc, frontRef, frontMask); - glStencilFuncSeparate_func(GL_BACK, backFunc, backRef, backMask); - glStencilMaskSeparate_func(GL_FRONT, frontWriteMask); - glStencilMaskSeparate_func(GL_BACK, backWriteMask); + glStencilOpSeparate(GL_FRONT, + frontStencilFail, + frontZFail, + frontZPass); + glStencilOpSeparate(GL_BACK, + backStencilFail, + backZFail, + backZPass); + glStencilFuncSeparate(GL_FRONT, frontFunc, frontRef, frontMask); + glStencilFuncSeparate(GL_BACK, backFunc, backRef, backMask); + glStencilMaskSeparate(GL_FRONT, frontWriteMask); + glStencilMaskSeparate(GL_BACK, backWriteMask); // get state glGetIntegerv(GL_STENCIL_FAIL, &get_frontStencilFail); @@ -539,7 +499,7 @@ Stencil2Test::reset_stencil_state(int method) break; case EXT: glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT); - glActiveStencilFaceEXT_func(GL_FRONT); + glActiveStencilFaceEXT(GL_FRONT); break; case GL2: break; @@ -799,8 +759,6 @@ Stencil2Test::runOne(Stencil2Result &r, Window &w) (void) w; // silence warning r.pass = true; - get_ext_functions(); - // how many stencil bits (we assume at least 8 above) glGetIntegerv(GL_STENCIL_BITS, &stencilBits); stencilMax = (1 << stencilBits) - 1; diff --git a/tests/glean/tstencil2.h b/tests/glean/tstencil2.h index cd6da7f3d..7adac3244 100644 --- a/tests/glean/tstencil2.h +++ b/tests/glean/tstencil2.h @@ -60,8 +60,6 @@ public: private: GLint stencilBits, stencilMax; - void get_ext_functions(); - bool have_ATI_separate_stencil(void) const; bool have_EXT_stencil_two_side(void) const; bool have_GL2_stencil_two_side(void) const; diff --git a/tests/glean/ttexcombine.cpp b/tests/glean/ttexcombine.cpp index 5c5234da8..1a41c4db4 100644 --- a/tests/glean/ttexcombine.cpp +++ b/tests/glean/ttexcombine.cpp @@ -994,7 +994,7 @@ TexCombineTest::TexEnv(glmachine &machine, int texUnit, GLenum target, GLenum value) { if (machine.NumTexUnits > 1) - p_glActiveTextureARB(GL_TEXTURE0_ARB + texUnit); + glActiveTextureARB(GL_TEXTURE0_ARB + texUnit); glTexEnvi(GL_TEXTURE_ENV, target, value); int err = glGetError(); @@ -1109,7 +1109,7 @@ TexCombineTest::SetupColors(glmachine &machine) { for (int u = 0; u < machine.NumTexUnits; u++) { if (machine.NumTexUnits > 1) - p_glActiveTextureARB(GL_TEXTURE0_ARB + u); + glActiveTextureARB(GL_TEXTURE0_ARB + u); glBindTexture(GL_TEXTURE_2D, mTextures[u]); glEnable(GL_TEXTURE_2D); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, @@ -1370,7 +1370,7 @@ TexCombineTest::RunMultiTextureTest(glmachine &machine, BasicResult &r, GLfloat renderedResult[4]; // use texcoord (0,0) for all vertices for (int u = 0; u < machine.NumTexUnits; u++) - p_glMultiTexCoord2fARB(GL_TEXTURE0_ARB + u, 0, 0); + glMultiTexCoord2fARB(GL_TEXTURE0_ARB + u, 0, 0); glBegin(GL_POLYGON); glVertex2f(-1.0, -1.0); glVertex2f( 1.0, -1.0); @@ -1465,7 +1465,7 @@ TexCombineTest::RunCrossbarTest(glmachine &machine, BasicResult &r, Window& w) { machine.EnvColor[unit][1] = 0.0F; machine.EnvColor[unit][2] = 0.0F; machine.EnvColor[unit][3] = 0.0F; - p_glActiveTextureARB(GL_TEXTURE0_ARB + unit); + glActiveTextureARB(GL_TEXTURE0_ARB + unit); glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, machine.EnvColor[unit]); } @@ -1490,7 +1490,7 @@ TexCombineTest::RunCrossbarTest(glmachine &machine, BasicResult &r, Window& w) { GLfloat renderedResult[4]; // texcoord (0,) for all vertices is OK for (unit = 0; unit < machine.NumTexUnits; unit++) - p_glMultiTexCoord2fARB(GL_TEXTURE0_ARB + unit, 0, 0); + glMultiTexCoord2fARB(GL_TEXTURE0_ARB + unit, 0, 0); glColor4fv(machine.FragColor); glBegin(GL_POLYGON); glVertex2f(-1.0, -1.0); @@ -1544,10 +1544,6 @@ TexCombineTest::runOne(BasicResult& r, Window& w) { // these without testing them because we already know that we // won't be invoked except on contexts that support the // extension. - p_glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) - (GLUtils::getProcAddress("glActiveTextureARB")); - p_glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC) - (GLUtils::getProcAddress("glMultiTexCoord2fARB")); // Test the availability of the DOT3 extenstion haveDot3 = GLUtils::haveExtensions("GL_EXT_texture_env_dot3"); diff --git a/tests/glean/ttexswizzle.cpp b/tests/glean/ttexswizzle.cpp index abbb93b3b..a306b59f8 100644 --- a/tests/glean/ttexswizzle.cpp +++ b/tests/glean/ttexswizzle.cpp @@ -46,10 +46,6 @@ namespace GLEAN { -static PFNGLPROGRAMSTRINGARBPROC glProgramStringARB_func = NULL; -static PFNGLBINDPROGRAMARBPROC glBindProgramARB_func = NULL; -static PFNGLGENPROGRAMSARBPROC glGenProgramsARB_func = NULL; - static const int TexSize = 16; static const GLfloat vertexData[4][4] = { @@ -326,10 +322,10 @@ TexSwizzleTest::TestSwizzlesWithProgram(void) "END\n"; GLuint prog; - glGenProgramsARB_func(1, &prog); - glBindProgramARB_func(GL_FRAGMENT_PROGRAM_ARB, prog); - glProgramStringARB_func(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(text), (const GLubyte *) text); + glGenProgramsARB(1, &prog); + glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, prog); + glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, + strlen(text), (const GLubyte *) text); assert(glGetError() == GL_NO_ERROR); @@ -346,13 +342,6 @@ TexSwizzleTest::TestSwizzlesWithProgram(void) void TexSwizzleTest::Setup(void) { - glProgramStringARB_func = (PFNGLPROGRAMSTRINGARBPROC) GLUtils::getProcAddress("glProgramStringARB"); - assert(glProgramStringARB_func); - glBindProgramARB_func = (PFNGLBINDPROGRAMARBPROC) GLUtils::getProcAddress("glBindProgramARB"); - assert(glBindProgramARB_func); - glGenProgramsARB_func = (PFNGLGENPROGRAMSARBPROC) GLUtils::getProcAddress("glGenProgramsARB"); - assert(glGenProgramsARB_func); - // setup transformation glViewport(0, 0, windowSize, windowSize); glMatrixMode(GL_MODELVIEW); diff --git a/tests/glean/ttexunits.cpp b/tests/glean/ttexunits.cpp index 62dd75019..6cdcea535 100644 --- a/tests/glean/ttexunits.cpp +++ b/tests/glean/ttexunits.cpp @@ -40,10 +40,6 @@ namespace GLEAN { -static PFNGLACTIVETEXTUREPROC glActiveTexture_func = NULL; -static PFNGLCLIENTACTIVETEXTUREPROC glClientActiveTexture_func = NULL; - - void TexUnitsTest::reportFailure(const char *msg) const { @@ -80,11 +76,6 @@ TexUnitsTest::setup(void) glGetIntegerv(GL_MAX_TEXTURE_COORDS, &maxCoordUnits); glGetIntegerv(GL_MAX_TEXTURE_UNITS, &maxUnits); - glActiveTexture_func = (PFNGLACTIVETEXTUREPROC) GLUtils::getProcAddress("glActiveTexture"); - assert(glActiveTexture_func); - glClientActiveTexture_func = (PFNGLCLIENTACTIVETEXTUREPROC) GLUtils::getProcAddress("glClientActiveTexture"); - assert(glClientActiveTexture_func); - return true; } @@ -115,7 +106,7 @@ TexUnitsTest::testActiveTexture(void) // test glActiveTexture() for (i = 0; i < maxCombinedUnits; i++) { - glActiveTexture_func(GL_TEXTURE0 + i); + glActiveTexture(GL_TEXTURE0 + i); if (glGetError()) { reportFailure("glActiveTexture(GL_TEXTURE%d) failed", i); return false; @@ -130,7 +121,7 @@ TexUnitsTest::testActiveTexture(void) } // this should fail: - glActiveTexture_func(GL_TEXTURE0 + maxCombinedUnits); + glActiveTexture(GL_TEXTURE0 + maxCombinedUnits); if (glGetError() != GL_INVALID_ENUM) { reportFailure("glActiveTexture(GL_TEXTURE%d) failed to generate an error", maxCombinedUnits); @@ -140,7 +131,7 @@ TexUnitsTest::testActiveTexture(void) // test glClientActiveTexture() for (i = 0; i < maxCoordUnits; i++) { - glClientActiveTexture_func(GL_TEXTURE0 + i); + glClientActiveTexture(GL_TEXTURE0 + i); if (glGetError()) { reportFailure("glClientActiveTexture(GL_TEXTURE%d) failed", i); return false; @@ -155,7 +146,7 @@ TexUnitsTest::testActiveTexture(void) } // this should fail: - glClientActiveTexture_func(GL_TEXTURE0 + maxCoordUnits); + glClientActiveTexture(GL_TEXTURE0 + maxCoordUnits); if (glGetError() != GL_INVALID_ENUM) { reportFailure("glClientActiveTexture(GL_TEXTURE%d) failed to generate an error", maxCoordUnits); return false; @@ -170,12 +161,12 @@ TexUnitsTest::testTextureMatrices(void) { GLint i; - glActiveTexture_func(GL_TEXTURE0); + glActiveTexture(GL_TEXTURE0); glMatrixMode(GL_TEXTURE); // set texture matrices for (i = 0; i < maxCoordUnits; i++) { - glActiveTexture_func(GL_TEXTURE0 + i); + glActiveTexture(GL_TEXTURE0 + i); // generate matrix GLfloat m[16]; @@ -188,7 +179,7 @@ TexUnitsTest::testTextureMatrices(void) // query texture matrices for (i = 0; i < maxCoordUnits; i++) { - glActiveTexture_func(GL_TEXTURE0 + i); + glActiveTexture(GL_TEXTURE0 + i); // get matrix and check it GLfloat m[16]; @@ -222,12 +213,12 @@ TexUnitsTest::testTextureCoordGen(void) { GLint i; - glActiveTexture_func(GL_TEXTURE0); + glActiveTexture(GL_TEXTURE0); glMatrixMode(GL_TEXTURE); // test texgen enable/disable for (i = 0; i < maxCombinedUnits; i++) { - glActiveTexture_func(GL_TEXTURE0 + i); + glActiveTexture(GL_TEXTURE0 + i); glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); @@ -263,7 +254,7 @@ TexUnitsTest::testTexcoordArrays(void) GLint i; for (i = 0; i < maxCoordUnits; i++) { - glClientActiveTexture_func(GL_TEXTURE0 + i); + glClientActiveTexture(GL_TEXTURE0 + i); glEnableClientState(GL_TEXTURE_COORD_ARRAY); if (glGetError()) { diff --git a/tests/glean/tvertattrib.cpp b/tests/glean/tvertattrib.cpp index d8c681d77..e18077aa6 100644 --- a/tests/glean/tvertattrib.cpp +++ b/tests/glean/tvertattrib.cpp @@ -189,8 +189,6 @@ AttribFuncNames[] = { // funcIndex = indicates which glVertexAttrib* function to use // refOut = returns the value which should now be in the attribute register // -// Yeah, calling getProcAddress every time isn't very efficient. Oh well. -// static void SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) { @@ -199,153 +197,119 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) #if defined(GL_NV_vertex_program) case 0: { - PFNGLVERTEXATTRIB1FNVPROC f = (PFNGLVERTEXATTRIB1FNVPROC) - GLUtils::getProcAddress("glVertexAttrib1fNV"); - f(index, v[0]); + glVertexAttrib1fNV(index, v[0]); COPY1(refOut, v); } break; case 1: { - PFNGLVERTEXATTRIB2FNVPROC f = (PFNGLVERTEXATTRIB2FNVPROC) - GLUtils::getProcAddress("glVertexAttrib2fNV"); - f(index, v[0], v[1]); + glVertexAttrib2fNV(index, v[0], v[1]); COPY2(refOut, v); } break; case 2: { - PFNGLVERTEXATTRIB3FNVPROC f = (PFNGLVERTEXATTRIB3FNVPROC) - GLUtils::getProcAddress("glVertexAttrib3fNV"); - f(index, v[0], v[1], v[2]); + glVertexAttrib3fNV(index, v[0], v[1], v[2]); COPY3(refOut, v); } break; case 3: { - PFNGLVERTEXATTRIB4FNVPROC f = (PFNGLVERTEXATTRIB4FNVPROC) - GLUtils::getProcAddress("glVertexAttrib4fNV"); - f(index, v[0], v[1], v[2], v[3]); + glVertexAttrib4fNV(index, v[0], v[1], v[2], v[3]); COPY4(refOut, v); } break; case 4: { - PFNGLVERTEXATTRIB1FVNVPROC f = (PFNGLVERTEXATTRIB1FVNVPROC) - GLUtils::getProcAddress("glVertexAttrib1fvNV"); - f(index, v); + glVertexAttrib1fvNV(index, v); COPY1(refOut, v); } break; case 5: { - PFNGLVERTEXATTRIB2FVNVPROC f = (PFNGLVERTEXATTRIB2FVNVPROC) - GLUtils::getProcAddress("glVertexAttrib2fvNV"); - f(index, v); + glVertexAttrib2fvNV(index, v); COPY2(refOut, v); } break; case 6: { - PFNGLVERTEXATTRIB3FVNVPROC f = (PFNGLVERTEXATTRIB3FVNVPROC) - GLUtils::getProcAddress("glVertexAttrib3fvNV"); - f(index, v); + glVertexAttrib3fvNV(index, v); COPY3(refOut, v); } break; case 7: { - PFNGLVERTEXATTRIB4FVNVPROC f = (PFNGLVERTEXATTRIB4FVNVPROC) - GLUtils::getProcAddress("glVertexAttrib4fvNV"); - f(index, v); + glVertexAttrib4fvNV(index, v); COPY4(refOut, v); } break; // ** GLdouble-valued functions case 8: { - PFNGLVERTEXATTRIB1DNVPROC f = (PFNGLVERTEXATTRIB1DNVPROC) - GLUtils::getProcAddress("glVertexAttrib1dNV"); - f(index, v[0]); + glVertexAttrib1dNV(index, v[0]); COPY1(refOut, v); } break; case 9: { - PFNGLVERTEXATTRIB2DNVPROC f = (PFNGLVERTEXATTRIB2DNVPROC) - GLUtils::getProcAddress("glVertexAttrib2dNV"); - f(index, v[0], v[1]); + glVertexAttrib2dNV(index, v[0], v[1]); COPY2(refOut, v); } break; case 10: { - PFNGLVERTEXATTRIB3DNVPROC f = (PFNGLVERTEXATTRIB3DNVPROC) - GLUtils::getProcAddress("glVertexAttrib3dNV"); - f(index, v[0], v[1], v[2]); + glVertexAttrib3dNV(index, v[0], v[1], v[2]); COPY3(refOut, v); } break; case 11: { - PFNGLVERTEXATTRIB4DNVPROC f = (PFNGLVERTEXATTRIB4DNVPROC) - GLUtils::getProcAddress("glVertexAttrib4dNV"); - f(index, v[0], v[1], v[2], v[3]); + glVertexAttrib4dNV(index, v[0], v[1], v[2], v[3]); COPY4(refOut, v); } break; case 12: { - PFNGLVERTEXATTRIB1DVNVPROC f = (PFNGLVERTEXATTRIB1DVNVPROC) - GLUtils::getProcAddress("glVertexAttrib1dvNV"); GLdouble d[1]; d[0] = v[0]; - f(index, d); + glVertexAttrib1dvNV(index, d); COPY1(refOut, v); } break; case 13: { - PFNGLVERTEXATTRIB2DVNVPROC f = (PFNGLVERTEXATTRIB2DVNVPROC) - GLUtils::getProcAddress("glVertexAttrib2dvNV"); GLdouble d[2]; d[0] = v[0]; d[1] = v[1]; - f(index, d); + glVertexAttrib2dvNV(index, d); COPY2(refOut, v); } break; case 14: { - PFNGLVERTEXATTRIB3DVNVPROC f = (PFNGLVERTEXATTRIB3DVNVPROC) - GLUtils::getProcAddress("glVertexAttrib3dvNV"); GLdouble d[3]; d[0] = v[0]; d[1] = v[1]; d[2] = v[2]; - f(index, d); + glVertexAttrib3dvNV(index, d); COPY3(refOut, v); } break; case 15: { - PFNGLVERTEXATTRIB4DVNVPROC f = (PFNGLVERTEXATTRIB4DVNVPROC) - GLUtils::getProcAddress("glVertexAttrib4dvNV"); GLdouble d[4]; d[0] = v[0]; d[1] = v[1]; d[2] = v[2]; d[3] = v[3]; - f(index, d); + glVertexAttrib4dvNV(index, d); COPY4(refOut, v); } break; // ** GLshort-valued functions case 16: { - PFNGLVERTEXATTRIB1SNVPROC f = (PFNGLVERTEXATTRIB1SNVPROC) - GLUtils::getProcAddress("glVertexAttrib1sNV"); - f(index, (GLshort) v[0]); + glVertexAttrib1sNV(index, (GLshort) v[0]); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = 0.0F; refOut[2] = 0.0F; @@ -354,9 +318,7 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 17: { - PFNGLVERTEXATTRIB2SNVPROC f = (PFNGLVERTEXATTRIB2SNVPROC) - GLUtils::getProcAddress("glVertexAttrib2sNV"); - f(index, (GLshort) v[0], (GLshort) v[1]); + glVertexAttrib2sNV(index, (GLshort) v[0], (GLshort) v[1]); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = 0.0F; @@ -365,9 +327,7 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 18: { - PFNGLVERTEXATTRIB3SNVPROC f = (PFNGLVERTEXATTRIB3SNVPROC) - GLUtils::getProcAddress("glVertexAttrib3sNV"); - f(index, (GLshort) v[0], (GLshort) v[1], (GLshort) v[2]); + glVertexAttrib3sNV(index, (GLshort) v[0], (GLshort) v[1], (GLshort) v[2]); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = (GLfloat) (GLshort) v[2]; @@ -376,9 +336,7 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 19: { - PFNGLVERTEXATTRIB4SNVPROC f = (PFNGLVERTEXATTRIB4SNVPROC) - GLUtils::getProcAddress("glVertexAttrib4sNV"); - f(index, (GLshort) v[0], (GLshort) v[1], (GLshort) v[2], (GLshort) v[3]); + glVertexAttrib4sNV(index, (GLshort) v[0], (GLshort) v[1], (GLshort) v[2], (GLshort) v[3]); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = (GLfloat) (GLshort) v[2]; @@ -387,11 +345,9 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 20: { - PFNGLVERTEXATTRIB1SVNVPROC f = (PFNGLVERTEXATTRIB1SVNVPROC) - GLUtils::getProcAddress("glVertexAttrib1svNV"); GLshort s[1]; s[0] = (GLshort) v[0]; - f(index, s); + glVertexAttrib1svNV(index, s); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = 0.0F; refOut[2] = 0.0F; @@ -400,12 +356,10 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 21: { - PFNGLVERTEXATTRIB2SVNVPROC f = (PFNGLVERTEXATTRIB2SVNVPROC) - GLUtils::getProcAddress("glVertexAttrib2svNV"); GLshort s[2]; s[0] = (GLshort) v[0]; s[1] = (GLshort) v[1]; - f(index, s); + glVertexAttrib2svNV(index, s); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = 0.0F; @@ -414,13 +368,11 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 22: { - PFNGLVERTEXATTRIB3SVNVPROC f = (PFNGLVERTEXATTRIB3SVNVPROC) - GLUtils::getProcAddress("glVertexAttrib3svNV"); GLshort s[3]; s[0] = (GLshort) v[0]; s[1] = (GLshort) v[1]; s[2] = (GLshort) v[2]; - f(index, s); + glVertexAttrib3svNV(index, s); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = (GLfloat) (GLshort) v[2]; @@ -429,14 +381,12 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 23: { - PFNGLVERTEXATTRIB4SVNVPROC f = (PFNGLVERTEXATTRIB4SVNVPROC) - GLUtils::getProcAddress("glVertexAttrib4svNV"); GLshort s[4]; s[0] = (GLshort) v[0]; s[1] = (GLshort) v[1]; s[2] = (GLshort) v[2]; s[3] = (GLshort) v[3]; - f(index, s); + glVertexAttrib4svNV(index, s); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = (GLfloat) (GLshort) v[2]; @@ -446,9 +396,7 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) // ** GLubyte-valued functions case 24: { - PFNGLVERTEXATTRIB4UBNVPROC f = (PFNGLVERTEXATTRIB4UBNVPROC) - GLUtils::getProcAddress("glVertexAttrib4ubNV"); - f(index, FLOAT_TO_UBYTE(v[0]), FLOAT_TO_UBYTE(v[1]), FLOAT_TO_UBYTE(v[2]), FLOAT_TO_UBYTE(v[3])); + glVertexAttrib4ubNV(index, FLOAT_TO_UBYTE(v[0]), FLOAT_TO_UBYTE(v[1]), FLOAT_TO_UBYTE(v[2]), FLOAT_TO_UBYTE(v[3])); refOut[0] = v[0]; refOut[1] = v[1]; refOut[2] = v[2]; @@ -457,12 +405,10 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 25: { - PFNGLVERTEXATTRIB4UBVNVPROC f = (PFNGLVERTEXATTRIB4UBVNVPROC) - GLUtils::getProcAddress("glVertexAttrib4ubvNV"); GLubyte ub[4]; for (int i = 0; i < 4; i++ ) ub[i] = FLOAT_TO_UBYTE(v[i]); - f(index, ub); + glVertexAttrib4ubvNV(index, ub); refOut[0] = v[0]; refOut[1] = v[1]; refOut[2] = v[2]; @@ -476,153 +422,119 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) // ** GLfloat-valued functions case 26: { - PFNGLVERTEXATTRIB1FARBPROC f = (PFNGLVERTEXATTRIB1FARBPROC) - GLUtils::getProcAddress("glVertexAttrib1fARB"); - f(index, v[0]); + glVertexAttrib1fARB(index, v[0]); COPY1(refOut, v); } break; case 27: { - PFNGLVERTEXATTRIB2FARBPROC f = (PFNGLVERTEXATTRIB2FARBPROC) - GLUtils::getProcAddress("glVertexAttrib2fARB"); - f(index, v[0], v[1]); + glVertexAttrib2fARB(index, v[0], v[1]); COPY2(refOut, v); } break; case 28: { - PFNGLVERTEXATTRIB3FARBPROC f = (PFNGLVERTEXATTRIB3FARBPROC) - GLUtils::getProcAddress("glVertexAttrib3fARB"); - f(index, v[0], v[1], v[2]); + glVertexAttrib3fARB(index, v[0], v[1], v[2]); COPY3(refOut, v); } break; case 29: { - PFNGLVERTEXATTRIB4FARBPROC f = (PFNGLVERTEXATTRIB4FARBPROC) - GLUtils::getProcAddress("glVertexAttrib4fARB"); - f(index, v[0], v[1], v[2], v[3]); + glVertexAttrib4fARB(index, v[0], v[1], v[2], v[3]); COPY4(refOut, v); } break; case 30: { - PFNGLVERTEXATTRIB1FVARBPROC f = (PFNGLVERTEXATTRIB1FVARBPROC) - GLUtils::getProcAddress("glVertexAttrib1fvARB"); - f(index, v); + glVertexAttrib1fvARB(index, v); COPY1(refOut, v); } break; case 31: { - PFNGLVERTEXATTRIB2FVARBPROC f = (PFNGLVERTEXATTRIB2FVARBPROC) - GLUtils::getProcAddress("glVertexAttrib2fvARB"); - f(index, v); + glVertexAttrib2fvARB(index, v); COPY2(refOut, v); } break; case 32: { - PFNGLVERTEXATTRIB3FVARBPROC f = (PFNGLVERTEXATTRIB3FVARBPROC) - GLUtils::getProcAddress("glVertexAttrib3fvARB"); - f(index, v); + glVertexAttrib3fvARB(index, v); COPY3(refOut, v); } break; case 33: { - PFNGLVERTEXATTRIB4FVARBPROC f = (PFNGLVERTEXATTRIB4FVARBPROC) - GLUtils::getProcAddress("glVertexAttrib4fvARB"); - f(index, v); + glVertexAttrib4fvARB(index, v); COPY4(refOut, v); } break; // ** GLdouble-valued functions case 34: { - PFNGLVERTEXATTRIB1DARBPROC f = (PFNGLVERTEXATTRIB1DARBPROC) - GLUtils::getProcAddress("glVertexAttrib1dARB"); - f(index, v[0]); + glVertexAttrib1dARB(index, v[0]); COPY1(refOut, v); } break; case 35: { - PFNGLVERTEXATTRIB2DARBPROC f = (PFNGLVERTEXATTRIB2DARBPROC) - GLUtils::getProcAddress("glVertexAttrib2dARB"); - f(index, v[0], v[1]); + glVertexAttrib2dARB(index, v[0], v[1]); COPY2(refOut, v); } break; case 36: { - PFNGLVERTEXATTRIB3DARBPROC f = (PFNGLVERTEXATTRIB3DARBPROC) - GLUtils::getProcAddress("glVertexAttrib3dARB"); - f(index, v[0], v[1], v[2]); + glVertexAttrib3dARB(index, v[0], v[1], v[2]); COPY3(refOut, v); } break; case 37: { - PFNGLVERTEXATTRIB4DARBPROC f = (PFNGLVERTEXATTRIB4DARBPROC) - GLUtils::getProcAddress("glVertexAttrib4dARB"); - f(index, v[0], v[1], v[2], v[3]); + glVertexAttrib4dARB(index, v[0], v[1], v[2], v[3]); COPY4(refOut, v); } break; case 38: { - PFNGLVERTEXATTRIB1DVARBPROC f = (PFNGLVERTEXATTRIB1DVARBPROC) - GLUtils::getProcAddress("glVertexAttrib1dvARB"); GLdouble d[1]; d[0] = v[0]; - f(index, d); + glVertexAttrib1dvARB(index, d); COPY1(refOut, v); } break; case 39: { - PFNGLVERTEXATTRIB2DVARBPROC f = (PFNGLVERTEXATTRIB2DVARBPROC) - GLUtils::getProcAddress("glVertexAttrib2dvARB"); GLdouble d[2]; d[0] = v[0]; d[1] = v[1]; - f(index, d); + glVertexAttrib2dvARB(index, d); COPY2(refOut, v); } break; case 40: { - PFNGLVERTEXATTRIB3DVARBPROC f = (PFNGLVERTEXATTRIB3DVARBPROC) - GLUtils::getProcAddress("glVertexAttrib3dvARB"); GLdouble d[3]; d[0] = v[0]; d[1] = v[1]; d[2] = v[2]; - f(index, d); + glVertexAttrib3dvARB(index, d); COPY3(refOut, v); } break; case 41: { - PFNGLVERTEXATTRIB4DVARBPROC f = (PFNGLVERTEXATTRIB4DVARBPROC) - GLUtils::getProcAddress("glVertexAttrib4dvARB"); GLdouble d[4]; d[0] = v[0]; d[1] = v[1]; d[2] = v[2]; d[3] = v[3]; - f(index, d); + glVertexAttrib4dvARB(index, d); COPY4(refOut, v); } break; // ** GLshort-valued functions case 42: { - PFNGLVERTEXATTRIB1SARBPROC f = (PFNGLVERTEXATTRIB1SARBPROC) - GLUtils::getProcAddress("glVertexAttrib1sARB"); - f(index, (GLshort) v[0]); + glVertexAttrib1sARB(index, (GLshort) v[0]); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = 0.0F; refOut[2] = 0.0F; @@ -631,9 +543,7 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 43: { - PFNGLVERTEXATTRIB2SARBPROC f = (PFNGLVERTEXATTRIB2SARBPROC) - GLUtils::getProcAddress("glVertexAttrib2sARB"); - f(index, (GLshort) v[0], (GLshort) v[1]); + glVertexAttrib2sARB(index, (GLshort) v[0], (GLshort) v[1]); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = 0.0F; @@ -642,9 +552,7 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 44: { - PFNGLVERTEXATTRIB3SARBPROC f = (PFNGLVERTEXATTRIB3SARBPROC) - GLUtils::getProcAddress("glVertexAttrib3sARB"); - f(index, (GLshort) v[0], (GLshort) v[1], (GLshort) v[2]); + glVertexAttrib3sARB(index, (GLshort) v[0], (GLshort) v[1], (GLshort) v[2]); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = (GLfloat) (GLshort) v[2]; @@ -653,9 +561,7 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 45: { - PFNGLVERTEXATTRIB4SARBPROC f = (PFNGLVERTEXATTRIB4SARBPROC) - GLUtils::getProcAddress("glVertexAttrib4sARB"); - f(index, (GLshort) v[0], (GLshort) v[1], (GLshort) v[2], (GLshort) v[3]); + glVertexAttrib4sARB(index, (GLshort) v[0], (GLshort) v[1], (GLshort) v[2], (GLshort) v[3]); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = (GLfloat) (GLshort) v[2]; @@ -664,11 +570,9 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 46: { - PFNGLVERTEXATTRIB1SVARBPROC f = (PFNGLVERTEXATTRIB1SVARBPROC) - GLUtils::getProcAddress("glVertexAttrib1svARB"); GLshort s[1]; s[0] = (GLshort) v[0]; - f(index, s); + glVertexAttrib1svARB(index, s); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = 0.0F; refOut[2] = 0.0F; @@ -677,12 +581,10 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 47: { - PFNGLVERTEXATTRIB2SVARBPROC f = (PFNGLVERTEXATTRIB2SVARBPROC) - GLUtils::getProcAddress("glVertexAttrib2svARB"); GLshort s[2]; s[0] = (GLshort) v[0]; s[1] = (GLshort) v[1]; - f(index, s); + glVertexAttrib2svARB(index, s); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = 0.0F; @@ -691,13 +593,11 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 48: { - PFNGLVERTEXATTRIB3SVARBPROC f = (PFNGLVERTEXATTRIB3SVARBPROC) - GLUtils::getProcAddress("glVertexAttrib3svARB"); GLshort s[3]; s[0] = (GLshort) v[0]; s[1] = (GLshort) v[1]; s[2] = (GLshort) v[2]; - f(index, s); + glVertexAttrib3svARB(index, s); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = (GLfloat) (GLshort) v[2]; @@ -706,14 +606,12 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 49: { - PFNGLVERTEXATTRIB4SVARBPROC f = (PFNGLVERTEXATTRIB4SVARBPROC) - GLUtils::getProcAddress("glVertexAttrib4svARB"); GLshort s[4]; s[0] = (GLshort) v[0]; s[1] = (GLshort) v[1]; s[2] = (GLshort) v[2]; s[3] = (GLshort) v[3]; - f(index, s); + glVertexAttrib4svARB(index, s); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = (GLfloat) (GLshort) v[2]; @@ -722,43 +620,35 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 50: { - PFNGLVERTEXATTRIB4NSVARBPROC f = (PFNGLVERTEXATTRIB4NSVARBPROC) - GLUtils::getProcAddress("glVertexAttrib4NsvARB"); GLshort s[4]; for (int i = 0; i < 4; i++) s[i] = FLOAT_TO_SHORT(v[i]); - f(index, s); + glVertexAttrib4NsvARB(index, s); COPY4(refOut, v); } break; // ** GLubyte-valued functions case 51: { - PFNGLVERTEXATTRIB4NUBARBPROC f = (PFNGLVERTEXATTRIB4NUBARBPROC) - GLUtils::getProcAddress("glVertexAttrib4NubARB"); - f(index, FLOAT_TO_UBYTE(v[0]), FLOAT_TO_UBYTE(v[1]), FLOAT_TO_UBYTE(v[2]), FLOAT_TO_UBYTE(v[3])); + glVertexAttrib4NubARB(index, FLOAT_TO_UBYTE(v[0]), FLOAT_TO_UBYTE(v[1]), FLOAT_TO_UBYTE(v[2]), FLOAT_TO_UBYTE(v[3])); COPY4(refOut, v); } break; case 52: { - PFNGLVERTEXATTRIB4NUBVARBPROC f = (PFNGLVERTEXATTRIB4NUBVARBPROC) - GLUtils::getProcAddress("glVertexAttrib4NubvARB"); GLubyte ub[4]; for (int i = 0; i < 4; i++ ) ub[i] = FLOAT_TO_UBYTE(v[i]); - f(index, ub); + glVertexAttrib4NubvARB(index, ub); COPY4(refOut, v); } break; case 53: { - PFNGLVERTEXATTRIB4UBVARBPROC f = (PFNGLVERTEXATTRIB4UBVARBPROC) - GLUtils::getProcAddress("glVertexAttrib4ubvARB"); GLubyte ub[4]; for (int i = 0; i < 4; i++ ) ub[i] = (GLubyte) v[i]; - f(index, ub); + glVertexAttrib4ubvARB(index, ub); refOut[0] = (GLfloat) (GLubyte) v[0]; refOut[1] = (GLfloat) (GLubyte) v[1]; refOut[2] = (GLfloat) (GLubyte) v[2]; @@ -768,23 +658,19 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) // ** GLbyte-valued functions case 54: { - PFNGLVERTEXATTRIB4NBVARBPROC f = (PFNGLVERTEXATTRIB4NBVARBPROC) - GLUtils::getProcAddress("glVertexAttrib4NbvARB"); GLbyte b[4]; for (int i = 0; i < 4; i++ ) b[i] = FLOAT_TO_BYTE(v[i]); - f(index, b); + glVertexAttrib4NbvARB(index, b); COPY4(refOut, v); } break; case 55: { - PFNGLVERTEXATTRIB4BVARBPROC f = (PFNGLVERTEXATTRIB4BVARBPROC) - GLUtils::getProcAddress("glVertexAttrib4bvARB"); GLbyte b[4]; for (int i = 0; i < 4; i++ ) b[i] = (GLbyte) v[i]; - f(index, b); + glVertexAttrib4bvARB(index, b); refOut[0] = (GLfloat) (GLbyte) v[0]; refOut[1] = (GLfloat) (GLbyte) v[1]; refOut[2] = (GLfloat) (GLbyte) v[2]; @@ -794,23 +680,19 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) // ** GLint-valued functions case 56: { - PFNGLVERTEXATTRIB4NIVARBPROC f = (PFNGLVERTEXATTRIB4NIVARBPROC) - GLUtils::getProcAddress("glVertexAttrib4NivARB"); GLint iv[4]; for (int i = 0; i < 4; i++ ) iv[i] = FLOAT_TO_INT(v[i]); - f(index, iv); + glVertexAttrib4NivARB(index, iv); COPY4(refOut, v); } break; case 57: { - PFNGLVERTEXATTRIB4IVARBPROC f = (PFNGLVERTEXATTRIB4IVARBPROC) - GLUtils::getProcAddress("glVertexAttrib4ivARB"); GLint iv[4]; for (int i = 0; i < 4; i++ ) iv[i] = (GLint) v[i]; - f(index, iv); + glVertexAttrib4ivARB(index, iv); refOut[0] = (GLfloat) (GLint) v[0]; refOut[1] = (GLfloat) (GLint) v[1]; refOut[2] = (GLfloat) (GLint) v[2]; @@ -820,23 +702,19 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) // ** GLuint-valued functions case 58: { - PFNGLVERTEXATTRIB4NUIVARBPROC f = (PFNGLVERTEXATTRIB4NUIVARBPROC) - GLUtils::getProcAddress("glVertexAttrib4NuivARB"); GLuint ui[4]; for (int i = 0; i < 4; i++ ) ui[i] = FLOAT_TO_UINT(v[i]); - f(index, ui); + glVertexAttrib4NuivARB(index, ui); COPY4(refOut, v); } break; case 59: { - PFNGLVERTEXATTRIB4UIVARBPROC f = (PFNGLVERTEXATTRIB4UIVARBPROC) - GLUtils::getProcAddress("glVertexAttrib4uivARB"); GLuint ui[4]; for (int i = 0; i < 4; i++ ) ui[i] = (GLint) v[i]; - f(index, ui); + glVertexAttrib4uivARB(index, ui); refOut[0] = (GLfloat) (GLint) v[0]; refOut[1] = (GLfloat) (GLint) v[1]; refOut[2] = (GLfloat) (GLint) v[2]; @@ -846,23 +724,19 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) // ** GLushort-valued functions case 60: { - PFNGLVERTEXATTRIB4NUSVARBPROC f = (PFNGLVERTEXATTRIB4NUSVARBPROC) - GLUtils::getProcAddress("glVertexAttrib4NusvARB"); GLushort us[4]; for (int i = 0; i < 4; i++ ) us[i] = FLOAT_TO_USHORT(v[i]); - f(index, us); + glVertexAttrib4NusvARB(index, us); COPY4(refOut, v); } break; case 61: { - PFNGLVERTEXATTRIB4USVARBPROC f = (PFNGLVERTEXATTRIB4USVARBPROC) - GLUtils::getProcAddress("glVertexAttrib4usvARB"); GLushort us[4]; for (int i = 0; i < 4; i++ ) us[i] = (GLint) v[i]; - f(index, us); + glVertexAttrib4usvARB(index, us); refOut[0] = (GLfloat) (GLint) v[0]; refOut[1] = (GLfloat) (GLint) v[1]; refOut[2] = (GLfloat) (GLint) v[2]; @@ -874,153 +748,119 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) #if defined(GL_VERSION_2_0) case 62: { - PFNGLVERTEXATTRIB1FPROC f = (PFNGLVERTEXATTRIB1FPROC) - GLUtils::getProcAddress("glVertexAttrib1f"); - f(index, v[0]); + glVertexAttrib1f(index, v[0]); COPY1(refOut, v); } break; case 63: { - PFNGLVERTEXATTRIB2FPROC f = (PFNGLVERTEXATTRIB2FPROC) - GLUtils::getProcAddress("glVertexAttrib2f"); - f(index, v[0], v[1]); + glVertexAttrib2f(index, v[0], v[1]); COPY2(refOut, v); } break; case 64: { - PFNGLVERTEXATTRIB3FPROC f = (PFNGLVERTEXATTRIB3FPROC) - GLUtils::getProcAddress("glVertexAttrib3f"); - f(index, v[0], v[1], v[2]); + glVertexAttrib3f(index, v[0], v[1], v[2]); COPY3(refOut, v); } break; case 65: { - PFNGLVERTEXATTRIB4FPROC f = (PFNGLVERTEXATTRIB4FPROC) - GLUtils::getProcAddress("glVertexAttrib4f"); - f(index, v[0], v[1], v[2], v[3]); + glVertexAttrib4f(index, v[0], v[1], v[2], v[3]); COPY4(refOut, v); } break; case 66: { - PFNGLVERTEXATTRIB1FVPROC f = (PFNGLVERTEXATTRIB1FVPROC) - GLUtils::getProcAddress("glVertexAttrib1fv"); - f(index, v); + glVertexAttrib1fv(index, v); COPY1(refOut, v); } break; case 67: { - PFNGLVERTEXATTRIB2FVPROC f = (PFNGLVERTEXATTRIB2FVPROC) - GLUtils::getProcAddress("glVertexAttrib2fv"); - f(index, v); + glVertexAttrib2fv(index, v); COPY2(refOut, v); } break; case 68: { - PFNGLVERTEXATTRIB3FVPROC f = (PFNGLVERTEXATTRIB3FVPROC) - GLUtils::getProcAddress("glVertexAttrib3fv"); - f(index, v); + glVertexAttrib3fv(index, v); COPY3(refOut, v); } break; case 69: { - PFNGLVERTEXATTRIB4FVPROC f = (PFNGLVERTEXATTRIB4FVPROC) - GLUtils::getProcAddress("glVertexAttrib4fv"); - f(index, v); + glVertexAttrib4fv(index, v); COPY4(refOut, v); } break; // ** GLdouble-valued functions case 70: { - PFNGLVERTEXATTRIB1DPROC f = (PFNGLVERTEXATTRIB1DPROC) - GLUtils::getProcAddress("glVertexAttrib1d"); - f(index, v[0]); + glVertexAttrib1d(index, v[0]); COPY1(refOut, v); } break; case 71: { - PFNGLVERTEXATTRIB2DPROC f = (PFNGLVERTEXATTRIB2DPROC) - GLUtils::getProcAddress("glVertexAttrib2d"); - f(index, v[0], v[1]); + glVertexAttrib2d(index, v[0], v[1]); COPY2(refOut, v); } break; case 72: { - PFNGLVERTEXATTRIB3DPROC f = (PFNGLVERTEXATTRIB3DPROC) - GLUtils::getProcAddress("glVertexAttrib3d"); - f(index, v[0], v[1], v[2]); + glVertexAttrib3d(index, v[0], v[1], v[2]); COPY3(refOut, v); } break; case 73: { - PFNGLVERTEXATTRIB4DPROC f = (PFNGLVERTEXATTRIB4DPROC) - GLUtils::getProcAddress("glVertexAttrib4d"); - f(index, v[0], v[1], v[2], v[3]); + glVertexAttrib4d(index, v[0], v[1], v[2], v[3]); COPY4(refOut, v); } break; case 74: { - PFNGLVERTEXATTRIB1DVPROC f = (PFNGLVERTEXATTRIB1DVPROC) - GLUtils::getProcAddress("glVertexAttrib1dv"); GLdouble d[1]; d[0] = v[0]; - f(index, d); + glVertexAttrib1dv(index, d); COPY1(refOut, v); } break; case 75: { - PFNGLVERTEXATTRIB2DVPROC f = (PFNGLVERTEXATTRIB2DVPROC) - GLUtils::getProcAddress("glVertexAttrib2dv"); GLdouble d[2]; d[0] = v[0]; d[1] = v[1]; - f(index, d); + glVertexAttrib2dv(index, d); COPY2(refOut, v); } break; case 76: { - PFNGLVERTEXATTRIB3DVPROC f = (PFNGLVERTEXATTRIB3DVPROC) - GLUtils::getProcAddress("glVertexAttrib3dv"); GLdouble d[3]; d[0] = v[0]; d[1] = v[1]; d[2] = v[2]; - f(index, d); + glVertexAttrib3dv(index, d); COPY3(refOut, v); } break; case 77: { - PFNGLVERTEXATTRIB4DVPROC f = (PFNGLVERTEXATTRIB4DVPROC) - GLUtils::getProcAddress("glVertexAttrib4dv"); GLdouble d[4]; d[0] = v[0]; d[1] = v[1]; d[2] = v[2]; d[3] = v[3]; - f(index, d); + glVertexAttrib4dv(index, d); COPY4(refOut, v); } break; // ** GLshort-valued functions case 78: { - PFNGLVERTEXATTRIB1SPROC f = (PFNGLVERTEXATTRIB1SPROC) - GLUtils::getProcAddress("glVertexAttrib1s"); - f(index, (GLshort) v[0]); + glVertexAttrib1s(index, (GLshort) v[0]); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = 0.0F; refOut[2] = 0.0F; @@ -1029,9 +869,7 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 79: { - PFNGLVERTEXATTRIB2SPROC f = (PFNGLVERTEXATTRIB2SPROC) - GLUtils::getProcAddress("glVertexAttrib2s"); - f(index, (GLshort) v[0], (GLshort) v[1]); + glVertexAttrib2s(index, (GLshort) v[0], (GLshort) v[1]); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = 0.0F; @@ -1040,9 +878,7 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 80: { - PFNGLVERTEXATTRIB3SPROC f = (PFNGLVERTEXATTRIB3SPROC) - GLUtils::getProcAddress("glVertexAttrib3s"); - f(index, (GLshort) v[0], (GLshort) v[1], (GLshort) v[2]); + glVertexAttrib3s(index, (GLshort) v[0], (GLshort) v[1], (GLshort) v[2]); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = (GLfloat) (GLshort) v[2]; @@ -1051,9 +887,7 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 81: { - PFNGLVERTEXATTRIB4SPROC f = (PFNGLVERTEXATTRIB4SPROC) - GLUtils::getProcAddress("glVertexAttrib4s"); - f(index, (GLshort) v[0], (GLshort) v[1], (GLshort) v[2], (GLshort) v[3]); + glVertexAttrib4s(index, (GLshort) v[0], (GLshort) v[1], (GLshort) v[2], (GLshort) v[3]); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = (GLfloat) (GLshort) v[2]; @@ -1062,11 +896,9 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 82: { - PFNGLVERTEXATTRIB1SVPROC f = (PFNGLVERTEXATTRIB1SVPROC) - GLUtils::getProcAddress("glVertexAttrib1sv"); GLshort s[1]; s[0] = (GLshort) v[0]; - f(index, s); + glVertexAttrib1sv(index, s); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = 0.0F; refOut[2] = 0.0F; @@ -1075,12 +907,10 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 83: { - PFNGLVERTEXATTRIB2SVPROC f = (PFNGLVERTEXATTRIB2SVPROC) - GLUtils::getProcAddress("glVertexAttrib2sv"); GLshort s[2]; s[0] = (GLshort) v[0]; s[1] = (GLshort) v[1]; - f(index, s); + glVertexAttrib2sv(index, s); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = 0.0F; @@ -1089,13 +919,11 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 84: { - PFNGLVERTEXATTRIB3SVPROC f = (PFNGLVERTEXATTRIB3SVPROC) - GLUtils::getProcAddress("glVertexAttrib3sv"); GLshort s[3]; s[0] = (GLshort) v[0]; s[1] = (GLshort) v[1]; s[2] = (GLshort) v[2]; - f(index, s); + glVertexAttrib3sv(index, s); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = (GLfloat) (GLshort) v[2]; @@ -1104,14 +932,12 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 85: { - PFNGLVERTEXATTRIB4SVPROC f = (PFNGLVERTEXATTRIB4SVPROC) - GLUtils::getProcAddress("glVertexAttrib4sv"); GLshort s[4]; s[0] = (GLshort) v[0]; s[1] = (GLshort) v[1]; s[2] = (GLshort) v[2]; s[3] = (GLshort) v[3]; - f(index, s); + glVertexAttrib4sv(index, s); refOut[0] = (GLfloat) (GLshort) v[0]; refOut[1] = (GLfloat) (GLshort) v[1]; refOut[2] = (GLfloat) (GLshort) v[2]; @@ -1120,43 +946,35 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) break; case 86: { - PFNGLVERTEXATTRIB4NSVPROC f = (PFNGLVERTEXATTRIB4NSVPROC) - GLUtils::getProcAddress("glVertexAttrib4Nsv"); GLshort s[4]; for (int i = 0; i < 4; i++) s[i] = FLOAT_TO_SHORT(v[i]); - f(index, s); + glVertexAttrib4Nsv(index, s); COPY4(refOut, v); } break; // ** GLubyte-valued functions case 87: { - PFNGLVERTEXATTRIB4NUBPROC f = (PFNGLVERTEXATTRIB4NUBPROC) - GLUtils::getProcAddress("glVertexAttrib4Nub"); - f(index, FLOAT_TO_UBYTE(v[0]), FLOAT_TO_UBYTE(v[1]), FLOAT_TO_UBYTE(v[2]), FLOAT_TO_UBYTE(v[3])); + glVertexAttrib4Nub(index, FLOAT_TO_UBYTE(v[0]), FLOAT_TO_UBYTE(v[1]), FLOAT_TO_UBYTE(v[2]), FLOAT_TO_UBYTE(v[3])); COPY4(refOut, v); } break; case 88: { - PFNGLVERTEXATTRIB4NUBVPROC f = (PFNGLVERTEXATTRIB4NUBVPROC) - GLUtils::getProcAddress("glVertexAttrib4Nubv"); GLubyte ub[4]; for (int i = 0; i < 4; i++ ) ub[i] = FLOAT_TO_UBYTE(v[i]); - f(index, ub); + glVertexAttrib4Nubv(index, ub); COPY4(refOut, v); } break; case 89: { - PFNGLVERTEXATTRIB4UBVPROC f = (PFNGLVERTEXATTRIB4UBVPROC) - GLUtils::getProcAddress("glVertexAttrib4ubv"); GLubyte ub[4]; for (int i = 0; i < 4; i++ ) ub[i] = (GLubyte) v[i]; - f(index, ub); + glVertexAttrib4ubv(index, ub); refOut[0] = (GLfloat) (GLubyte) v[0]; refOut[1] = (GLfloat) (GLubyte) v[1]; refOut[2] = (GLfloat) (GLubyte) v[2]; @@ -1166,23 +984,19 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) // ** GLbyte-valued functions case 90: { - PFNGLVERTEXATTRIB4NBVPROC f = (PFNGLVERTEXATTRIB4NBVPROC) - GLUtils::getProcAddress("glVertexAttrib4Nbv"); GLbyte b[4]; for (int i = 0; i < 4; i++ ) b[i] = FLOAT_TO_BYTE(v[i]); - f(index, b); + glVertexAttrib4Nbv(index, b); COPY4(refOut, v); } break; case 91: { - PFNGLVERTEXATTRIB4BVPROC f = (PFNGLVERTEXATTRIB4BVPROC) - GLUtils::getProcAddress("glVertexAttrib4bv"); GLbyte b[4]; for (int i = 0; i < 4; i++ ) b[i] = (GLbyte) v[i]; - f(index, b); + glVertexAttrib4bv(index, b); refOut[0] = (GLfloat) (GLbyte) v[0]; refOut[1] = (GLfloat) (GLbyte) v[1]; refOut[2] = (GLfloat) (GLbyte) v[2]; @@ -1192,23 +1006,19 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) // ** GLint-valued functions case 92: { - PFNGLVERTEXATTRIB4NIVPROC f = (PFNGLVERTEXATTRIB4NIVPROC) - GLUtils::getProcAddress("glVertexAttrib4Niv"); GLint iv[4]; for (int i = 0; i < 4; i++ ) iv[i] = FLOAT_TO_INT(v[i]); - f(index, iv); + glVertexAttrib4Niv(index, iv); COPY4(refOut, v); } break; case 93: { - PFNGLVERTEXATTRIB4IVPROC f = (PFNGLVERTEXATTRIB4IVPROC) - GLUtils::getProcAddress("glVertexAttrib4iv"); GLint iv[4]; for (int i = 0; i < 4; i++ ) iv[i] = (GLint) v[i]; - f(index, iv); + glVertexAttrib4iv(index, iv); refOut[0] = (GLfloat) (GLint) v[0]; refOut[1] = (GLfloat) (GLint) v[1]; refOut[2] = (GLfloat) (GLint) v[2]; @@ -1218,23 +1028,19 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) // ** GLuint-valued functions case 94: { - PFNGLVERTEXATTRIB4NUIVPROC f = (PFNGLVERTEXATTRIB4NUIVPROC) - GLUtils::getProcAddress("glVertexAttrib4Nuiv"); GLuint ui[4]; for (int i = 0; i < 4; i++ ) ui[i] = FLOAT_TO_UINT(v[i]); - f(index, ui); + glVertexAttrib4Nuiv(index, ui); COPY4(refOut, v); } break; case 95: { - PFNGLVERTEXATTRIB4UIVPROC f = (PFNGLVERTEXATTRIB4UIVPROC) - GLUtils::getProcAddress("glVertexAttrib4uiv"); GLuint ui[4]; for (int i = 0; i < 4; i++ ) ui[i] = (GLint) v[i]; - f(index, ui); + glVertexAttrib4uiv(index, ui); refOut[0] = (GLfloat) (GLint) v[0]; refOut[1] = (GLfloat) (GLint) v[1]; refOut[2] = (GLfloat) (GLint) v[2]; @@ -1244,23 +1050,19 @@ SetAttrib(GLuint index, const GLfloat v[4], GLuint funcIndex, GLfloat refOut[4]) // ** GLushort-valued functions case 96: { - PFNGLVERTEXATTRIB4NUSVPROC f = (PFNGLVERTEXATTRIB4NUSVPROC) - GLUtils::getProcAddress("glVertexAttrib4Nusv"); GLushort us[4]; for (int i = 0; i < 4; i++ ) us[i] = FLOAT_TO_USHORT(v[i]); - f(index, us); + glVertexAttrib4Nusv(index, us); COPY4(refOut, v); } break; case 97: { - PFNGLVERTEXATTRIB4USVPROC f = (PFNGLVERTEXATTRIB4USVPROC) - GLUtils::getProcAddress("glVertexAttrib4usv"); GLushort us[4]; for (int i = 0; i < 4; i++ ) us[i] = (GLint) v[i]; - f(index, us); + glVertexAttrib4usv(index, us); refOut[0] = (GLfloat) (GLint) v[0]; refOut[1] = (GLfloat) (GLint) v[1]; refOut[2] = (GLfloat) (GLint) v[2]; @@ -1317,7 +1119,6 @@ void VertAttribTest::FailMessage(VertAttribResult &r, const char *msg, bool VertAttribTest::TestAttribs(VertAttribResult &r, int attribFunc, - PFNGLGETVERTEXATTRIBFVARBPROC getAttribfv, Aliasing aliasing, int numAttribs) { @@ -1361,7 +1162,7 @@ VertAttribTest::TestAttribs(VertAttribResult &r, for (int i = 1; i < numAttribs; i++) { const GLfloat *expected = refOut[i]; GLfloat v[4]; - getAttribfv(i, GL_CURRENT_VERTEX_ATTRIB_ARB, v); + glGetVertexAttribfvNV(i, GL_CURRENT_VERTEX_ATTRIB_ARB, v); if (!NearlyEqual(v, expected)) { char msg[1000]; sprintf(msg, "Vertex Attribute %d is (%g, %g, %g, %g) but expected (%g, %g, %g, %g)", @@ -1421,18 +1222,14 @@ VertAttribTest::TestNVfuncs(VertAttribResult &r) { bool result = true; #ifdef GL_NV_vertex_program - PFNGLGETVERTEXATTRIBFVNVPROC getAttribfv; const GLint numAttribs = 16; const Aliasing aliasing = REQUIRED; - getAttribfv = (PFNGLGETVERTEXATTRIBFVNVPROC) GLUtils::getProcAddress("glGetVertexAttribfvNV"); - assert(getAttribfv); - r.numNVtested = 0; for (int attribFunc = 0; attribFunc < NUM_NV_ATTRIB_FUNCS; attribFunc++) { bool b; - b = TestAttribs(r, attribFunc, getAttribfv, aliasing, numAttribs); + b = TestAttribs(r, attribFunc, aliasing, numAttribs); if (!b) result = false; r.numNVtested++; @@ -1451,12 +1248,8 @@ VertAttribTest::TestARBfuncs(VertAttribResult &r, bool shader) { bool result = true; #if defined(GL_ARB_vertex_program) || defined(GL_ARB_vertex_shader) - PFNGLGETVERTEXATTRIBFVARBPROC getAttribfv; GLint numAttribs; - getAttribfv = (PFNGLGETVERTEXATTRIBFVARBPROC) GLUtils::getProcAddress("glGetVertexAttribfvARB"); - assert(getAttribfv); - glGetIntegerv(GL_MAX_VERTEX_ATTRIBS_ARB, &numAttribs); assert(numAttribs > 0); @@ -1468,7 +1261,7 @@ VertAttribTest::TestARBfuncs(VertAttribResult &r, bool shader) for (int i = 0; i < NUM_ARB_ATTRIB_FUNCS; i++) { int attribFunc = NUM_NV_ATTRIB_FUNCS + i; bool b; - b = TestAttribs(r, attribFunc, getAttribfv, aliasing, numAttribs); + b = TestAttribs(r, attribFunc, aliasing, numAttribs); if (!b) result = false; r.numARBtested++; @@ -1495,7 +1288,7 @@ VertAttribTest::TestARBfuncs(VertAttribResult &r, bool shader) for (int i = 0; i < NUM_ARB_ATTRIB_FUNCS; i++) { int attribFunc = NUM_NV_ATTRIB_FUNCS + i; bool b; - b = TestAttribs(r, attribFunc, getAttribfv, aliasing, numAttribs); + b = TestAttribs(r, attribFunc, aliasing, numAttribs); if (!b) result = false; r.numARBtested++; @@ -1515,13 +1308,9 @@ VertAttribTest::Test20funcs(VertAttribResult &r) { bool result = true; #ifdef GL_VERSION_2_0 - PFNGLGETVERTEXATTRIBFVPROC getAttribfv; GLint numAttribs; const Aliasing aliasing = DISALLOWED; - getAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) GLUtils::getProcAddress("glGetVertexAttribfv"); - assert(getAttribfv); - glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &numAttribs); assert(numAttribs > 0); @@ -1530,7 +1319,7 @@ VertAttribTest::Test20funcs(VertAttribResult &r) for (int i = 0; i < NUM_2_0_ATTRIB_FUNCS; i++) { int attribFunc = NUM_NV_ATTRIB_FUNCS + NUM_ARB_ATTRIB_FUNCS+ i; bool b; - b = TestAttribs(r, attribFunc, getAttribfv, aliasing, numAttribs); + b = TestAttribs(r, attribFunc, aliasing, numAttribs); if (!b) result = false; r.num20tested++; diff --git a/tests/glean/tvertattrib.h b/tests/glean/tvertattrib.h index 1eb4b6ebb..ba6964001 100644 --- a/tests/glean/tvertattrib.h +++ b/tests/glean/tvertattrib.h @@ -83,7 +83,6 @@ private: const char *ext, int dlistMode) const; bool TestAttribs(VertAttribResult &r, int attribFunc, - PFNGLGETVERTEXATTRIBFVARBPROC getAttribfv, Aliasing aliasing, int numAttribs); bool TestNVfuncs(VertAttribResult &r); diff --git a/tests/glean/tvertprog1.cpp b/tests/glean/tvertprog1.cpp index 4d3cccc4a..68ad828ca 100644 --- a/tests/glean/tvertprog1.cpp +++ b/tests/glean/tvertprog1.cpp @@ -41,14 +41,6 @@ namespace GLEAN { - -static PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB_func; -static PFNGLGENPROGRAMSARBPROC glGenProgramsARB_func; -static PFNGLPROGRAMSTRINGARBPROC glProgramStringARB_func; -static PFNGLBINDPROGRAMARBPROC glBindProgramARB_func; -static PFNGLISPROGRAMARBPROC glIsProgramARB_func; -static PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB_func; - static GLuint progID; @@ -810,35 +802,16 @@ VertexProgramTest::setup(void) InfNan[0], InfNan[1], InfNan[2], InfNan[3]); */ - // get function pointers - glProgramLocalParameter4fvARB_func = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) GLUtils::getProcAddress("glProgramLocalParameter4fvARB"); - assert(glProgramLocalParameter4fvARB_func); - - glGenProgramsARB_func = (PFNGLGENPROGRAMSARBPROC) GLUtils::getProcAddress("glGenProgramsARB"); - assert(glGenProgramsARB_func); - - glProgramStringARB_func = (PFNGLPROGRAMSTRINGARBPROC) GLUtils::getProcAddress("glProgramStringARB"); - assert(glProgramStringARB_func); - - glBindProgramARB_func = (PFNGLBINDPROGRAMARBPROC) GLUtils::getProcAddress("glBindProgramARB"); - assert(glBindProgramARB_func); - - glIsProgramARB_func = (PFNGLISPROGRAMARBPROC) GLUtils::getProcAddress("glIsProgramARB"); - assert(glIsProgramARB_func); - - glDeleteProgramsARB_func = (PFNGLDELETEPROGRAMSARBPROC) GLUtils::getProcAddress("glDeleteProgramsARB"); - assert(glDeleteProgramsARB_func); - - glGenProgramsARB_func(1, &progID); - glBindProgramARB_func(GL_VERTEX_PROGRAM_ARB, progID); + glGenProgramsARB(1, &progID); + glBindProgramARB(GL_VERTEX_PROGRAM_ARB, progID); glEnable(GL_VERTEX_PROGRAM_ARB); // load program inputs glColor4fv(VertColor); - glProgramLocalParameter4fvARB_func(GL_VERTEX_PROGRAM_ARB, 0, Param0); - glProgramLocalParameter4fvARB_func(GL_VERTEX_PROGRAM_ARB, 1, Param1); - glProgramLocalParameter4fvARB_func(GL_VERTEX_PROGRAM_ARB, 2, Param2); - glProgramLocalParameter4fvARB_func(GL_VERTEX_PROGRAM_ARB, 9, InfNan); + glProgramLocalParameter4fvARB(GL_VERTEX_PROGRAM_ARB, 0, Param0); + glProgramLocalParameter4fvARB(GL_VERTEX_PROGRAM_ARB, 1, Param1); + glProgramLocalParameter4fvARB(GL_VERTEX_PROGRAM_ARB, 2, Param2); + glProgramLocalParameter4fvARB(GL_VERTEX_PROGRAM_ARB, 9, InfNan); // other GL state glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, Ambient); @@ -952,10 +925,10 @@ VertexProgramTest::testProgram(const VertexProgram &p) { const GLfloat r = 0.25; - glProgramStringARB_func(GL_VERTEX_PROGRAM_ARB, - GL_PROGRAM_FORMAT_ASCII_ARB, - strlen(p.progString), - (const GLubyte *) p.progString); + glProgramStringARB(GL_VERTEX_PROGRAM_ARB, + GL_PROGRAM_FORMAT_ASCII_ARB, + strlen(p.progString), + (const GLubyte *) p.progString); GLenum err = glGetError(); if (err) { @@ -1027,7 +1000,7 @@ VertexProgramTest::testBadProgram(MultiTestResult &result) "NOTANOPCODE;\n" "MOV result.position, vertex.position;\n"; - glProgramStringARB_func(GL_VERTEX_PROGRAM_ARB, + glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(badprog), (const GLubyte *) badprog); @@ -1052,7 +1025,7 @@ VertexProgramTest::testBadProgram(MultiTestResult &result) * with an invalid (non-existant in this case) program. */ { - glBindProgramARB_func(GL_VERTEX_PROGRAM_ARB, 99); + glBindProgramARB(GL_VERTEX_PROGRAM_ARB, 99); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glBegin(GL_POLYGON); |