diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 10: Use enumerated values instead of plain numbers for attribute locations.

Message ID 20110721123630.17019.89764.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Alexandros Frantzis July 21, 2011, 12:36 p.m. UTC
------------------------------------------------------------
revno: 10
committer: Alexandros Frantzis <alf82@freemail.gr>
timestamp: Thu 2010-07-08 11:27:40 +0300
message:
  Use enumerated values instead of plain numbers for attribute locations.
modified:
  shader.cpp
  shader.h


--
lp:glmark2
https://code.launchpad.net/~glmark2-dev/glmark2/trunk

You are subscribed to branch lp:glmark2.
To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'shader.cpp'
--- shader.cpp	2010-07-08 08:16:07 +0000
+++ shader.cpp	2010-07-08 08:27:40 +0000
@@ -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'
--- shader.h	2010-07-08 08:16:07 +0000
+++ shader.h	2010-07-08 08:27:40 +0000
@@ -24,6 +24,12 @@ 
         GLint LightSourceDiffuse;
         GLint MaterialDiffuse;
     } mLocations;
+
+    enum {
+        VertexAttribLocation = 0,
+        NormalAttribLocation = 1,
+        TexCoordAttribLocation = 2
+    };
 };
 
 #endif