Mercurial > projects > ldc
comparison demos/qd.d @ 78:2332006e1fa4 trunk
[svn r82] Fixed: Fall-through switch cases were broken.
author | lindquist |
---|---|
date | Wed, 31 Oct 2007 20:50:21 +0100 |
parents | b706170e24a9 |
children | f869c636a113 |
comparison
equal
deleted
inserted
replaced
77:714057ff2dbb | 78:2332006e1fa4 |
---|---|
1 module qd; | 1 module qd; |
2 | 2 |
3 /* | |
4 import std.c.time: sleep; | 3 import std.c.time: sleep; |
5 void main() { | 4 void main() { |
6 screen(640, 480); | 5 screen(640, 480); |
7 pset(10, 10); | 6 pset(10, 10); |
8 line(0, 0, 100, 100, Box, Back(Red~Black)); | 7 line(0, 0, 100, 100, Box, Back(Red~Black)); |
16 paint(200, 200, Black); | 15 paint(200, 200, Black); |
17 pset(10, 11); pset(10, 11, Black); | 16 pset(10, 11); pset(10, 11, Black); |
18 pset(10, 10); | 17 pset(10, 10); |
19 sleep(5); | 18 sleep(5); |
20 } | 19 } |
21 */ | |
22 | 20 |
23 extern(C) { | 21 extern(C) { |
24 struct SDL_Rect { | 22 struct SDL_Rect { |
25 short x, y; | 23 short x, y; |
26 ushort w, h; | 24 ushort w, h; |
306 else bresenham!(false, false)(x0, y0, x1, y1); | 304 else bresenham!(false, false)(x0, y0, x1, y1); |
307 } | 305 } |
308 } | 306 } |
309 } | 307 } |
310 | 308 |
311 import llvm.intrinsic; | 309 pragma(LLVM_internal, "intrinsic", "llvm.sqrt.f32") { |
312 alias llvm_sqrt sqrt; | 310 float sqrt(float val); |
311 } | |
312 pragma(LLVM_internal, "intrinsic", "llvm.sqrt.f64") { | |
313 double sqrt(double val); | |
314 real sqrt(real val); | |
315 } | |
313 | 316 |
314 template circle_bresenham_pass(bool first) { | 317 template circle_bresenham_pass(bool first) { |
315 const string xy=(first?"x":"y"); | 318 const string xy=(first?"x":"y"); |
316 const string yx=(first?"y":"x"); | 319 const string yx=(first?"y":"x"); |
317 const string str=" | 320 const string str=" |