peach library specifications ------------------------------------------------@/

a small 2D game library, made via SDL.
it should be easily usable in C, and provide the following features:
	*	drawing sprites
		-	plus the ability to draw only certain portions of sprites
		-	with 2D graphics transformations, to offset sprites
		-	with transparency/blending
	*	audio playback (not implemented... look it up urself :p)

function layout -------------------------------------------------------------@/

system functions:
	peach_init(int win_width, int win_height) -> void
	peach_close() -> void
	peach_processMessage() -> bool
	_peach_error(int lineno, const char* filename, const char* message) -> void

	*	peach_init() initializes peach and creates a window of the size
		win_width and win_height.
	*	peach_processMessage() acknowledges OS window events. it also
		returns false if the user attempted to close the window, or true
		otherwise.
	*	peach_close() closes peach.
	*	_peach_error() prints out an error, and prints the file that errored,
		line number, and a user-defined message. It's not meant to be called by
		the user, but by the macro PEACH_ERROR() (explained later), so it has
		an underscore in it's name.

graph functions:
	peach_graph_LoadFile(const char* filename) -> CPeachGraph* gr
	peach_graph_close(CPeachGraph* gr) -> void;
	peach_graph_drawPart(CPeachGraph* gr, int sx, int sy, int sw, int sh, int dx, int dy, int flip) -> void
	peach_graph_draw(CPeachGraph* gr, int x, int y, int flip) -> void

renderer functions:
	peach_drawstateGet() -> CDrawstate*
	peach_drawstate_push() -> void
	peach_drawstate_pop() -> void
	peach_drawstate_reset() -> void
	peach_drawstate_translate(float x, float y) -> void
	peach_drawstate_blendReset() -> void
	peach_drawstate_blendSet(int mode) -> void

	peach_draw_rect(CPeachColor color, int x, int y, int w, int h) -> void
	peach_draw_clear(CPeachColor color) -> void
	peach_draw_sync() -> void

renderer --------------------------------------------------------------------@/
rendering's all 2D, no consideration is needed for 3D.

to deal with coordinate transformations, a drawstate structure is used.
each drawstate contains the following:
	*	X translation
	*	Y translation
	*	blend mode

the drawstate's blend mode can be one of the following:
	PEACH_DRAWBLEND_NONE  : no blending
	PEACH_DRAWBLEND_ALPHA : alpha blending
	PEACH_DRAWBLEND_ADD   : additive blending

this X/Y translation is to allow the user to keep offsets for all their
rendering; for example, when rendering both characters and the background for a
game, there is no need to go draw_character(chr, x + screen_scrollX, y +
screen_scrollY) for every object, but to simply use
peach_draw_translate(screen_scrollX,screen_scrollY) before drawing.

the drawstate is stored in a stack of drawstates, so the user may quickly edit
the current one, then pop it to restore it back to it's original state.

when popping the drawstate, peach has to make sure to get SDL to re-apply the
previous drawstate's blend mode!

peach_draw_sync() is used to wait for the next frame. In peach_init, vsync
may be used, though it's rather unstable, as it means that peach_draw_sync()
waits depending on the refresh rate of the player's monitor. Because of this,
during peach_draw_sync(), we wait for the next frame to start the old fashioned
way.

resources -------------------------------------------------------------------@/
All resources (sounds, images, etc.) are comprised of a CPeachResource
structure, followed by resource-independent data, such as texture pointers,
audio data, and the like.

CPeachResource:
	alive: bool
	id: uint32_t

CPeachGraph:
	basersrc: CPeachResource
	size_x: short
	size_y: short
	texture_hnd: SDL_Texture*

error handling --------------------------------------------------------------@/
To print out an error, the PEACH_ERROR(msg) macro is used. It's specifically a
macro and not a function, as it uses C's __FILE__ and __LINE__ directives to
get the name of the file that called it. This is so you can easily view the
exact line number of the file that errored, rather than a vague approximation.

Assertions are done via the PEACH_ASSERT(cond,msg) macro. It's logic is dead
simple: 
	if(cond):
		PEACH_ERROR(msg)
It's used in conjunction with PEACH_ERROR for error checking.

