• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

src/render/header/Shader.h

Go to the documentation of this file.
00001 #pragma once
00002 //#include "../pch.h"
00003 //#ifndef __glew_h__
00004 //#include "C:\Users\johnny\code\cannonball\external\GLEW\include\GL\glew.h"
00005 //#endif
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 };

Generated on Fri Jun 18 2010 17:48:39 for Cannonball by  doxygen 1.7.0