Better draw code (with bitmaps and lines)
October 16, 2009by Lee Spector (lspector)
Here is a better version of the drawing code, with Adria’s bitmap contribution (which should help with the unwanted window-clearing on some systems and also make the window redraw when resized, etc.), some enhancements that I made to the bitmap code because it wasn’t working right with iterative drawing, plus two other changes:
- A “line” procedure to draw a line that takes 9 arguments — x1 y1 x2 y2 width r g b a — and draws a line from (x1, y1) to (x2, y2) that’s width pixels wide, with color red=r, green=g, blue=b, and transparency alpha=a.
- I changed the name of “make-window” to “show-window” because that’s really what it does.
Here it is: better-draw
Let me know if you have any problems with it.
October 16th, 2009 at 3:34 pm
[…] Better draw code (with bitmaps and lines) […]
November 4th, 2009 at 9:25 pm
[…] on A Scheme “while loop”Code Immersion » Blog Archive » Simple animation on Better draw code (with bitmaps and lines)lspector on Memoizationas07 on Memoization « Simple frame-based […]