]> git.tdb.fi Git - libs/gl.git/blob - source/misc.cpp
c09d17f550aeeaa2807818fd443340b94c7e3595
[libs/gl.git] / source / misc.cpp
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2007  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #include "misc.h"
9
10 namespace Msp {
11 namespace GL {
12
13 void enable(GLenum state)
14 {
15         glEnable(state);
16 }
17
18 void disable(GLenum state)
19 {
20         glDisable(state);
21 }
22
23 void set(GLenum state, bool value)
24 {
25         if(value)
26                 enable(state);
27         else
28                 disable(state);
29 }
30
31 void get(GLenum state, int &data)
32 {
33         glGetIntegerv(state, &data);
34 }
35
36 void get(GLenum state, int *data)
37 {
38         glGetIntegerv(state, data);
39 }
40
41 int get_i(GLenum state)
42 {
43         int data;
44         get(state, &data);
45         return data;
46 }
47
48 } // namespace GL
49 } // namespace Msp