Warhome - Yes, really




The Godhead: FutureBasic
Example Code

Godhead (-hed`) n. 1. godhood; divinity 2. The focal point or object of worship.

About FutureBasic

FutureBasic (FB) is a Macintosh programming language developed by Staz Software. It is used by a variety of professionals and hobbyists around the world to develop software for the Mac. But then again you already knew that.

Source Code Samples

Everything you are looking at here is probably in some way related to games. The whole reason I learned programming was to try to make a game. I should have started out trying to make a tic-tac-toe program, because I drowned out there for a long time. The following tables contain complete project and small code examples of things that I learned and felt others might find useful. Some of these have made me quite popular in the FB programming circles, which is pretty cool.

Permission is given to copy, modify, and reuse the source code here as you see fit, provided you don't claim ownership to any of it. I'd be dearly interested in seeing any projects you develop that use any code you found on my site :-) Please enjoy and have fun with it!

= FutureBasic II code only
= FutureBasic^3 code only
= Code for both versions included
Add-On Libraries
Name FB Version Description Size(K)
MIDWorld 5 - Midi Playing Library This is an add-on library for FB that gives excellent MIDI music control to your program. Perfect for games and multimedia apps that need background music. webpage
MIDWorld Lite This is an add-on library for FB3 that gives simple MIDI music control to your program. Its a free slimmed down version of MIDWorld 5. webpage
Gamma Fading Library An extremely useful add-on library for both FB2 and FB^3 which let's you fade the monitor under any bit depth with one call. webpage

Open Source Projects
Name FB Version Description Size(K)
Edtris The application and source code to Edtris, a fun little Tetris game. Its a complete program from graphics to high scores. An important case study if you are new to game programming. Webpage
Fish Tank Project The source code to a FishTank program. Shows copybits animation and a tinting effect you can get with QuickDraw by setting the foreground colors. 46k.
Fish Tank^3 Project Same as the above project by reworked to compile in FB^3 for you. Also, this one uses the new EnterProc functions in FB^3 that are simply awesome :-) 46k.
DeskPane Project This fascinating project will magnify portions of your desktop with copybits and GWorlds. 8k.
Warp Project This project is a converted pascal program that generates an animated starfield. 4k.
Trippy 2 Project Source to Trippy 2.x for FB2. This mind boggling project will rotate the screen colors like mad using color cycling. Includes more than a dozen color palettes which are chosen randomly for cycling. 32k.
Trippy^3 Project Source to Trippy 3 for FB^3. Trippy 3 works a little differently than Trippy 2 and has some improvements to it...not to mention all the functions work in FB^3. 51k.
Kill Your Monitor Project This project is a screen saver that smashes holes in the desktop with a wrecking ball. 110k
HandBall Project This is a fairly complete example of a Pong game. Uses GWorlds and copybits for animation. 80k
PictCDEF Project A very simple project for FB2 that compiles a CDEF which allows you to use PICTs as buttons. Various examples included. 14k
FireWorks Project A fireworks generating screen saver. Uses ultra fast direct to screen drawing when run in 256 colors mode. Its really cool. 7k
FireWorks^3 Project Same as above, but with repairs to the menu hiding routines to function in PowerPC mode. Various other things have been fixed up in FB^3 for you. 7k
Fire Project This one will blow your mind as to how I did it. A realtime fire generating screen saver. Some parts are in assembly for speed and this program also does direct-to-screen drawing if possible. The project includes both Derek's and Joe Kovac's version of Fire (Joe rewrote a huge amount of it for maximum speed and bug fixes) including Fire4, which has a proper speed limiter. 33k.
OpenGL Renderer Info 1.1 This is a ported Apple sample project that queries the gl software to determine what kinds of interesting things your graphics hardware can do. This version is error free under Release 2 and also grabs the Renderer string from gl's string table. 22k.
USB QuickProbe 1.1 All of the FB^3 USB headers and libraries and code to scan the USB bus for everything under the sun. You may be surprised what kinds of things come up in the scan, I learned I had two USB channels! (1.1 now checks for the presence of the USB manager to prevent a crash on Macs without USB) 40k.

Code Snippet Examples
Name FB Version Description Size(K)
Copybits Fade Example How to fade images with copybits. Fades only a window or part of a window if you'd like. Very useful example. 150k.
Copybits Fade Example This is the above example in FB^3. There were quite a few changes needed to convert over, so I've done it for you. 133k.
Direct To Screen Drawing Example Some extensive source code that demonstrates how to draw directly to video memory. Somebody seems to have made a similar project in FB2, but this one has been lying around for ages on my hard drive (I guess that makes it venerable?). Be careful, it may crash some configurations! 3k.
DrawSprocket Context Example 1.1 This is a quick and easy port of some Apple sample code for DrawSprocket. This code grabs a monitor context and proceeds to activate it and get it ready for drawing into. PPC only. 9k.
InputSprocket Example A test program developed while porting over InputSprockets to FB^3. Shows how to bring up the Configure dialog and how to check for inputs from a controller. PPC only. 13k.
MOD Music Example A really cool example of playing MOD music in FB3 with libraries built by Codewarrior. PPC only. Webpage
Palette Animation Example A fully functioning demonstration of color animation. Includes the FN CycleCLUT. 63k
Pixelation Example FB^3 function that will do a pixelation transition effect between two gworlds. Simple and gives nice results. 120k
Resolution Switching Example This example shows how to switch the monitor resolution using QuickTime. Useful for movie playback, among other things. 4k
Transparent DrawPicture Example A way to call DrawPicture with transparency. Kludgy, but it works. 45k.
VBL Task Example A small project that explains the Vertical Retrace Manager and shows how to install and remove a task in PowerPC and 68k code. 6k.
VBL - Sync to Video 1.1 A small project that builds on the previous VBL example by creating a persistant slot-based VBL task that is tied to the monitor's refresh rate...any monitor's! PowerPC only. 6k.

This FutureBASIC site owned by Derek Smith.
[ Previous 5 Sites | Previous | Next | Next 5 Sites | Random Site | List Sites ]

Thanks for checking out this page. If you find anything on this page useful or find any errors or know of a better way to do something, please drop us a line at dereksmi@hawaii.edu.

Click for more information!

More files that only my friends and I would find interesting than anywhere else!

MacCutTrack 1.0
Edtris 2.1.1
Crazy-8 1.0.4

About Us
Source Code

  My latest rant
  Boxed faggus

© 2000 by a naked man who ran into my room, typed some stuff, and then ran out again.