diff options
-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 }; |