diff options
author | Kamil Kaminski <kamilkss@gmail.com> | 2011-08-09 20:48:56 -0500 |
---|---|---|
committer | Kamil Kaminski <kamilkss@gmail.com> | 2011-08-09 20:48:56 -0500 |
commit | 7baa144a1807c037c93a5f7e20fb27b89d824599 (patch) | |
tree | e26fbce8f37da72c456dcb17b20ed01eba489eb1 /vbo.c | |
parent | 13ea210caea443bf7cd297c728b8af1561e2a325 (diff) | |
download | glvbo-master.tar.gz glvbo-master.tar.bz2 glvbo-master.zip |
Diffstat (limited to 'vbo.c')
-rw-r--r-- | vbo.c | 77 |
1 files changed, 42 insertions, 35 deletions
@@ -49,7 +49,6 @@ const GLfloat lightPos[] = { -10.f, 5.0f, 5.0f, 1.0f }; /* function prototypes */ static void gltErrorCheck(void); static void resize(int, int); -static void setup_opengl(void); static void keys(SDL_keysym *, unsigned int *); static void process_events(void); static void render(void); @@ -422,21 +421,25 @@ int main(int argc, char **argv) gltErrorCheck(); /* setup a triangle */ - float vert_arr[9] = { 0.0f, 0.0f, 0.0f, - 1.0f, 0.0f, 0.0f, - 0.5f, 0.83f, 0.0f }; - - float norm_arr[9] = { 0.0f, 0.0f, 1.0f, - 0.0f, 0.0f, 1.0f, - 0.0f, 0.0f, 1.0f }; - - float texcoord_arr[6] = { 0.0f, 0.0f, - 1.0f, 0.0f, - 0.5f, 1.0f }; - - unsigned char color_arr[9] = { 255, 0, 0, - 0, 255, 0, - 0, 0, 255 }; + float vert_arr[9] = { + 0.0f, 0.0f, 0.0f, + 1.0f, 0.0f, 0.0f, + 0.5f, 0.83f, 0.0f }; + + float norm_arr[9] = { + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, 1.0f }; + + float texcoord_arr[6] = { + 0.0f, 0.0f, + 1.0f, 0.0f, + 0.5f, 1.0f }; + + unsigned char color_arr[9] = { + 255, 0, 0, + 0, 255, 0, + 0, 0, 255 }; unsigned short indices_arr[3] = { 0, 1, 2 }; @@ -445,25 +448,29 @@ int main(int argc, char **argv) gltErrorCheck(); /* setup a rectangle, notice the ccw winding */ - float vert_arr2[12] = { -0.5f, 1.0f, 0.0f, - -1.0f, 1.0f, 0.0f, - -1.0f, 0.0f, 0.0f, - -0.5f, 0.0f, 0.0f }; - - float norm_arr2[12] = { 0.0f, 0.0f, 1.0f, - 0.0f, 0.0f, 1.0f, - 0.0f, 0.0f, 1.0f, - 0.0f, 0.0f, 1.0f }; - - float texcoord_arr2[8] = { 0.5f, 0.0f, - 0.0f, 0.0f, - 0.0f, 1.0f, - 0.5f, 1.0f }; - - unsigned char color_arr2[12] = { 255, 0, 0, - 0, 255, 0, - 0, 0, 255, - 255, 0, 255 }; + float vert_arr2[12] = { + -0.5f, 1.0f, 0.0f, + -1.0f, 1.0f, 0.0f, + -1.0f, 0.0f, 0.0f, + -0.5f, 0.0f, 0.0f }; + + float norm_arr2[12] = { + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, 1.0f }; + + float texcoord_arr2[8] = { + 0.5f, 0.0f, + 0.0f, 0.0f, + 0.0f, 1.0f, + 0.5f, 1.0f }; + + unsigned char color_arr2[12] = { + 255, 0, 0, + 0, 255, 0, + 0, 0, 255, + 255, 0, 255 }; unsigned short indices_arr2[4] = { 0, 1, 2, 3 }; |