load opengl buffer-functions only if USE_BUFFERS is set

This commit is contained in:
Joachim Schöberl 2017-05-08 21:20:36 +02:00
parent 74fa8d1888
commit 2b0d3f02ba

View File

@ -4836,12 +4836,14 @@ void (*glGenBuffers) (GLsizei a, GLuint *b);
void (*glBufferData) (GLenum a, GLsizeiptr b, const GLvoid *c, GLenum d); void (*glBufferData) (GLenum a, GLsizeiptr b, const GLvoid *c, GLenum d);
void (*glBufferSubData) (GLenum a, GLintptr b, GLsizeiptr c, const GLvoid *d); void (*glBufferSubData) (GLenum a, GLintptr b, GLsizeiptr c, const GLvoid *d);
DLL_HEADER void LoadOpenGLFunctionPointers() { DLL_HEADER void LoadOpenGLFunctionPointers() {
#ifdef USE_BUFFERS
glBindBuffer = (decltype(glBindBuffer)) wglGetProcAddress("glBindBuffer"); glBindBuffer = (decltype(glBindBuffer)) wglGetProcAddress("glBindBuffer");
glBufferSubData = (decltype(glBufferSubData)) wglGetProcAddress("glBufferSubData"); glBufferSubData = (decltype(glBufferSubData)) wglGetProcAddress("glBufferSubData");
glBufferData = (decltype(glBufferData)) wglGetProcAddress("glBufferData"); glBufferData = (decltype(glBufferData)) wglGetProcAddress("glBufferData");
glDeleteBuffers = (decltype(glDeleteBuffers)) wglGetProcAddress("glDeleteBuffers"); glDeleteBuffers = (decltype(glDeleteBuffers)) wglGetProcAddress("glDeleteBuffers");
glGenBuffers = (decltype(glGenBuffers)) wglGetProcAddress("glGenBuffers"); glGenBuffers = (decltype(glGenBuffers)) wglGetProcAddress("glGenBuffers");
if(!glBindBuffer) throw std::runtime_error("Could not load OpenGL functions!"); if(!glBindBuffer) throw std::runtime_error("Could not load OpenGL functions!");
#endif
} }
#else // WIN32 #else // WIN32
DLL_HEADER void LoadOpenGLFunctionPointers() { } DLL_HEADER void LoadOpenGLFunctionPointers() { }