On Scheme

Thoughts on Scheme and teaching Scheme

Archive for March 29th, 2006

Graphics Experiment

Posted by Peter on March 29, 2006

I have been playing around with graphics in Dr. Scheme again. You can download my latest experiment from Sourceforge (and run it with the command (main go-for-a-drive)). In this demo you can fly a small spaceship with the a, d, and w keys and quit with q. Unfortunately because I needed to be able to detect multiple keys being held down at once I was forced to modify the graphics library slightly. Simply overwrite the two files in the PLT\collects\graphics directory with the ones provided in the release. Then delete the compiled directory and recompile with the new versions by running the Setup PLT utility in the root PLT folder.

Unfortunately there are still some problems with the graphics library that I can’t simply fix with edits. One is that I want the program to finish automatically when the window is closed (at the moment you have to exit from within the program or manually use the break command, closing the window has no effect). The other problem is flicker when drawing. What I really want to do is draw to a back-buffer and then flip it in all at once.

Thus I am going to attempt to write my own graphics routines using DirectX (obviously for windows only). Although I know how to code in C/C++ and use DirectX already I worry that actually writing the interface between the C code and Scheme will be taxing at best. The problem is that they encourage you to use their own compiler interface, which aids in linking with the Scheme libraries, ect. Unfortunately I may need to compile without their interface, since I will also need to link to the DirectX libraries. If anyone could point me to a better tutorial than the documentation found on the PLT/Dr. Scheme website it would be much appreciated.

Posted in Exploring Scheme | Leave a Comment »

Sourceforged!

Posted by Peter on March 29, 2006

As you may have already noticed by the new link on the right the Sourceforge companion site was approved. Strangely I never got an email that it was approved it just … appeared. I have uploaded the entire source found in my posts, so feel free to go have fun with it. I released it under the BSD license because that was the least restrictive one I could choose. I was also planning on having everything nice and modularized by now, but unfortunately you can’t set! or fluid-let a variable exported by a module. Thus I had to re-write part of the exception handling code so that throw was never directly set, but could still be used like normal. I did get it working and uploaded (version 2), but I have yet modularized the object code.

Posted in Exploring Scheme | Leave a Comment »