Mercurial > projects > ldc
comparison demos/sdldemo1.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 |
comparison
equal
deleted
inserted
replaced
37:77cdca8c210f | 38:27b2f40bdb58 |
---|---|
1 module sdldemo1; | |
2 import sdl; | |
3 void main() | |
4 { | |
5 auto disp = SDL_SetVideoMode(640,480,0,SDL_HWSURFACE|SDL_DOUBLEBUF); | |
6 auto r = SDL_Rect(0,190,100,100); | |
7 auto c = SDL_MapRGBA(disp.format,255,100,0,255); | |
8 while (r.x < disp.w-100) { | |
9 SDL_FillRect(disp, null, 0); | |
10 SDL_FillRect(disp, &r, c); | |
11 SDL_Flip(disp); | |
12 r.x++; | |
13 } | |
14 } | |
15 |