Mercurial > projects > ldc
comparison 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 |
comparison
equal
deleted
inserted
replaced
41:835320b88ad6 | 42:0b9b286b67b6 |
---|---|
1 module sdl; | 1 module sdl; |
2 | 2 |
3 version(build) | 3 version(build) pragma(link,"SDL"); |
4 pragma(link,"SDL"); | |
5 | 4 |
6 extern(C): | 5 extern(C): |
7 struct SDL_Rect { | 6 struct SDL_Rect { |
8 short x, y; | 7 short x, y; |
9 ushort w, h; | 8 ushort w, h; |
41 SDL_SWSURFACE=0, | 40 SDL_SWSURFACE=0, |
42 SDL_HWSURFACE=1, | 41 SDL_HWSURFACE=1, |
43 SDL_DOUBLEBUF=0x40000000, | 42 SDL_DOUBLEBUF=0x40000000, |
44 SDL_FULLSCREEN=0x80000000 | 43 SDL_FULLSCREEN=0x80000000 |
45 } | 44 } |
45 enum { | |
46 SDL_GL_RED_SIZE, | |
47 SDL_GL_GREEN_SIZE, | |
48 SDL_GL_BLUE_SIZE, | |
49 SDL_GL_ALPHA_SIZE, | |
50 SDL_GL_BUFFER_SIZE, | |
51 SDL_GL_DOUBLEBUFFER, | |
52 SDL_GL_DEPTH_SIZE, | |
53 SDL_GL_STENCIL_SIZE, | |
54 SDL_GL_ACCUM_RED_SIZE, | |
55 SDL_GL_ACCUM_GREEN_SIZE, | |
56 SDL_GL_ACCUM_BLUE_SIZE, | |
57 SDL_GL_ACCUM_ALPHA_SIZE, | |
58 SDL_GL_STEREO, | |
59 SDL_GL_MULTISAMPLEBUFFERS, | |
60 SDL_GL_MULTISAMPLESAMPLES, | |
61 SDL_GL_ACCELERATED_VISUAL, | |
62 SDL_GL_SWAP_CONTROL | |
63 } | |
64 int SDL_GL_LoadLibrary(char*); | |
65 void* SDL_GL_GetProcAddress(char*); | |
66 int SDL_GL_SetAttribute(int,int); | |
67 int SDL_GL_GetAttribute(int,int*); | |
68 void SDL_GL_SwapBuffers(); | |
69 void SDL_GL_UpdateRects(int,SDL_Rect*); | |
70 void SDL_GL_Lock(); | |
71 void SDL_GL_Unlock(); | |
72 enum : uint { | |
73 SDL_INIT_TIMER=0x00000001, | |
74 SDL_INIT_AUDIO=0x00000010, | |
75 SDL_INIT_VIDEO=0x00000020, | |
76 SDL_INIT_CDROM=0x00000100, | |
77 SDL_INIT_JOYSTICK=0x00000200, | |
78 SDL_INIT_NOPARACHUTE=0x00100000, | |
79 SDL_INIT_EVENTTHREAD=0x00200000, | |
80 SDL_INIT_EVERYTHING=0x0000FFFF | |
81 } | |
46 | 82 |
83 int SDL_Init(uint); | |
84 int SDL_InitSubSystem(uint); | |
85 int SDL_QuitSubSystem(uint); | |
86 int SDL_WasInit(uint); | |
87 void SDL_Quit(); |