Ticket #1197: ogl_drop_shader_extensions.patch

File ogl_drop_shader_extensions.patch, 24.1 KB (added by Emils Solmanis, 12 years ago)
  • source/graphics/ShaderProgram.cpp

    From a2a95628ef8923d9f109dfc5f33f10f728cd6b70 Mon Sep 17 00:00:00 2001
    From: emilssolmanis <emils.solmanis@gmail.com>
    Date: Sat, 11 Aug 2012 20:30:08 +0300
    Subject: [PATCH] removed GLSL support for OGL < 2.0
    
    ---
     source/graphics/ShaderProgram.cpp           |  54 ++++-----
     source/lib/external_libraries/glext_funcs.h | 181 ++++++++++++++--------------
     source/renderer/Renderer.cpp                |   8 +-
     3 files changed, 121 insertions(+), 122 deletions(-)
    
    diff --git a/source/graphics/ShaderProgram.cpp b/source/graphics/ShaderProgram.cpp
    index 546c2ee..b8e72e4 100644
    a b public:  
    270270        m_VertexAttribs(vertexAttribs)
    271271    {
    272272        m_Program = 0;
    273         m_VertexShader = pglCreateShaderObjectARB(GL_VERTEX_SHADER);
    274         m_FragmentShader = pglCreateShaderObjectARB(GL_FRAGMENT_SHADER);
     273        m_VertexShader = pglCreateShader(GL_VERTEX_SHADER);
     274        m_FragmentShader = pglCreateShader(GL_FRAGMENT_SHADER);
    275275    }
    276276
    277277    ~CShaderProgramGLSL()
    public:  
    290290
    291291        const char* code_string = code.c_str();
    292292        GLint code_length = code.length();
    293         pglShaderSourceARB(shader, 1, &code_string, &code_length);
     293        pglShaderSource(shader, 1, &code_string, &code_length);
    294294
    295         pglCompileShaderARB(shader);
     295        pglCompileShader(shader);
    296296
    297297        GLint ok = 0;
    298298        pglGetShaderiv(shader, GL_COMPILE_STATUS, &ok);
    public:  
    328328        TIMER_ACCRUE(tc_ShaderGLSLLink);
    329329
    330330        ENSURE(!m_Program);
    331         m_Program = pglCreateProgramObjectARB();
     331        m_Program = pglCreateProgram();
    332332
    333         pglAttachObjectARB(m_Program, m_VertexShader);
     333        pglAttachShader(m_Program, m_VertexShader);
    334334        ogl_WarnIfError();
    335         pglAttachObjectARB(m_Program, m_FragmentShader);
     335        pglAttachShader(m_Program, m_FragmentShader);
    336336        ogl_WarnIfError();
    337337
    338338        // Set up the attribute bindings explicitly, since apparently drivers
    339339        // don't always pick the most efficient bindings automatically,
    340340        // and also this lets us hardcode indexes into VertexPointer etc
    341341        for (std::map<CStrIntern, int>::iterator it = m_VertexAttribs.begin(); it != m_VertexAttribs.end(); ++it)
    342             pglBindAttribLocationARB(m_Program, it->second, it->first.c_str());
     342            pglBindAttribLocation(m_Program, it->second, it->first.c_str());
    343343
    344         pglLinkProgramARB(m_Program);
     344        pglLinkProgram(m_Program);
    345345
    346346        GLint ok = 0;
    347347        pglGetProgramiv(m_Program, GL_LINK_STATUS, &ok);
    public:  
    386386            GLsizei nameLength = 0;
    387387            GLint size = 0;
    388388            GLenum type = 0;
    389             pglGetActiveUniformARB(m_Program, i, ARRAY_SIZE(name), &nameLength, &size, &type, name);
     389            pglGetActiveUniform(m_Program, i, ARRAY_SIZE(name), &nameLength, &size, &type, name);
    390390            ogl_WarnIfError();
    391391
    392             GLint loc = pglGetUniformLocationARB(m_Program, name);
     392            GLint loc = pglGetUniformLocation(m_Program, name);
    393393
    394394            CStrIntern nameIntern(name);
    395395            m_Uniforms[nameIntern] = std::make_pair(loc, type);
    public:  
    405405                int unit = (int)m_Samplers.size();
    406406                m_Samplers[nameIntern].first = (type == GL_SAMPLER_CUBE ? GL_TEXTURE_CUBE_MAP : GL_TEXTURE_2D);
    407407                m_Samplers[nameIntern].second = unit;
    408                 pglUniform1iARB(loc, unit); // link uniform to unit
     408                pglUniform1i(loc, unit); // link uniform to unit
    409409                ogl_WarnIfError();
    410410            }
    411411        }
    public:  
    482482
    483483    virtual void Bind()
    484484    {
    485         pglUseProgramObjectARB(m_Program);
     485        pglUseProgram(m_Program);
    486486
    487487        for (std::map<CStrIntern, int>::iterator it = m_VertexAttribs.begin(); it != m_VertexAttribs.end(); ++it)
    488             pglEnableVertexAttribArrayARB(it->second);
     488            pglEnableVertexAttribArray(it->second);
    489489    }
    490490
    491491    virtual void Unbind()
    492492    {
    493         pglUseProgramObjectARB(0);
     493        pglUseProgram(0);
    494494
    495495        for (std::map<CStrIntern, int>::iterator it = m_VertexAttribs.begin(); it != m_VertexAttribs.end(); ++it)
    496             pglDisableVertexAttribArrayARB(it->second);
     496            pglDisableVertexAttribArray(it->second);
    497497
    498498        // TODO: should unbind textures, probably
    499499    }
    public:  
    563563        if (id.first != -1)
    564564        {
    565565            if (id.second == GL_FLOAT)
    566                 pglUniform1fARB(id.first, v0);
     566                pglUniform1f(id.first, v0);
    567567            else if (id.second == GL_FLOAT_VEC2)
    568                 pglUniform2fARB(id.first, v0, v1);
     568                pglUniform2f(id.first, v0, v1);
    569569            else if (id.second == GL_FLOAT_VEC3)
    570                 pglUniform3fARB(id.first, v0, v1, v2);
     570                pglUniform3f(id.first, v0, v1, v2);
    571571            else if (id.second == GL_FLOAT_VEC4)
    572                 pglUniform4fARB(id.first, v0, v1, v2, v3);
     572                pglUniform4f(id.first, v0, v1, v2, v3);
    573573            else
    574574                LOGERROR(L"CShaderProgramGLSL::Uniform(): Invalid uniform type (expected float, vec2, vec3, vec4)");
    575575        }
    public:  
    580580        if (id.first != -1)
    581581        {
    582582            if (id.second == GL_FLOAT_MAT4)
    583                 pglUniformMatrix4fvARB(id.first, 1, GL_FALSE, &v._11);
     583                pglUniformMatrix4fv(id.first, 1, GL_FALSE, &v._11);
    584584            else
    585585                LOGERROR(L"CShaderProgramGLSL::Uniform(): Invalid uniform type (expected mat4)");
    586586        }
    public:  
    591591        if (id.first != -1)
    592592        {
    593593            if (id.second == GL_FLOAT_MAT4)
    594                 pglUniformMatrix4fvARB(id.first, count, GL_FALSE, &v->_11);
     594                pglUniformMatrix4fv(id.first, count, GL_FALSE, &v->_11);
    595595            else
    596596                LOGERROR(L"CShaderProgramGLSL::Uniform(): Invalid uniform type (expected mat4)");
    597597        }
    public:  
    602602
    603603    virtual void VertexPointer(GLint size, GLenum type, GLsizei stride, void* pointer)
    604604    {
    605         pglVertexAttribPointerARB(0, size, type, GL_FALSE, stride, pointer);
     605        pglVertexAttribPointer(0, size, type, GL_FALSE, stride, pointer);
    606606        m_ValidStreams |= STREAM_POS;
    607607    }
    608608
    609609    virtual void NormalPointer(GLenum type, GLsizei stride, void* pointer)
    610610    {
    611         pglVertexAttribPointerARB(2, 3, type, GL_TRUE, stride, pointer);
     611        pglVertexAttribPointer(2, 3, type, GL_TRUE, stride, pointer);
    612612        m_ValidStreams |= STREAM_NORMAL;
    613613    }
    614614
    615615    virtual void ColorPointer(GLint size, GLenum type, GLsizei stride, void* pointer)
    616616    {
    617         pglVertexAttribPointerARB(3, size, type, GL_TRUE, stride, pointer);
     617        pglVertexAttribPointer(3, size, type, GL_TRUE, stride, pointer);
    618618        m_ValidStreams |= STREAM_COLOR;
    619619    }
    620620
    621621    virtual void TexCoordPointer(GLenum texture, GLint size, GLenum type, GLsizei stride, void* pointer)
    622622    {
    623         pglVertexAttribPointerARB(8 + texture - GL_TEXTURE0, size, type, GL_FALSE, stride, pointer);
     623        pglVertexAttribPointer(8 + texture - GL_TEXTURE0, size, type, GL_FALSE, stride, pointer);
    624624        m_ValidStreams |= STREAM_UV0 << (texture - GL_TEXTURE0);
    625625    }
    626626
    public:  
    629629        std::map<CStrIntern, int>::iterator it = m_VertexAttribs.find(CStrIntern(id));
    630630        if (it != m_VertexAttribs.end())
    631631        {
    632             pglVertexAttribPointerARB(it->second, size, type, normalized, stride, pointer);
     632            pglVertexAttribPointer(it->second, size, type, normalized, stride, pointer);
    633633        }
    634634    }
    635635
  • source/lib/external_libraries/glext_funcs.h

    diff --git a/source/lib/external_libraries/glext_funcs.h b/source/lib/external_libraries/glext_funcs.h
    index da14792..96a1f2f 100644
    a b FUNC(GLboolean, glIsProgramARB, (GLuint program))  
    207207// (NOTE: Many of these have "Object" in their ARB names, but "Program" or "Shader" in their core names.
    208208// When both Program and Shader versions exist, we use FUNC3 here and the engine must call the specific
    209209// core name instead of the generic ARB name.)
    210 FUNC3(void, glDeleteObjectARB, glDeleteShader, "2.0", (GLhandleARB obj))
    211 FUNC3(void, glDeleteObjectARB, glDeleteProgram, "2.0", (GLhandleARB obj))
     210FUNC(void, glDeleteShader, (GLuint obj))
     211FUNC(void, glDeleteProgram, (GLuint obj))
    212212// FUNC2(GLhandleARB, glGetHandleARB, glGetHandle, "2.0", (GLenum pname))
    213   // there is no analog to the ARB function in GL 2.0 (the functionality is probably moved into glGetIntegerv(GL_CURRENT_PROGRAM))
    214   // so we can't represent it in this FUNC2 system, so just pretend it doesn't exist
    215 FUNC2(void, glDetachObjectARB, glDetachShader, "2.0", (GLhandleARB containerObj, GLhandleARB attachedObj))
    216 FUNC2(GLhandleARB, glCreateShaderObjectARB, glCreateShader, "2.0", (GLenum shaderType))
    217 FUNC2(void, glShaderSourceARB, glShaderSource, "2.0", (GLhandleARB shaderObj, GLsizei count, const char **string, const GLint *length))
    218 FUNC2(void, glCompileShaderARB, glCompileShader, "2.0", (GLhandleARB shaderObj))
    219 FUNC2(GLhandleARB, glCreateProgramObjectARB, glCreateProgram, "2.0", (void))
    220 FUNC2(void, glAttachObjectARB, glAttachShader, "2.0", (GLhandleARB containerObj, GLhandleARB obj))
    221 FUNC2(void, glLinkProgramARB, glLinkProgram, "2.0", (GLhandleARB programObj))
    222 FUNC2(void, glUseProgramObjectARB, glUseProgram, "2.0", (GLhandleARB programObj))
    223 FUNC2(void, glValidateProgramARB, glValidateProgram, "2.0", (GLhandleARB programObj))
    224 FUNC2(void, glUniform1fARB, glUniform1f, "2.0", (GLint location, GLfloat v0))
    225 FUNC2(void, glUniform2fARB, glUniform2f, "2.0", (GLint location, GLfloat v0, GLfloat v1))
    226 FUNC2(void, glUniform3fARB, glUniform3f, "2.0", (GLint location, GLfloat v0, GLfloat v1, GLfloat v2))
    227 FUNC2(void, glUniform4fARB, glUniform4f, "2.0", (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3))
    228 FUNC2(void, glUniform1iARB, glUniform1i, "2.0", (GLint location, GLint v0))
    229 FUNC2(void, glUniform2iARB, glUniform2i, "2.0", (GLint location, GLint v0, GLint v1))
    230 FUNC2(void, glUniform3iARB, glUniform3i, "2.0", (GLint location, GLint v0, GLint v1, GLint v2))
    231 FUNC2(void, glUniform4iARB, glUniform4i, "2.0", (GLint location, GLint v0, GLint v1, GLint v2, GLint v3))
    232 FUNC2(void, glUniform1fvARB, glUniform1fv, "2.0", (GLint location, GLsizei count, const GLfloat *value))
    233 FUNC2(void, glUniform2fvARB, glUniform2fv, "2.0", (GLint location, GLsizei count, const GLfloat *value))
    234 FUNC2(void, glUniform3fvARB, glUniform3fv, "2.0", (GLint location, GLsizei count, const GLfloat *value))
    235 FUNC2(void, glUniform4fvARB, glUniform4fv, "2.0", (GLint location, GLsizei count, const GLfloat *value))
    236 FUNC2(void, glUniform1ivARB, glUniform1iv, "2.0", (GLint location, GLsizei count, const GLint *value))
    237 FUNC2(void, glUniform2ivARB, glUniform2iv, "2.0", (GLint location, GLsizei count, const GLint *value))
    238 FUNC2(void, glUniform3ivARB, glUniform3iv, "2.0", (GLint location, GLsizei count, const GLint *value))
    239 FUNC2(void, glUniform4ivARB, glUniform4iv, "2.0", (GLint location, GLsizei count, const GLint *value))
    240 FUNC2(void, glUniformMatrix2fvARB, glUniformMatrix2fv, "2.0", (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
    241 FUNC2(void, glUniformMatrix3fvARB, glUniformMatrix3fv, "2.0", (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
    242 FUNC2(void, glUniformMatrix4fvARB, glUniformMatrix4fv, "2.0", (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
    243 FUNC3(void, glGetObjectParameterfvARB, glGetProgramfv, "2.0", (GLhandleARB obj, GLenum pname, GLfloat *params))
    244 FUNC3(void, glGetObjectParameterfvARB, glGetShaderfv, "2.0", (GLhandleARB obj, GLenum pname, GLfloat *params))
    245 FUNC3(void, glGetObjectParameterivARB, glGetProgramiv, "2.0", (GLhandleARB obj, GLenum pname, GLint *params))
    246 FUNC3(void, glGetObjectParameterivARB, glGetShaderiv, "2.0", (GLhandleARB obj, GLenum pname, GLint *params))
    247 FUNC3(void, glGetInfoLogARB, glGetProgramInfoLog, "2.0", (GLhandleARB obj, GLsizei maxLength, GLsizei *length, char *infoLog))
    248 FUNC3(void, glGetInfoLogARB, glGetShaderInfoLog, "2.0", (GLhandleARB obj, GLsizei maxLength, GLsizei *length, char *infoLog))
    249 FUNC2(void, glGetAttachedObjectsARB, glGetAttachedShaders, "2.0", (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj))
    250 FUNC2(GLint, glGetUniformLocationARB, glGetUniformLocation, "2.0", (GLhandleARB programObj, const char *name))
    251 FUNC2(void, glGetActiveUniformARB, glGetActiveUniform, "2.0", (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, char *name))
    252 FUNC2(void, glGetUniformfvARB, glGetUniformfv, "2.0", (GLhandleARB programObj, GLint location, GLfloat *params))
    253 FUNC2(void, glGetUniformivARB, glGetUniformiv, "2.0", (GLhandleARB programObj, GLint location, GLint *params))
    254 FUNC2(void, glGetShaderSourceARB, glGetShaderSource, "2.0", (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source))
     213// there is no analog to the ARB function in GL 2.0 (the functionality is probably moved into glGetIntegerv(GL_CURRENT_PROGRAM))
     214// so we can't represent it in this FUNC2 system, so just pretend it doesn't exist
     215FUNC(void, glDetachShader, (GLuint containerObj, GLuint attachedObj))
     216FUNC(GLuint, glCreateShader, (GLenum shaderType))
     217// technically, what the (const char**) params here are defined as (GLchar**) in the API
     218FUNC(void, glShaderSource, (GLuint shaderObj, GLsizei count, const char **string, const GLint *length))
     219FUNC(void, glCompileShader, (GLuint shaderObj))
     220FUNC(GLuint, glCreateProgram, (void))
     221FUNC(void, glAttachShader, (GLuint containerObj, GLuint obj))
     222FUNC(void, glLinkProgram, (GLuint programObj))
     223FUNC(void, glUseProgram, (GLuint programObj))
     224FUNC(void, glValidateProgram, (GLuint programObj))
     225FUNC(void, glUniform1f, (GLint location, GLfloat v0))
     226FUNC(void, glUniform2f, (GLint location, GLfloat v0, GLfloat v1))
     227FUNC(void, glUniform3f, (GLint location, GLfloat v0, GLfloat v1, GLfloat v2))
     228FUNC(void, glUniform4f, (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3))
     229FUNC(void, glUniform1i, (GLint location, GLint v0))
     230FUNC(void, glUniform2i, (GLint location, GLint v0, GLint v1))
     231FUNC(void, glUniform3i, (GLint location, GLint v0, GLint v1, GLint v2))
     232FUNC(void, glUniform4i, (GLint location, GLint v0, GLint v1, GLint v2, GLint v3))
     233FUNC(void, glUniform1fv, (GLint location, GLsizei count, const GLfloat *value))
     234FUNC(void, glUniform2fv, (GLint location, GLsizei count, const GLfloat *value))
     235FUNC(void, glUniform3fv, (GLint location, GLsizei count, const GLfloat *value))
     236FUNC(void, glUniform4fv, (GLint location, GLsizei count, const GLfloat *value))
     237FUNC(void, glUniform1iv, (GLint location, GLsizei count, const GLint *value))
     238FUNC(void, glUniform2iv, (GLint location, GLsizei count, const GLint *value))
     239FUNC(void, glUniform3iv, (GLint location, GLsizei count, const GLint *value))
     240FUNC(void, glUniform4iv, (GLint location, GLsizei count, const GLint *value))
     241FUNC(void, glUniformMatrix2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
     242FUNC(void, glUniformMatrix3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
     243FUNC(void, glUniformMatrix4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value))
     244FUNC(void, glGetProgramfv, (GLuint obj, GLenum pname, GLfloat *params))
     245FUNC(void, glGetShaderfv, (GLuint obj, GLenum pname, GLfloat *params))
     246FUNC(void, glGetProgramiv, (GLuint obj, GLenum pname, GLint *params))
     247FUNC(void, glGetShaderiv, (GLuint obj, GLenum pname, GLint *params))
     248FUNC(void, glGetProgramInfoLog, (GLuint obj, GLsizei maxLength, GLsizei *length, char *infoLog))
     249FUNC(void, glGetShaderInfoLog, (GLuint obj, GLsizei maxLength, GLsizei *length, char *infoLog))
     250FUNC(void, glGetAttachedShaders, (GLuint containerObj, GLsizei maxCount, GLsizei *count, GLuint *obj))
     251FUNC(GLint, glGetUniformLocation, (GLuint programObj, const char *name))
     252FUNC(void, glGetActiveUniform, (GLuint programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, char *name))
     253FUNC(void, glGetUniformfv, (GLuint programObj, GLint location, GLfloat *params))
     254FUNC(void, glGetUniformiv, (GLuint programObj, GLint location, GLint *params))
     255FUNC(void, glGetShaderSource, (GLuint obj, GLsizei maxLength, GLsizei *length, GLcharARB *source))
    255256
    256257// GL_ARB_vertex_shader
    257 FUNC2(void, glVertexAttrib1fARB, glVertexAttrib1f, "2.0", (GLuint index, GLfloat v0))
    258 FUNC2(void, glVertexAttrib1sARB, glVertexAttrib1s, "2.0", (GLuint index, GLshort v0))
    259 FUNC2(void, glVertexAttrib1dARB, glVertexAttrib1d, "2.0", (GLuint index, GLdouble v0))
    260 FUNC2(void, glVertexAttrib2fARB, glVertexAttrib2f, "2.0", (GLuint index, GLfloat v0, GLfloat v1))
    261 FUNC2(void, glVertexAttrib2sARB, glVertexAttrib2s, "2.0", (GLuint index, GLshort v0, GLshort v1))
    262 FUNC2(void, glVertexAttrib2dARB, glVertexAttrib2d, "2.0", (GLuint index, GLdouble v0, GLdouble v1))
    263 FUNC2(void, glVertexAttrib3fARB, glVertexAttrib3f, "2.0", (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2))
    264 FUNC2(void, glVertexAttrib3sARB, glVertexAttrib3s, "2.0", (GLuint index, GLshort v0, GLshort v1, GLshort v2))
    265 FUNC2(void, glVertexAttrib3dARB, glVertexAttrib3d, "2.0", (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2))
    266 FUNC2(void, glVertexAttrib4fARB, glVertexAttrib4f, "2.0", (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3))
    267 FUNC2(void, glVertexAttrib4sARB, glVertexAttrib4s, "2.0", (GLuint index, GLshort v0, GLshort v1, GLshort v2, GLshort v3))
    268 FUNC2(void, glVertexAttrib4dARB, glVertexAttrib4d, "2.0", (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3))
    269 FUNC2(void, glVertexAttrib4NubARB, glVertexAttrib4Nub, "2.0", (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w))
    270 FUNC2(void, glVertexAttrib1fvARB, glVertexAttrib1fv, "2.0", (GLuint index, const GLfloat *v))
    271 FUNC2(void, glVertexAttrib1svARB, glVertexAttrib1sv, "2.0", (GLuint index, const GLshort *v))
    272 FUNC2(void, glVertexAttrib1dvARB, glVertexAttrib1dv, "2.0", (GLuint index, const GLdouble *v))
    273 FUNC2(void, glVertexAttrib2fvARB, glVertexAttrib2fv, "2.0", (GLuint index, const GLfloat *v))
    274 FUNC2(void, glVertexAttrib2svARB, glVertexAttrib2sv, "2.0", (GLuint index, const GLshort *v))
    275 FUNC2(void, glVertexAttrib2dvARB, glVertexAttrib2dv, "2.0", (GLuint index, const GLdouble *v))
    276 FUNC2(void, glVertexAttrib3fvARB, glVertexAttrib3fv, "2.0", (GLuint index, const GLfloat *v))
    277 FUNC2(void, glVertexAttrib3svARB, glVertexAttrib3sv, "2.0", (GLuint index, const GLshort *v))
    278 FUNC2(void, glVertexAttrib3dvARB, glVertexAttrib3dv, "2.0", (GLuint index, const GLdouble *v))
    279 FUNC2(void, glVertexAttrib4fvARB, glVertexAttrib4fv, "2.0", (GLuint index, const GLfloat *v))
    280 FUNC2(void, glVertexAttrib4svARB, glVertexAttrib4sv, "2.0", (GLuint index, const GLshort *v))
    281 FUNC2(void, glVertexAttrib4dvARB, glVertexAttrib4dv, "2.0", (GLuint index, const GLdouble *v))
    282 FUNC2(void, glVertexAttrib4ivARB, glVertexAttrib4iv, "2.0", (GLuint index, const GLint *v))
    283 FUNC2(void, glVertexAttrib4bvARB, glVertexAttrib4bv, "2.0", (GLuint index, const GLbyte *v))
    284 FUNC2(void, glVertexAttrib4ubvARB, glVertexAttrib4ubv, "2.0", (GLuint index, const GLubyte *v))
    285 FUNC2(void, glVertexAttrib4usvARB, glVertexAttrib4usv, "2.0", (GLuint index, const GLushort *v))
    286 FUNC2(void, glVertexAttrib4uivARB, glVertexAttrib4uiv, "2.0", (GLuint index, const GLuint *v))
    287 FUNC2(void, glVertexAttrib4NbvARB, glVertexAttrib4Nbv, "2.0", (GLuint index, const GLbyte *v))
    288 FUNC2(void, glVertexAttrib4NsvARB, glVertexAttrib4Nsv, "2.0", (GLuint index, const GLshort *v))
    289 FUNC2(void, glVertexAttrib4NivARB, glVertexAttrib4Niv, "2.0", (GLuint index, const GLint *v))
    290 FUNC2(void, glVertexAttrib4NubvARB, glVertexAttrib4Nubv, "2.0", (GLuint index, const GLubyte *v))
    291 FUNC2(void, glVertexAttrib4NusvARB, glVertexAttrib4Nusv, "2.0", (GLuint index, const GLushort *v))
    292 FUNC2(void, glVertexAttrib4NuivARB, glVertexAttrib4Nuiv, "2.0", (GLuint index, const GLuint *v))
    293 FUNC2(void, glVertexAttribPointerARB, glVertexAttribPointer, "2.0", (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer))
    294 FUNC2(void, glEnableVertexAttribArrayARB, glEnableVertexAttribArray, "2.0", (GLuint index))
    295 FUNC2(void, glDisableVertexAttribArrayARB, glDisableVertexAttribArray, "2.0", (GLuint index))
    296 FUNC2(void, glBindAttribLocationARB, glBindAttribLocation, "2.0", (GLhandleARB programObj, GLuint index, const char *name))
    297 FUNC2(void, glGetActiveAttribARB, glGetActiveAttrib, "2.0", (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, int *size, GLenum *type, char *name))
    298 FUNC2(GLint, glGetAttribLocationARB, glGetAttribLocation, "2.0", (GLhandleARB programObj, const char *name))
    299 FUNC2(void, glGetVertexAttribdvARB, glGetVertexAttribdv, "2.0", (GLuint index, GLenum pname, GLdouble *params))
    300 FUNC2(void, glGetVertexAttribfvARB, glGetVertexAttribfv, "2.0", (GLuint index, GLenum pname, GLfloat *params))
    301 FUNC2(void, glGetVertexAttribivARB, glGetVertexAttribiv, "2.0", (GLuint index, GLenum pname, GLint *params))
    302 FUNC2(void, glGetVertexAttribPointervARB, glGetVertexAttribPointerv, "2.0", (GLuint index, GLenum pname, void **pointer))
     258FUNC(void, glVertexAttrib1f, (GLuint index, GLfloat v0))
     259FUNC(void, glVertexAttrib1s, (GLuint index, GLshort v0))
     260FUNC(void, glVertexAttrib1d, (GLuint index, GLdouble v0))
     261FUNC(void, glVertexAttrib2f, (GLuint index, GLfloat v0, GLfloat v1))
     262FUNC(void, glVertexAttrib2s, (GLuint index, GLshort v0, GLshort v1))
     263FUNC(void, glVertexAttrib2d, (GLuint index, GLdouble v0, GLdouble v1))
     264FUNC(void, glVertexAttrib3f, (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2))
     265FUNC(void, glVertexAttrib3s, (GLuint index, GLshort v0, GLshort v1, GLshort v2))
     266FUNC(void, glVertexAttrib3d, (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2))
     267FUNC(void, glVertexAttrib4f, (GLuint index, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3))
     268FUNC(void, glVertexAttrib4s, (GLuint index, GLshort v0, GLshort v1, GLshort v2, GLshort v3))
     269FUNC(void, glVertexAttrib4d, (GLuint index, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3))
     270FUNC(void, glVertexAttrib4Nub, (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w))
     271FUNC(void, glVertexAttrib1fv, (GLuint index, const GLfloat *v))
     272FUNC(void, glVertexAttrib1sv, (GLuint index, const GLshort *v))
     273FUNC(void, glVertexAttrib1dv, (GLuint index, const GLdouble *v))
     274FUNC(void, glVertexAttrib2fv, (GLuint index, const GLfloat *v))
     275FUNC(void, glVertexAttrib2sv, (GLuint index, const GLshort *v))
     276FUNC(void, glVertexAttrib2dv, (GLuint index, const GLdouble *v))
     277FUNC(void, glVertexAttrib3fv, (GLuint index, const GLfloat *v))
     278FUNC(void, glVertexAttrib3sv, (GLuint index, const GLshort *v))
     279FUNC(void, glVertexAttrib3dv, (GLuint index, const GLdouble *v))
     280FUNC(void, glVertexAttrib4fv, (GLuint index, const GLfloat *v))
     281FUNC(void, glVertexAttrib4sv, (GLuint index, const GLshort *v))
     282FUNC(void, glVertexAttrib4dv, (GLuint index, const GLdouble *v))
     283FUNC(void, glVertexAttrib4iv, (GLuint index, const GLint *v))
     284FUNC(void, glVertexAttrib4bv, (GLuint index, const GLbyte *v))
     285FUNC(void, glVertexAttrib4ubv, (GLuint index, const GLubyte *v))
     286FUNC(void, glVertexAttrib4usv, (GLuint index, const GLushort *v))
     287FUNC(void, glVertexAttrib4uiv, (GLuint index, const GLuint *v))
     288FUNC(void, glVertexAttrib4Nbv, (GLuint index, const GLbyte *v))
     289FUNC(void, glVertexAttrib4Nsv, (GLuint index, const GLshort *v))
     290FUNC(void, glVertexAttrib4Niv, (GLuint index, const GLint *v))
     291FUNC(void, glVertexAttrib4Nubv, (GLuint index, const GLubyte *v))
     292FUNC(void, glVertexAttrib4Nusv, (GLuint index, const GLushort *v))
     293FUNC(void, glVertexAttrib4Nuiv, (GLuint index, const GLuint *v))
     294FUNC(void, glVertexAttribPointer, (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer))
     295FUNC(void, glEnableVertexAttribArray, (GLuint index))
     296FUNC(void, glDisableVertexAttribArray, (GLuint index))
     297FUNC(void, glBindAttribLocation, (GLuint programObj, GLuint index, const char *name))
     298FUNC(void, glGetActiveAttrib, (GLuint programObj, GLuint index, GLsizei maxLength, GLsizei *length, int *size, GLenum *type, char *name))
     299FUNC(GLint, glGetAttribLocation, (GLuint programObj, const char *name))
     300FUNC(void, glGetVertexAttribdv, (GLuint index, GLenum pname, GLdouble *params))
     301FUNC(void, glGetVertexAttribfv, (GLuint index, GLenum pname, GLfloat *params))
     302FUNC(void, glGetVertexAttribiv, (GLuint index, GLenum pname, GLint *params))
     303FUNC(void, glGetVertexAttribPointerv, (GLuint index, GLenum pname, void **pointer))
    303304
    304305// GL_EXT_gpu_shader4 / GL3.0:
    305306FUNC2(void, glVertexAttribI1iEXT, glVertexAttribI1i, "3.0", (GLuint index, GLint x))
  • source/renderer/Renderer.cpp

    diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp
    index 2336a09..30dd3af 100644
    a b void CRenderer::EnumCaps()  
    513513            m_Caps.m_ARBProgramShadow = true;
    514514    }
    515515
    516     if (0 == ogl_HaveExtensions(0, "GL_ARB_shader_objects", "GL_ARB_shading_language_100", NULL))
     516    if (ogl_HaveVersion("2.0"))
    517517    {
    518         if (ogl_HaveExtension("GL_ARB_vertex_shader"))
    519             m_Caps.m_VertexShader = true;
    520         if (ogl_HaveExtension("GL_ARB_fragment_shader"))
    521             m_Caps.m_FragmentShader = true;
     518        m_Caps.m_VertexShader = true;
     519        m_Caps.m_FragmentShader = true;
    522520    }
    523521
    524522#if CONFIG2_GLES