CShader: Simplify initialization
This commit is contained in:
parent
b8078e7419
commit
92811a9309
|
@ -16,17 +16,11 @@ int CShader::smNumShaders = 0;
|
||||||
|
|
||||||
CShader::CShader()
|
CShader::CShader()
|
||||||
{
|
{
|
||||||
mVertexShaderExists = false;
|
|
||||||
mPixelShaderExists = false;
|
|
||||||
mProgramExists = false;
|
|
||||||
smNumShaders++;
|
smNumShaders++;
|
||||||
}
|
}
|
||||||
|
|
||||||
CShader::CShader(const char *pkVertexSource, const char *pkPixelSource)
|
CShader::CShader(const char *pkVertexSource, const char *pkPixelSource)
|
||||||
{
|
{
|
||||||
mVertexShaderExists = false;
|
|
||||||
mPixelShaderExists = false;
|
|
||||||
mProgramExists = false;
|
|
||||||
smNumShaders++;
|
smNumShaders++;
|
||||||
|
|
||||||
CompileVertexSource(pkVertexSource);
|
CompileVertexSource(pkVertexSource);
|
||||||
|
|
|
@ -6,22 +6,22 @@
|
||||||
|
|
||||||
class CShader
|
class CShader
|
||||||
{
|
{
|
||||||
bool mVertexShaderExists;
|
bool mVertexShaderExists = false;
|
||||||
bool mPixelShaderExists;
|
bool mPixelShaderExists = false;
|
||||||
bool mProgramExists;
|
bool mProgramExists = false;
|
||||||
GLuint mVertexShader;
|
GLuint mVertexShader = 0;
|
||||||
GLuint mPixelShader;
|
GLuint mPixelShader = 0;
|
||||||
GLuint mProgram;
|
GLuint mProgram = 0;
|
||||||
|
|
||||||
GLuint mMVPBlockIndex;
|
GLuint mMVPBlockIndex = 0;
|
||||||
GLuint mVertexBlockIndex;
|
GLuint mVertexBlockIndex = 0;
|
||||||
GLuint mPixelBlockIndex;
|
GLuint mPixelBlockIndex = 0;
|
||||||
GLuint mLightBlockIndex;
|
GLuint mLightBlockIndex = 0;
|
||||||
GLuint mBoneTransformBlockIndex;
|
GLuint mBoneTransformBlockIndex = 0;
|
||||||
|
|
||||||
// Cached uniform locations
|
// Cached uniform locations
|
||||||
GLint mTextureUniforms[8];
|
GLint mTextureUniforms[8] = {};
|
||||||
GLint mNumLightsUniform;
|
GLint mNumLightsUniform = 0;
|
||||||
|
|
||||||
static int smNumShaders;
|
static int smNumShaders;
|
||||||
static CShader* spCurrentShader;
|
static CShader* spCurrentShader;
|
||||||
|
|
Loading…
Reference in New Issue