3eceb7074bb8ff4ee46f306c3faa38cb6dbcede6
[zeRace] / sdl.h
1 /* some useful functions for zeRace game */
2
3 #include <string.h>
4 #include <SDL.h>
5 #include <SDL_image.h>
6
7 /* endianness setup */
8 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
9   #define RSHIFT 24
10   #define GSHIFT 16
11   #define BSHIFT 8
12   #define ASHIFT 0
13 #else
14   #define RSHIFT 0
15   #define GSHIFT 8
16   #define BSHIFT 16
17   #define ASHIFT 24
18 #endif
19
20 void print(SDL_Surface *dst,int x,int y,unsigned char *text);
21 void readstring(SDL_Surface *dst,int x,int y,unsigned char *text,int limit);
22 Uint32 getpixel(SDL_Surface *surface, int x, int y);
23 void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel);
24 void setpixel(SDL_Surface *screen, int x, int y, Uint8 r, Uint8 g, Uint8 b);