blob: d15e8deac6f8aef36abfdd01214ab77fc4618dac (
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
|
#ifndef BALL_H
#define BALL_H
#include "SDL.h"
#include "SDL_opengl.h"
GLuint ball_texture;
typedef struct Ball_t {
struct Ball_t * next; /* next ball; 4 or 8 bytes */
GLfloat x, y; /* x, y coordinates; 4 bytes ea. */
GLfloat xv, yv; /* x and y velocity components; 4 bytes ea. */
GLubyte r, g, b, a; /* red, green, blue, alpha components; 1 byte ea. */
} Ball_t;
void GLPong_BallInit(void);
void GLPong_BallDeinit(void);
void GLPong_BallAdd(Ball_t ** balls);
void GLPong_BallDeleteAll(Ball_t * list);
int GLPong_BallCollide(const Ball_t * a, const Ball_t * b);
void GLPong_BallMoveAll(Ball_t ** balls);
void GLPong_BallDrawAll(Ball_t * balls);
#ifdef DEBUG
int length(Ball_t * balls);
#endif
#endif
|