summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKamil Kaminski <kamilkss@gmail.com>2011-08-09 20:48:56 -0500
committerKamil Kaminski <kamilkss@gmail.com>2011-08-09 20:48:56 -0500
commit7baa144a1807c037c93a5f7e20fb27b89d824599 (patch)
treee26fbce8f37da72c456dcb17b20ed01eba489eb1
parent13ea210caea443bf7cd297c728b8af1561e2a325 (diff)
downloadglvbo-7baa144a1807c037c93a5f7e20fb27b89d824599.tar.gz
glvbo-7baa144a1807c037c93a5f7e20fb27b89d824599.tar.bz2
glvbo-7baa144a1807c037c93a5f7e20fb27b89d824599.zip
format the code, remove duplicate prototypeHEADmaster
-rw-r--r--vbo.c77
1 files 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 };