]> git.tdb.fi Git - libs/gl.git/blob - source/arb_uniform_buffer_object.cpp
Fix a comparison with restart_index
[libs/gl.git] / source / arb_uniform_buffer_object.cpp
1 #include "arb_uniform_buffer_object.h"
2
3 namespace Msp {
4 namespace GL {
5
6 PFNGLBINDBUFFERBASEPROC glBindBufferBase = 0;
7 PFNGLBINDBUFFERRANGEPROC glBindBufferRange = 0;
8 PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glGetActiveUniformBlockName = 0;
9 PFNGLGETACTIVEUNIFORMBLOCKIVPROC glGetActiveUniformBlockiv = 0;
10 PFNGLGETACTIVEUNIFORMNAMEPROC glGetActiveUniformName = 0;
11 PFNGLGETACTIVEUNIFORMSIVPROC glGetActiveUniformsiv = 0;
12 PFNGLGETUNIFORMBLOCKINDEXPROC glGetUniformBlockIndex = 0;
13 PFNGLGETUNIFORMINDICESPROC glGetUniformIndices = 0;
14 PFNGLUNIFORMBLOCKBINDINGPROC glUniformBlockBinding = 0;
15
16 Extension::SupportLevel init_arb_uniform_buffer_object()
17 {
18         if(is_version_at_least(3, 0) || is_supported("GL_ARB_uniform_buffer_object"))
19         {
20                 glBindBufferBase = reinterpret_cast<PFNGLBINDBUFFERBASEPROC>(get_proc_address("glBindBufferBase"));
21                 glBindBufferRange = reinterpret_cast<PFNGLBINDBUFFERRANGEPROC>(get_proc_address("glBindBufferRange"));
22                 glGetActiveUniformBlockName = reinterpret_cast<PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC>(get_proc_address("glGetActiveUniformBlockName"));
23                 glGetActiveUniformBlockiv = reinterpret_cast<PFNGLGETACTIVEUNIFORMBLOCKIVPROC>(get_proc_address("glGetActiveUniformBlockiv"));
24                 glGetActiveUniformName = reinterpret_cast<PFNGLGETACTIVEUNIFORMNAMEPROC>(get_proc_address("glGetActiveUniformName"));
25                 glGetActiveUniformsiv = reinterpret_cast<PFNGLGETACTIVEUNIFORMSIVPROC>(get_proc_address("glGetActiveUniformsiv"));
26                 glGetUniformBlockIndex = reinterpret_cast<PFNGLGETUNIFORMBLOCKINDEXPROC>(get_proc_address("glGetUniformBlockIndex"));
27                 glGetUniformIndices = reinterpret_cast<PFNGLGETUNIFORMINDICESPROC>(get_proc_address("glGetUniformIndices"));
28                 glUniformBlockBinding = reinterpret_cast<PFNGLUNIFORMBLOCKBINDINGPROC>(get_proc_address("glUniformBlockBinding"));
29                 return Extension::CORE;
30         }
31         return Extension::UNSUPPORTED;
32 }
33
34 Extension ARB_uniform_buffer_object("GL_ARB_uniform_buffer_object", init_arb_uniform_buffer_object);
35
36 } // namespace GL
37 } // namespace Msp