Skip to content

Commit 3a922b2

Browse files
committed
Made sure to disable attrib arrays
1 parent 2ac95f5 commit 3a922b2

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

Examples/src/Animation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ void draw() {
183183
glDrawArrays(GL_TRIANGLES, 0, 6);
184184

185185
//disable the attributes
186-
glEnableVertexAttribArray(attribPos);
187-
glEnableVertexAttribArray(attribColor);
186+
glDisableVertexAttribArray(attribPos);
187+
glDisableVertexAttribArray(attribColor);
188188
glDisableVertexAttribArray(attribUV);
189189

190190
//clear binds

Examples/src/MovingTriangle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ void draw() {
9999
glDrawArrays(GL_TRIANGLES, 0, 3);
100100

101101
//disable the attributes
102-
glEnableVertexAttribArray(attribPos);
103-
glEnableVertexAttribArray(attribColor);
102+
glDisableVertexAttribArray(attribPos);
103+
glDisableVertexAttribArray(attribColor);
104104

105105
//clear binds
106106
glBindBuffer(GL_ARRAY_BUFFER, 0);

Examples/src/MultiColoredTriangle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ void draw() {
7878
glDrawArrays(GL_TRIANGLES, 0, 3);
7979

8080
//disable the attributes
81-
glEnableVertexAttribArray(attribPos);
82-
glEnableVertexAttribArray(attribColor);
81+
glDisableVertexAttribArray(attribPos);
82+
glDisableVertexAttribArray(attribColor);
8383

8484
//clear binds
8585
glBindBuffer(GL_ARRAY_BUFFER, 0);

Examples/src/Textures.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ void draw() {
114114
glm::mat4 mvp = projectionMatrix * viewMatrix * modelMatrix;
115115
glUniformMatrix4fv(uniformMVP, 1, GL_FALSE, glm::value_ptr(mvp));
116116

117+
glUniform1i(uniformSampler, 0);
118+
117119
//set our active texture
118120
glActiveTexture(GL_TEXTURE0);
119121

@@ -134,8 +136,8 @@ void draw() {
134136
glDrawArrays(GL_TRIANGLES, 0, 6);
135137

136138
//disable the attributes
137-
glEnableVertexAttribArray(attribPos);
138-
glEnableVertexAttribArray(attribColor);
139+
glDisableVertexAttribArray(attribPos);
140+
glDisableVertexAttribArray(attribColor);
139141
glDisableVertexAttribArray(attribUV);
140142

141143
//clear binds

0 commit comments

Comments
 (0)