From 7baa144a1807c037c93a5f7e20fb27b89d824599 Mon Sep 17 00:00:00 2001 From: Kamil Kaminski Date: Tue, 9 Aug 2011 20:48:56 -0500 Subject: format the code, remove duplicate prototype --- vbo.c | 77 ++++++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/vbo.c b/vbo.c index bde84ba..5716dd8 100644 --- a/vbo.c +++ b/vbo.c @@ -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 }; -- cgit v1.2.3