comparison demos/sdl.d @ 38:27b2f40bdb58 trunk

[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back. Fiddled a bit the the testing system. Added a very simple SDL graphics demo.
author lindquist
date Wed, 10 Oct 2007 06:16:48 +0200
parents
children 0b9b286b67b6
comparison
equal deleted inserted replaced
37:77cdca8c210f 38:27b2f40bdb58
1 module sdl;
2
3 version(build)
4 pragma(link,"SDL");
5
6 extern(C):
7 struct SDL_Rect {
8 short x, y;
9 ushort w, h;
10 }
11 struct SDL_PixelFormat {
12 //SDL_Palette *palette;
13 void *palette;
14 ubyte BitsPerPixel, BytesPerPixel, Rloss, Gloss, Bloss, Aloss, Rshift, Gshift, Bshift, Ashift;
15 uint Rmask, Gmask, Bmask, Amask, colorkey; ubyte alpha;
16 }
17 struct SDL_Surface {
18 uint flags;
19 SDL_PixelFormat *format;
20 int w, h;
21 ushort pitch;
22 void *pixels;
23 int offset;
24 void *hwdata;
25 SDL_Rect clip_rect;
26 uint unused;
27 uint locked;
28 void *map;
29 uint format_version;
30 int refcount;
31 }
32 uint SDL_MapRGBA(SDL_PixelFormat *format, ubyte r, ubyte g, ubyte b, ubyte a);
33 void SDL_GetRGBA(uint pixel, SDL_PixelFormat *fmt, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
34 int SDL_LockSurface(SDL_Surface *);
35 void SDL_UnlockSurface(SDL_Surface *);
36 SDL_Surface * SDL_SetVideoMode(int width, int height, int bpp, uint flags);
37 int SDL_Flip(SDL_Surface *);
38 void SDL_Delay(uint);
39 int SDL_FillRect(SDL_Surface*,SDL_Rect*,uint);
40 enum : uint {
41 SDL_SWSURFACE=0,
42 SDL_HWSURFACE=1,
43 SDL_DOUBLEBUF=0x40000000,
44 SDL_FULLSCREEN=0x80000000
45 }
46