X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fshader.h;h=c1fd6b2294a47c57c38b62ce9aa41241c19bc9c6;hp=cd01f2acda49a8c3374bc97c356263bccb653b91;hb=f14435e58bfa0fa697a06ba9a454bb30cd37d9d8;hpb=a4ec5410595ddf37bfbc0e85ad87d31a9cbf94f1 diff --git a/source/shader.h b/source/shader.h index cd01f2ac..c1fd6b22 100644 --- a/source/shader.h +++ b/source/shader.h @@ -1,44 +1,39 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GL_SHADER_H_ #define MSP_GL_SHADER_H_ #include #include "gl.h" -#include "types.h" namespace Msp { namespace GL { enum ShaderType { - FRAGMENT_SHADER = GL_FRAGMENT_SHADER, - VERTEX_SHADER = GL_VERTEX_SHADER + FRAGMENT_SHADER = GL_FRAGMENT_SHADER_ARB, + VERTEX_SHADER = GL_VERTEX_SHADER_ARB }; class Shader { +private: + unsigned id; + bool compiled; + public: Shader(ShaderType t); Shader(ShaderType t, const std::string &); +private: + void init(ShaderType); +public: ~Shader(); - void source(sizei count, const char **str, const int *len); + void source(unsigned count, const char **str, const int *len); void source(const std::string &str); void source(const char *str, int len); void compile(); - uint get_id() const { return id; } - bool get_compiled() const { return compiled; } - int get_param(GLenum param) const; + unsigned get_id() const { return id; } + bool is_compiled() const { return compiled; } std::string get_info_log() const; -private: - uint id; - bool compiled; }; } // namespace GL