From 5dbe8005e02b29da820fb4ed09fd3b0645683f70 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 4 Jun 2014 21:04:12 +0300 Subject: Add shader related OpenGL functions and some other. --- src/graphicsmanager.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/graphicsmanager.cpp') diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index f7c877c1f..a628c25a7 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -901,6 +901,40 @@ void GraphicsManager::initOpenGLFunctions() assignFunction(glBindBuffer, "glBindBuffer"); assignFunction(glBufferData, "glBufferData"); } + if (checkGLVersion(2, 0)) + { + assignFunction(glCreateShader, "glCreateShader"); + assignFunction(glDeleteShader, "glDeleteShader"); + assignFunction(glGetShaderiv, "glGetShaderiv"); + assignFunction(glGetShaderInfoLog, "glGetShaderInfoLog"); + assignFunction(glGetShaderSource, "glGetShaderSource"); + assignFunction(glShaderSource, "glShaderSource"); + assignFunction(glCompileShader, "glCompileShader"); + assignFunction(glLinkProgram, "glLinkProgram"); + assignFunction(glDeleteProgram, "glDeleteProgram"); + assignFunction(glCreateProgram, "glCreateProgram"); + assignFunction(glAttachShader, "glAttachShader"); + assignFunction(glDetachShader, "glDetachShader"); + assignFunction(glGetAttachedShaders, "glGetAttachedShaders"); + assignFunction(glGetUniformLocation, "glGetUniformLocation"); + assignFunction(glGetActiveUniform, "glGetActiveUniform"); + assignFunction(glGetProgramiv, "glGetProgramiv"); + assignFunction(glUseProgram, "glUseProgram"); + assignFunction(glValidateProgram, "glValidateProgram"); + assignFunction(glGetAttribLocation, "glGetAttribLocation"); + } + if (checkGLVersion(3, 0)) + { + assignFunction(glBindFragDataLocation, "glBindFragDataLocation"); + } + if (checkGLVersion(4, 0) + || supportExtension("GL_ARB_separate_shader_objects")) + { + assignFunction(glUniform1f, "glUniform1f"); + assignFunction(glUniform2f, "glUniform2f"); + assignFunction(glUniform3f, "glUniform3f"); + assignFunction(glUniform4f, "glUniform4f"); + } #ifdef WIN32 assignFunction(wglGetExtensionsString, "wglGetExtensionsStringARB"); -- cgit v1.2.3-70-g09d2