X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmisc.cpp;h=aca3df0f700af7b500f0aa2dba239865e84ab675;hp=67b2a14266ea8c231d24f724bb4e94cf49e7df8c;hb=f14435e58bfa0fa697a06ba9a454bb30cd37d9d8;hpb=f098a871fc6dc7b61a5aca5581fa327e4124c036 diff --git a/source/misc.cpp b/source/misc.cpp index 67b2a142..aca3df0f 100644 --- a/source/misc.cpp +++ b/source/misc.cpp @@ -1,21 +1,41 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include "misc.h" namespace Msp { namespace GL { +void enable(GLenum state) +{ + glEnable(state); +} + +void disable(GLenum state) +{ + glDisable(state); +} + void set(GLenum state, bool value) { if(value) - glEnable(state); + enable(state); else - glDisable(state); + disable(state); +} + +void get(GLenum state, int &data) +{ + glGetIntegerv(state, &data); +} + +void get(GLenum state, int *data) +{ + glGetIntegerv(state, data); +} + +int get_i(GLenum state) +{ + int data; + get(state, &data); + return data; } } // namespace GL