Mercurial > projects > ldc
diff demos/sdl.d @ 42:0b9b286b67b6 trunk
[svn r46] fix for shift operations
added a simple opengl binding in demos
author | lindquist |
---|---|
date | Fri, 19 Oct 2007 15:16:11 +0200 |
parents | 27b2f40bdb58 |
children |
line wrap: on
line diff
--- a/demos/sdl.d Fri Oct 19 07:45:35 2007 +0200 +++ b/demos/sdl.d Fri Oct 19 15:16:11 2007 +0200 @@ -1,7 +1,6 @@ module sdl; -version(build) - pragma(link,"SDL"); +version(build) pragma(link,"SDL"); extern(C): struct SDL_Rect { @@ -43,4 +42,46 @@ SDL_DOUBLEBUF=0x40000000, SDL_FULLSCREEN=0x80000000 } +enum { + SDL_GL_RED_SIZE, + SDL_GL_GREEN_SIZE, + SDL_GL_BLUE_SIZE, + SDL_GL_ALPHA_SIZE, + SDL_GL_BUFFER_SIZE, + SDL_GL_DOUBLEBUFFER, + SDL_GL_DEPTH_SIZE, + SDL_GL_STENCIL_SIZE, + SDL_GL_ACCUM_RED_SIZE, + SDL_GL_ACCUM_GREEN_SIZE, + SDL_GL_ACCUM_BLUE_SIZE, + SDL_GL_ACCUM_ALPHA_SIZE, + SDL_GL_STEREO, + SDL_GL_MULTISAMPLEBUFFERS, + SDL_GL_MULTISAMPLESAMPLES, + SDL_GL_ACCELERATED_VISUAL, + SDL_GL_SWAP_CONTROL +} +int SDL_GL_LoadLibrary(char*); +void* SDL_GL_GetProcAddress(char*); +int SDL_GL_SetAttribute(int,int); +int SDL_GL_GetAttribute(int,int*); +void SDL_GL_SwapBuffers(); +void SDL_GL_UpdateRects(int,SDL_Rect*); +void SDL_GL_Lock(); +void SDL_GL_Unlock(); +enum : uint { + SDL_INIT_TIMER=0x00000001, + SDL_INIT_AUDIO=0x00000010, + SDL_INIT_VIDEO=0x00000020, + SDL_INIT_CDROM=0x00000100, + SDL_INIT_JOYSTICK=0x00000200, + SDL_INIT_NOPARACHUTE=0x00100000, + SDL_INIT_EVENTTHREAD=0x00200000, + SDL_INIT_EVERYTHING=0x0000FFFF +} +int SDL_Init(uint); +int SDL_InitSubSystem(uint); +int SDL_QuitSubSystem(uint); +int SDL_WasInit(uint); +void SDL_Quit();