Go to the documentation of this file.00001 #pragma once
00002
00003
00004
00005
00006
00009 class Uniform
00010 {
00011 public:
00012 Uniform(void);
00015 Uniform(GLint uniformLocation);
00017 Uniform(const Uniform&);
00019 ~Uniform(void);
00020
00023 void set1i(const int);
00026 void set1f(const float);
00029 void set2f(const float, const float);
00032 void set3fv(const float3*, int num = 1);
00035 void set4fv(const float4*, int num = 1);
00038 void set3x3fv(const float3x3*, int num = 1);
00041 void set4x4fv(const float4x4*, int num = 1);
00042
00043 private:
00044 GLint uniformLocation;
00045 };
00046
00049 class Shader
00050 {
00051 public:
00053 Shader(void);
00058 Shader(const wchar* vertexShaderFilename, const wchar* pixelShaderFilename);
00060 ~Shader(void);
00061
00066 bool init(const wchar* vertexShaderFilename, const wchar* pixelShaderFilename);
00067
00069 void uninit(void);
00070
00073 Uniform getUniform(const char* uniformName);
00074
00076 void use(void);
00077
00080 void setIsGui(bool ui) { m_isGui = ui; }
00081
00082 private:
00083 GLuint program;
00084 bool m_isGui;
00085 };