X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmisc.cpp;h=39810be3d82b814ef6555032ab0cc422e40e7b62;hp=67b2a14266ea8c231d24f724bb4e94cf49e7df8c;hb=eacacdda1dc40bb655a3df14b59260ce06329fb6;hpb=f098a871fc6dc7b61a5aca5581fa327e4124c036 diff --git a/source/misc.cpp b/source/misc.cpp index 67b2a142..39810be3 100644 --- a/source/misc.cpp +++ b/source/misc.cpp @@ -1,21 +1,46 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - +#include #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); +} + +int get_i(GLenum state) +{ + int data; + glGetIntegerv(state, &data); + return data; +} + +int get_shader_i(unsigned id, GLenum state) +{ + int data; + glGetShaderiv(id, state, &data); + return data; +} + +int get_program_i(unsigned id, GLenum state) +{ + int data; + glGetProgramiv(id, state, &data); + return data; } } // namespace GL