summaryrefslogtreecommitdiff
path: root/glpong.h
diff options
context:
space:
mode:
Diffstat (limited to 'glpong.h')
-rw-r--r--glpong.h67
1 files changed, 37 insertions, 30 deletions
diff --git a/glpong.h b/glpong.h
index d48b3fe..43ee592 100644
--- a/glpong.h
+++ b/glpong.h
@@ -1,30 +1,37 @@
-#ifndef GLPONG_H
-#define GLPONG_H
-
-#include "SDL.h"
-#include "SDL_opengl.h"
-
-#include "ball.h"
-#include "paddle.h"
-
-struct {
- SDL_Event Event;
- SDL_Surface * Surface;
- Ball_t * Balls[4];
- Paddle_t Left, Right;
- Uint16 w;
- Uint16 h;
- Uint16 done;
-} GLPong;
-
-void GLPong_Init();
-void GLPong_HandleEvents();
-void GLPong_Draw();
-void GLPong_CleanUp();
-void GLPong_Move();
-
-GLuint SDL_GL_SurfaceToTexture(SDL_Surface * surface);
-GLuint SDL_GL_NPOTSurfaceToTexture(SDL_Surface * surface, GLfloat * wratio, GLfloat * hratio);
-__inline__ unsigned int NextPow2(unsigned int value);
-
-#endif
+#ifndef GLPONG_H
+#define GLPONG_H
+
+#include "SDL.h"
+#include "SDL_opengl.h"
+
+#include "ball.h"
+/*#include "paddle.h"*/
+
+#define GLPONG_WIDTH 640
+#define GLPONG_HEIGHT 480
+
+#define GLPONG_NOACTION 0
+#define GLPONG_EXIT 1
+#define GLPONG_ADDBALL 2
+
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+#define RMASK 0xff000000
+#define GMASK 0x00ff0000
+#define BMASK 0x0000ff00
+#define AMASK 0x000000ff
+#else
+#define RMASK 0x000000ff
+#define GMASK 0x0000ff00
+#define BMASK 0x00ff0000
+#define AMASK 0xff000000
+#endif
+
+typedef struct {
+ SDL_Surface * Surface;
+ Ball_t * balls;
+/* Paddle_t Left, Right;*/
+ Uint16 w;
+ Uint16 h;
+} GLPong_t;
+
+#endif