From f50ddaa63c563cf2483e9c61d22086a05cfd2115 Mon Sep 17 00:00:00 2001 From: Wolfgang Draxinger Date: Wed, 9 Nov 2011 12:45:20 +0100 Subject: Added texture_distortion_glsl and x11argb_opengl_glsl codesamples --- samples/OpenGL/minimal_glsl/minimal_glsl.c | 69 +++++++++++++++++------------- 1 file changed, 39 insertions(+), 30 deletions(-) (limited to 'samples/OpenGL/minimal_glsl/minimal_glsl.c') 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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 0.0, 1.0, 0.0}, // 0 + {-1.0, 1.0, 1.0, -1.0, 0.0, 0.0, 1.0, 1.0}, // 3 + {-1.0, 1.0, -1.0, -1.0, 0.0, 0.0, 0.0, 1.0}, // 6 + + { 1.0, -1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0}, // 1 + { 1.0, -1.0, -1.0, 1.0, 0.0, 0.0, 1.0, 0.0}, // 4 + { 1.0, 1.0, -1.0, 1.0, 0.0, 0.0, 1.0, 1.0}, // 7 + { 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 1.0}, // 2 + + {-1.0, -1.0, -1.0, 0.0, -1.0, 0.0, 0.0, 0.0}, // 5 + { 1.0, -1.0, -1.0, 0.0, -1.0, 0.0, 1.0, 0.0}, // 4 + { 1.0, -1.0, 1.0, 0.0, -1.0, 0.0, 1.0, 1.0}, // 1 + {-1.0, -1.0, 1.0, 0.0, -1.0, 0.0, 0.0, 1.0}, // 0 + + {-1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0}, // 3 + { 1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0}, // 2 + { 1.0, 1.0, -1.0, 0.0, 1.0, 0.0, 1.0, 1.0}, // 7 + {-1.0, 1.0, -1.0, 0.0, 1.0, 0.0, 0.0, 1.0}, // 6 }; static void draw_cube(void) -- cgit v1.2.3