annotate demos/sdl.d @ 883:b52d5de7783f

GC defines and linkage changes.
author Christian Kamm <kamm incasoftware de>
date Thu, 08 Jan 2009 18:20:02 +0100
parents 0b9b286b67b6
children
rev   line source
lindquist@38 1 module sdl;
lindquist@38 2
lindquist@42 3 version(build) pragma(link,"SDL");
lindquist@38 4
lindquist@38 5 extern(C):
lindquist@38 6 struct SDL_Rect {
lindquist@38 7 short x, y;
lindquist@38 8 ushort w, h;
lindquist@38 9 }
lindquist@38 10 struct SDL_PixelFormat {
lindquist@38 11 //SDL_Palette *palette;
lindquist@38 12 void *palette;
lindquist@38 13 ubyte BitsPerPixel, BytesPerPixel, Rloss, Gloss, Bloss, Aloss, Rshift, Gshift, Bshift, Ashift;
lindquist@38 14 uint Rmask, Gmask, Bmask, Amask, colorkey; ubyte alpha;
lindquist@38 15 }
lindquist@38 16 struct SDL_Surface {
lindquist@38 17 uint flags;
lindquist@38 18 SDL_PixelFormat *format;
lindquist@38 19 int w, h;
lindquist@38 20 ushort pitch;
lindquist@38 21 void *pixels;
lindquist@38 22 int offset;
lindquist@38 23 void *hwdata;
lindquist@38 24 SDL_Rect clip_rect;
lindquist@38 25 uint unused;
lindquist@38 26 uint locked;
lindquist@38 27 void *map;
lindquist@38 28 uint format_version;
lindquist@38 29 int refcount;
lindquist@38 30 }
lindquist@38 31 uint SDL_MapRGBA(SDL_PixelFormat *format, ubyte r, ubyte g, ubyte b, ubyte a);
lindquist@38 32 void SDL_GetRGBA(uint pixel, SDL_PixelFormat *fmt, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
lindquist@38 33 int SDL_LockSurface(SDL_Surface *);
lindquist@38 34 void SDL_UnlockSurface(SDL_Surface *);
lindquist@38 35 SDL_Surface * SDL_SetVideoMode(int width, int height, int bpp, uint flags);
lindquist@38 36 int SDL_Flip(SDL_Surface *);
lindquist@38 37 void SDL_Delay(uint);
lindquist@38 38 int SDL_FillRect(SDL_Surface*,SDL_Rect*,uint);
lindquist@38 39 enum : uint {
lindquist@38 40 SDL_SWSURFACE=0,
lindquist@38 41 SDL_HWSURFACE=1,
lindquist@38 42 SDL_DOUBLEBUF=0x40000000,
lindquist@38 43 SDL_FULLSCREEN=0x80000000
lindquist@38 44 }
lindquist@42 45 enum {
lindquist@42 46 SDL_GL_RED_SIZE,
lindquist@42 47 SDL_GL_GREEN_SIZE,
lindquist@42 48 SDL_GL_BLUE_SIZE,
lindquist@42 49 SDL_GL_ALPHA_SIZE,
lindquist@42 50 SDL_GL_BUFFER_SIZE,
lindquist@42 51 SDL_GL_DOUBLEBUFFER,
lindquist@42 52 SDL_GL_DEPTH_SIZE,
lindquist@42 53 SDL_GL_STENCIL_SIZE,
lindquist@42 54 SDL_GL_ACCUM_RED_SIZE,
lindquist@42 55 SDL_GL_ACCUM_GREEN_SIZE,
lindquist@42 56 SDL_GL_ACCUM_BLUE_SIZE,
lindquist@42 57 SDL_GL_ACCUM_ALPHA_SIZE,
lindquist@42 58 SDL_GL_STEREO,
lindquist@42 59 SDL_GL_MULTISAMPLEBUFFERS,
lindquist@42 60 SDL_GL_MULTISAMPLESAMPLES,
lindquist@42 61 SDL_GL_ACCELERATED_VISUAL,
lindquist@42 62 SDL_GL_SWAP_CONTROL
lindquist@42 63 }
lindquist@42 64 int SDL_GL_LoadLibrary(char*);
lindquist@42 65 void* SDL_GL_GetProcAddress(char*);
lindquist@42 66 int SDL_GL_SetAttribute(int,int);
lindquist@42 67 int SDL_GL_GetAttribute(int,int*);
lindquist@42 68 void SDL_GL_SwapBuffers();
lindquist@42 69 void SDL_GL_UpdateRects(int,SDL_Rect*);
lindquist@42 70 void SDL_GL_Lock();
lindquist@42 71 void SDL_GL_Unlock();
lindquist@42 72 enum : uint {
lindquist@42 73 SDL_INIT_TIMER=0x00000001,
lindquist@42 74 SDL_INIT_AUDIO=0x00000010,
lindquist@42 75 SDL_INIT_VIDEO=0x00000020,
lindquist@42 76 SDL_INIT_CDROM=0x00000100,
lindquist@42 77 SDL_INIT_JOYSTICK=0x00000200,
lindquist@42 78 SDL_INIT_NOPARACHUTE=0x00100000,
lindquist@42 79 SDL_INIT_EVENTTHREAD=0x00200000,
lindquist@42 80 SDL_INIT_EVERYTHING=0x0000FFFF
lindquist@42 81 }
lindquist@38 82
lindquist@42 83 int SDL_Init(uint);
lindquist@42 84 int SDL_InitSubSystem(uint);
lindquist@42 85 int SDL_QuitSubSystem(uint);
lindquist@42 86 int SDL_WasInit(uint);
lindquist@42 87 void SDL_Quit();