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