Browse code

Change `positions` from `float[]` to `float[][3]`

Robert Cranston authored on 10/11/2024 21:11:20
Showing 1 changed files

... ...
@@ -9,11 +9,11 @@
9 9
 
10 10
 /// Globals
11 11
 GLuint  vertexArray;
12
-GLfloat positions[] =
12
+GLfloat positions[][3] =
13 13
 {
14
-    -0.5f, -0.5f, 0.0f,
15
-    -0.5f, +0.5f, 0.0f,
16
-    +0.5f, -0.5f, 0.0f,
14
+    {-0.5f, -0.5f, 0.0f},
15
+    {-0.5f, +0.5f, 0.0f},
16
+    {+0.5f, -0.5f, 0.0f},
17 17
 };
18 18
 
19 19
 
... ...
@@ -56,8 +56,8 @@ void display(void)
56 56
     glBindVertexArray(vertexArray);
57 57
 
58 58
     // Draw.
59
-    glDrawArrays(GL_TRIANGLES, 0, ARRAY_COUNT(positions)/3);
60 59
     printError("display draw");
60
+    glDrawArrays(GL_TRIANGLES, 0, ARRAY_COUNT(positions));
61 61
 
62 62
     // Show on the screen.
63 63
     glutSwapBuffers();