blob: dfe6cabec2a054ec16a723517b7ffdfec3e977a6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#ifndef GLPONG3D_H
#define GLPONG3D_H
#include "SDL.h"
#include "SDL_opengl.h"
#include "ball.h"
#include "paddle.h"
GLuint background;
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;
GLuint 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);
void glEnable2D();
void glDisable2D();
#endif
|