]> git.tdb.fi Git - libs/gl.git/blob - source/core/misc.cpp
Clear the empty name flag after emitting a member access
[libs/gl.git] / source / core / misc.cpp
1 #include <msp/gl/extensions/arb_shader_objects.h>
2 #include "misc.h"
3
4 namespace Msp {
5 namespace GL {
6
7 void enable(GLenum state)
8 {
9         glEnable(state);
10 }
11
12 void disable(GLenum state)
13 {
14         glDisable(state);
15 }
16
17 void set(GLenum state, bool value)
18 {
19         if(value)
20                 enable(state);
21         else
22                 disable(state);
23 }
24
25 int get_i(GLenum state)
26 {
27         int data;
28         glGetIntegerv(state, &data);
29         return data;
30 }
31
32 int get_shader_i(unsigned id, GLenum state)
33 {
34         int data;
35         glGetShaderiv(id, state, &data);
36         return data;
37 }
38
39 int get_program_i(unsigned id, GLenum state)
40 {
41         int data;
42         glGetProgramiv(id, state, &data);
43         return data;
44 }
45
46 } // namespace GL
47 } // namespace Msp