diff options
author | Wolfgang Draxinger <Wolfgang.Draxinger@draxit.de> | 2011-11-09 12:45:20 +0100 |
---|---|---|
committer | Wolfgang Draxinger <Wolfgang.Draxinger@draxit.de> | 2011-11-09 12:45:20 +0100 |
commit | f50ddaa63c563cf2483e9c61d22086a05cfd2115 (patch) | |
tree | 1e5a596cfd8a41f058c5643aba81f1b584d903e7 /samples/OpenGL/minimal_glsl/minimal_glsl.c | |
parent | 46f03b144af52b327a468cf9f7a0a84b0ee1e5f3 (diff) | |
download | codesamples-f50ddaa63c563cf2483e9c61d22086a05cfd2115.tar.gz codesamples-f50ddaa63c563cf2483e9c61d22086a05cfd2115.tar.bz2 |
Added texture_distortion_glsl and x11argb_opengl_glsl codesamples
Diffstat (limited to 'samples/OpenGL/minimal_glsl/minimal_glsl.c')
-rw-r--r-- | samples/OpenGL/minimal_glsl/minimal_glsl.c | 69 |
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, 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, -1.0, 0.0, 0.0, -1.0, 0.0, 0.0}, // 4 + {-1.0, -1.0, -1.0, 0.0, 0.0, -1.0, 1.0, 0.0}, // 5 + {-1.0, 1.0, -1.0, 0.0, 0.0, -1.0, 1.0, 1.0}, // 6 + { 1.0, 1.0, -1.0, 0.0, 0.0, -1.0, 0.0, 1.0}, // 7 + + {-1.0, -1.0, -1.0, -1.0, 0.0, 0.0, 0.0, 0.0}, // 5 + {-1.0, -1.0, 1.0, -1.0, 0.0, 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) |