summaryrefslogtreecommitdiff
path: root/glpong3d.h
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2007-07-09 15:16:20 +0000
committerMatt Turner <mattst88@gmail.com>2007-07-09 15:16:20 +0000
commit78002dcadcad1317a22277684e7f5675f568038c (patch)
tree59ec0d0e86e24229545b659c1839238cd0794279 /glpong3d.h
parentc8f218776cfed976f0a1c92807572f255f392577 (diff)
Implemented collision detection. Fixed paddle positions.
git-svn-id: svn://mattst88.com/svn/glpong3d/trunk@17 4dd1920e-271a-0410-bca0-81b404a81564
Diffstat (limited to 'glpong3d.h')
-rw-r--r--glpong3d.h114
1 files changed, 58 insertions, 56 deletions
diff --git a/glpong3d.h b/glpong3d.h
index a993b6e..b364f71 100644
--- a/glpong3d.h
+++ b/glpong3d.h
@@ -1,56 +1,58 @@
-#ifndef GLPONG3D_H
-#define GLPONG3D_H
-
-#include "SDL.h"
-#include "SDL_opengl.h"
-
-GLuint background;
-
-GLuint paddle_texture;
-GLuint ball_texture;
-
-typedef struct {
- GLfloat w, h, x, y, z;
- GLfloat r, g, b;
-} Paddle_t;
-
-typedef struct {
- GLfloat w, h, x, y, z;
- GLfloat r, g, b;
- GLfloat xv, yv, zv;
- GLfloat rotate;
-} Ball_t;
-
-typedef struct {
- GLfloat x, y;
-} Mouse_t;
-
-typedef struct {
- GLuint context;
- GLuint font;
-} GLC_t;
-
-struct {
- SDL_Event Event;
- SDL_Surface * Surface;
- Ball_t Ball;
- Paddle_t Front;
- Paddle_t Back;
- Mouse_t Mouse;
- GLC_t GLC;
- GLfloat w;
- GLfloat h;
- GLfloat fps;
- Sint8 done;
-} GLPong;
-
-void GLPong_Init();
-void GLPong_HandleEvents();
-void GLPong_Draw();
-void GLPong_CleanUp();
-void GLPong_Move();
-
-GLuint SDL_GL_SurfaceToTexture(SDL_Surface * surface);
-__inline__ unsigned int NextPow2(unsigned int value);
-
-#endif
+#ifndef GLPONG3D_H
+#define GLPONG3D_H
+
+#include "SDL.h"
+#include "SDL_opengl.h"
+
+GLuint background;
+
+GLuint paddle_texture;
+GLuint paddle_texture_hit;
+GLuint ball_texture;
+
+typedef struct {
+ GLfloat w, h, x, y, z;
+ GLfloat r, g, b;
+} Paddle_t;
+
+typedef struct {
+ GLfloat w, h, x, y, z;
+ GLfloat r, g, b;
+ GLfloat xv, yv, zv;
+ GLfloat rotate;
+} Ball_t;
+
+typedef struct {
+ GLfloat x, y;
+} Mouse_t;
+
+typedef struct {
+ GLuint context;
+ GLuint font;
+} GLC_t;
+
+struct {
+ SDL_Event Event;
+ SDL_Surface * Surface;
+ Ball_t Ball;
+ Paddle_t Front;
+ Paddle_t Back;
+ Mouse_t Mouse;
+ GLC_t GLC;
+ GLfloat w;
+ GLfloat h;
+ GLfloat fps;
+ Sint8 done;
+} GLPong;
+
+void GLPong_Init();
+void GLPong_HandleEvents();
+void GLPong_Draw();
+void GLPong_CleanUp();
+void GLPong_Move();
+void GLPong_Collide(Ball_t * ball, const Paddle_t * paddle);
+
+GLuint SDL_GL_SurfaceToTexture(SDL_Surface * surface);
+__inline__ unsigned int NextPow2(unsigned int value);
+
+#endif