mxSDL: Trippin

mxSDL: Trippin is a simple program that does a software based alpha blend on two images I drew . These images are Something I drew while under the Influence of LSD hehe (SDL/SDL) The alpha blending does some neat effects heres a sceen shot as well as the source code.
These images are the most popular downloads on my site, to check out the LostSideDead head's stats go to  http://lostsidedead.com/stats


 



// Trippin a Pyschedelic Alpha blend effect
// comment out the below line if not running in debug mode
//#define MXDEBUG_MODE
#include "mxSDL.h"

class Trippin : public EventHandler {

public:

	Trippin() {
		if(!(lsd1.LoadBMP("lsd.bmp")))

			throw ErrorMsg("Error Couldnt Load Bitmap lsd.bmp");

		if(!(lsd2.LoadBMP("lsd2.bmp")))

			throw ErrorMsg("Error Couldnt Load Bitmap lsd2.bmp");

		if(!(arial.LoadFNT("arial.mxf")))

			throw ErrorMsg("Error couldnt load mxFont arial.mxf");

	}

	virtual void Event(SDL_Event &e) {

	}

	virtual void KeyDown(int key) {
		switch(key) {

			case SDLK_ESCAPE:
				mx->Quit();
				break;
		}
	
	}
	virtual void KeyUp(int key) {
	
	}

	virtual void Render() {
		static float blend_state = 1.0f;

		mx->AlphaBlend(&lsd1, &lsd2, 0,0,640,480, blend_state);

		blend_state += 0.1f;
		mx->PrintTextSized(arial.GetFont(),0,0,25,25,mxRGB(mx->GetFront(), 0,0,0),"Alpha State %f\n Cursor Pos (%d, %d)", blend_state, mx->mouse_x, mx->mouse_y);
	}

protected:
	mxSurface lsd1, lsd2;
	mxText arial;
};



int main(int argc, char **argv) {
	try {

		mxSDL mxsdl("Trippin Alpha Blend", 640,480, 0, false);

		mxsdl.SetEvents( new Trippin );
		mxsdl.MessagePump();
	}

	catch (ErrorMsg &e) {
		e.PrintLastError();
	}
	return 0;
}