forked from csnwc/Data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
neillsdl2.h
39 lines (33 loc) · 1.22 KB
/
neillsdl2.h
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
#include <SDL.h>
#include <math.h>
#define WWIDTH 800
#define WHEIGHT 600
/* Font stuff */
typedef unsigned short fntrow;
#define FNTWIDTH (sizeof(fntrow)*8)
#define FNTHEIGHT 18
#define FNTCHARS 96
#define FNT1STCHAR 32
#define SDL_8BITCOLOUR 256
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
/* All info required for windows / renderer & event loop */
struct SDL_Simplewin {
SDL_bool finished;
SDL_Window *win;
SDL_Renderer *renderer;
SDL_Texture *display;
};
typedef struct SDL_Simplewin SDL_Simplewin;
void Neill_SDL_Init(SDL_Simplewin *sw);
void Neill_SDL_Events(SDL_Simplewin *sw);
void Neill_SDL_SetDrawColour(SDL_Simplewin *sw, Uint8 r, Uint8 g, Uint8 b);
void Neill_SDL_RenderFillCircle(SDL_Renderer *rend, int cx, int cy, int r);
void Neill_SDL_RenderDrawCircle(SDL_Renderer *rend, int cx, int cy, int r);
void Neill_SDL_DrawChar(SDL_Simplewin *sw, fntrow fontdata[FNTCHARS][FNTHEIGHT],
unsigned char chr, int ox, int oy);
void Neill_SDL_DrawString(SDL_Simplewin *sw, fntrow fontdata[FNTCHARS][FNTHEIGHT],
char *str, int ox, int oy);
void Neill_SDL_ReadFont(fntrow fontdata[FNTCHARS][FNTHEIGHT], char *fname);
void Neill_SDL_UpdateScreen(SDL_Simplewin *sw);