======================================================
	easyChipmunk Documentation
	By Alex "Oz" Barry, 2010 - alex.barry@gmail.com
======================================================

[[ Introduction ]]
	Most of the useful documentation is written directly in easyChipmunk.bi, so this is more of a guide
	for you to follow on how to implement the header into your code.  This is not in any way part of
	the official chipmunk distribution, so you'll find a lack of support from slembcke directly.
	
[[ Usage ]]
	This is the most basic format to include this header into a program:

		#include "easyChipmunk.bi"
	
		dim physics as easyChipmunk = easyChipmunk()				' Create a new easyChipmunk instance with the default constructor
	
		' Do initial setup of the instance
		physics.lock()
			physics.physicsRate = 60								' It's always good to explicitly set this, but the default is 60, too!
			physics.space->gravity = cpv( 0, 50 )					' Set the gravity
			physics.space->damping = 1.0							' Set the space's damping value
			cpSpaceResizeActiveHash( physics.space, 30.0, 10000 )	' Rehash the space - may not be absolutely necessary...
		physics.unlock()
	
		' ...
	
		physics.lock()
			' Add any shapes and bodies into the simulation
		physics.unlock
	
		' ...
	
		physics.lock()
			physics.pause = 0	' Make sure the simulation is ready to run!
		physics.unlock()
		do
			physics.simulate()	' Advance the simulation
			physics.lock()		' Lock the physics
				screenlock()	' Lock the screen
					cls			' Clear the screen
					' Draw simulation
				screenunlock()	' Unlock the screen
				' Handle any events that pertain to the physics...
			physics.unlock()	' Unlock the physics
			sleep 1, 1 ' Don't have the CPU
		loop
	
		end 0

	Hopefully that's not confusing.  Even if you know that there is no threading support when you compile the
	program, PLEASE still use physics.lock() / physics.unlock()!  This just makes sure that the code is
	consistent on any platform it's compiled for.  Also, make sure you call physics.simulate() at the beginning
	of your loop, for the same reason as above!

[[ Better Documentation ]]
	TYPE easyChipmunk
		FUNCTION	isUsingThread
						Checks to see if the instance is running with thread support.
						Returns 0 for no, 1 for yes
		
		SUB			simulate
						Advances the simulation by the elapsed time (internally calculated).  This should be
						called every loop, whether or not threads are being used, or even if the simulation
						is paused.
						
		PROPERTY	physicsTick
						Can return the current physicsTick hertz value, or sets the physics tick.  If it the
						physics tick is set, the deltatime is also calculated and set
						
		PROPERTY	deltaTime
						Read-only deltaTime is returned.  _deltaTime is calculated internally
		
		SUB			unlock/lock
						Lock/unlocks the physics thread.  This should be called any time any part of the easyChipmunk
						is being modified on any level.  Each lock must be followed by an unlock!  Freebasic, AFAIK,
						does not support nested mutex locking, so be careful!
						
		cpSpace		space
						This is a pointer to the space being simulated.  You'll need to use this variable any time
						shapes or bodies are being added to the space.
						
		double		currentTime
						Variable to keep track of the last time the simulation was updated.  Do not modify this variable!
						
		double		accumulator
						Number of seconds the simulation needs to catch up on.  Do not modify this variable!
						
		ubyte		pause
						A flag variable to determine if there should be a simulation step during the loop.  0 means the
						simulation should advance, and a non-zero value means it should not advance.  Be careful using
						this variable!  By default, the simulation is paused, so be sure to unpause it before the main
						loop.

[[ More Support ]]
	If you need more help, you can post an issue on the google code page ( http://code.google.com/p/chipmunk-freebasic ),
	or you can email me directly at alex.barry@gmail.com, where I'll get back to you as soon as possible.
