20 #ifndef VTKVIEWER_OPENGLHELPER_H
21 #define VTKVIEWER_OPENGLHELPER_H
23 #include <vtkObject.h>
24 #include <vtkMatrix4x4.h>
34 #ifndef GL_ARB_shader_objects
42 #define APIENTRYP APIENTRY *
45 #ifndef GL_ARB_shader_objects
49 #ifndef GL_VERTEX_PROGRAM_POINT_SIZE_ARB
50 #define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
53 #ifndef GL_VERTEX_SHADER_ARB
54 #define GL_VERTEX_SHADER_ARB 0x8B31
57 #ifndef GL_FRAGMENT_SHADER_ARB
58 #define GL_FRAGMENT_SHADER_ARB 0x8B30
61 #ifndef GL_ARB_point_sprite
62 #define GL_POINT_SPRITE_ARB 0x8861
63 #define GL_COORD_REPLACE_ARB 0x8862
66 #ifndef GL_ARB_vertex_buffer_object
69 #define GL_ARRAY_BUFFER_ARB 0x8892
70 #define GL_STATIC_DRAW_ARB 0x88E4
74 namespace GUI_OPENGL {
89 bool CreateShaderProgram (
const std::string& theFilePath,
98 void SetUniformMatrix (
const GLint theLocation,
99 const vtkMatrix4x4* theMatrix)
const;
105 typedef void (
APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
106 typedef void (
APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n,
const GLuint *buffers);
107 typedef void (
APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers);
115 typedef void (
APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride,
const GLvoid *pointer);
116 typedef void (
APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
117 typedef void (
APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
124 typedef void (
APIENTRYP PFNGLGETSHADERIVARBPROC) (GLuint shader, GLenum pname, GLint *params);
125 typedef void (
APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLuint program, GLenum pname, GLint *params);
126 typedef void (
APIENTRYP PFNGLGETSHADERINFOLOGARBPROC) (GLuint shader, GLsizei maxLength, GLsizei *length, GLchar *infoLog);
127 typedef void (
APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose,
const GLfloat *value);
128 typedef void (
APIENTRYP PFNGLGENVERTEXARRAYSARBPROC) (GLsizei n, GLuint *arrays);
129 typedef void (
APIENTRYP PFNGLBINDVERTEXARRAYARBPROC) (GLuint array);
130 typedef void (
APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
152 PFNGLDETACHOBJECTARBPROC vglDetachObjectARB;
153 PFNGLDELETEOBJECTARBPROC vglDeleteObjectARB;
154 PFNGLVALIDATEPROGRAMARBPROC vglValidateProgramARB;
155 PFNGLGETSHADERIVARBPROC vglGetShaderivARB;
156 PFNGLGETPROGRAMIVARBPROC vglGetProgramivARB;
157 PFNGLGETSHADERINFOLOGARBPROC vglGetShaderInfoLogARB;
159 PFNGLUNIFORMMATRIX4FVARBPROC vglUniformMatrix4fvARB;
160 PFNGLGENVERTEXARRAYSARBPROC vglGenVertexArraysARB;
161 PFNGLBINDVERTEXARRAYARBPROC vglBindVertexArrayARB;
162 PFNGLUNIFORM1IARBPROC vglUniform1iARB;
163 PFNGLGETUNIFORMLOCATIONARBPROC vglGetUniformLocationARB;