From 982a578a6d9c400919da3ac8ec24ef016ef8d696 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 15 Dec 2012 23:18:16 +0000 Subject: esolved an OpenGL-related build problem on windowesolved an OpenGL-related build problem on windows --- src/render/gl.cc | 12 ++---------- src/render/gl.h | 9 ++++----- src/render/state.cc | 4 ++++ 3 files changed, 10 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/render/gl.cc b/src/render/gl.cc index b0550da..932fe34 100644 --- a/src/render/gl.cc +++ b/src/render/gl.cc @@ -18,6 +18,8 @@ genbuffers_func genbuffers = 0; deletebuffers_func deletebuffers = 0; bindbuffer_func bindbuffer = 0; bufferdata_func bufferdata = 0; +activetexture_func activetexture = 0; +clientactivetexture_func clientactivetexture = 0; std::string renderer() { @@ -423,15 +425,5 @@ void texparameter(GLenum target, GLenum pname, const GLint* params) glTexParameteriv(target, pname, params); } -void activetexture(GLenum texture) -{ - glActiveTexture(texture); -} - -void clientactivetexture(GLenum texture) -{ - glClientActiveTexture(texture); -} - } // namespace gl diff --git a/src/render/gl.h b/src/render/gl.h index 2d19a45..c5da4db 100644 --- a/src/render/gl.h +++ b/src/render/gl.h @@ -313,20 +313,19 @@ void texparameter(GLenum target, GLenum pname, GLint param); void texparameter(GLenum target, GLenum pname, const GLfloat* params); void texparameter(GLenum target, GLenum pname, const GLint* params); -/// Active server-side texture -void activetexture(GLenum texture); -/// Active client-side texture -void clientactivetexture(GLenum texture); - typedef void (* APIENTRY genbuffers_func)(GLuint count, GLuint *id); typedef void (* APIENTRY deletebuffers_func)(GLuint count, GLuint *id); typedef void (* APIENTRY bindbuffer_func)(GLenum target, GLuint id); typedef void (* APIENTRY bufferdata_func)(GLenum target, GLsizei size, const GLvoid *data, GLenum usage); +typedef void (*APIENTRY activetexture_func)(GLenum texture); +typedef void (*APIENTRY clientactivetexture_func)(GLenum texture); extern genbuffers_func genbuffers; extern deletebuffers_func deletebuffers; extern bindbuffer_func bindbuffer; extern bufferdata_func bufferdata; +extern activetexture_func activetexture; +extern clientactivetexture_func clientactivetexture; } diff --git a/src/render/state.cc b/src/render/state.cc index 8cafefe..7720722 100644 --- a/src/render/state.cc +++ b/src/render/state.cc @@ -105,6 +105,10 @@ void State::init(int width, int height) gl::getinteger(GL_MAX_TEXTURE_UNITS, &state_maxtextureunits); con_debug << " maximum number of OpenGL texture units is " << state_maxtextureunits << std::endl; + // bind multitexture functions + gl::activetexture = (gl::activetexture_func) SDL_GL_GetProcAddress("glActiveTexture"); + gl::clientactivetexture = (gl::activetexture_func) SDL_GL_GetProcAddress("glClientActiveTexture"); + // Generate VBO if (state_has_vbo) gl::genbuffers(1, &state_vbo); -- cgit v1.2.3