=== modified file 'shader.cpp'
@@ -64,9 +64,9 @@
mShaderProgram = glCreateProgramObjectARB();
glAttachObjectARB(mShaderProgram, mFragmentShader);
glAttachObjectARB(mShaderProgram, mVertexShader);
- glBindAttribLocation(mShaderProgram, 0, "position");
- glBindAttribLocation(mShaderProgram, 1, "normal");
- glBindAttribLocation(mShaderProgram, 2, "texture");
+ glBindAttribLocation(mShaderProgram, VertexAttribLocation, "position");
+ glBindAttribLocation(mShaderProgram, NormalAttribLocation, "normal");
+ glBindAttribLocation(mShaderProgram, TexCoordAttribLocation, "texture");
glLinkProgram(mShaderProgram);
glGetShaderInfoLog(mShaderProgram, sizeof msg, NULL, msg);
=== modified file 'shader.h'
@@ -24,6 +24,12 @@
GLint LightSourceDiffuse;
GLint MaterialDiffuse;
} mLocations;
+
+ enum {
+ VertexAttribLocation = 0,
+ NormalAttribLocation = 1,
+ TexCoordAttribLocation = 2
+ };
};
#endif