aboutsummaryrefslogtreecommitdiff
path: root/samples/OpenGL/minimal_glsl/minimal_glsl.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/OpenGL/minimal_glsl/minimal_glsl.c')
-rw-r--r--samples/OpenGL/minimal_glsl/minimal_glsl.c69
1 files changed, 39 insertions, 30 deletions
diff --git a/samples/OpenGL/minimal_glsl/minimal_glsl.c b/samples/OpenGL/minimal_glsl/minimal_glsl.c
index e1db488..2d1b0fa 100644
--- a/samples/OpenGL/minimal_glsl/minimal_glsl.c
+++ b/samples/OpenGL/minimal_glsl/minimal_glsl.c
@@ -60,37 +60,46 @@ GLubyte textureDataRGB[TEX_RGB_WIDTH * TEX_RGB_HEIGHT][3] = {
};
GLuint texRGB = 0;
+/* 6----7
+ /| /|
+ 3----2 |
+ | 5--|-4
+ |/ |/
+ 0----1
+
+*/
+
GLfloat cube_vertices[][8] = {
- /* X Y Z Nx Ny Nz S T */
- {-1.0, -1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0}, // 0
- { 1.0, -1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0}, // 1
- { 1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0}, // 2
- {-1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0}, // 3
-
- { 1.0, -1.0, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0},
- {-1.0, -1.0, -1.0, 0.0, 0.0, -1.0, 1.0, 0.0},
- {-1.0, 1.0, -1.0, 0.0, 0.0, -1.0, 1.0, 1.0},
- { 1.0, 1.0, -1.0, 0.0, 0.0, -1.0, 0.0, 1.0},
-
- {-1.0, -1.0, 1.0, -1.0, 0.0, 0.0, 0.0, 0.0},
- {-1.0, -1.0, -1.0, -1.0, 0.0, 0.0, 1.0, 0.0},
- {-1.0, 1.0, -1.0, -1.0, 0.0, 0.0, 1.0, 1.0},
- {-1.0, 1.0, 1.0, -1.0, 0.0, 0.0, 0.0, 1.0},
-
- { 1.0, -1.0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