X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmisc.cpp;h=39810be3d82b814ef6555032ab0cc422e40e7b62;hp=70b300a661783e5398b3ca891a6b646b3ceeae87;hb=eacacdda1dc40bb655a3df14b59260ce06329fb6;hpb=efe80f5a696b4a3be2378dc6d635c89676afa12d diff --git a/source/misc.cpp b/source/misc.cpp index 70b300a6..39810be3 100644 --- a/source/misc.cpp +++ b/source/misc.cpp @@ -1,10 +1,4 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - +#include #include "misc.h" namespace Msp { @@ -28,15 +22,24 @@ void set(GLenum state, bool value) disable(state); } -void get(GLenum state, int &data) +int get_i(GLenum state) { + int data; glGetIntegerv(state, &data); + return data; } -int get_i(GLenum state) +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; - get(state, data); + glGetProgramiv(id, state, &data); return data; }