#include"../es/es.h" #include "alpha_sdl.h" #define PLUG_NAME "Alpha " #define PLUG_VER "1.0" SDL_Surface *surface = 0; bool exitX = false; void ES_init() { /* first Inittialize the Render Surface */ static int rmask, gmask, bmask, amask; #if SDL_BYTEORDER == SDL_BIG_ENDIAN rmask = 0xff000000; gmask = 0x00ff0000; bmask = 0x0000ff00; amask = 0x000000ff; #else rmask = 0x000000ff; gmask = 0x0000ff00; bmask = 0x00ff0000; amask = 0xff000000; #endif surface = SDL_CreateRGBSurface(SDL_SWSURFACE , 640, 480, 32, rmask, gmask,bmask, amask); // fill rect with nothing SDL_FillRect(surface, 0, 0); Init(); } void ES_quit() { ClearSurfaces(); SDL_FreeSurface(surface); // clean up what we were using } const char *ES_plug_name() { return PLUG_NAME; } const char *ES_plug_version() { return PLUG_VER; } SDL_Surface *ES_render(int *return_value) { // a random color every frame for a example Morph(surface); RandomBlend(); CopyBuffer(surface); if(exitX == true) *return_value = -23; return surface; } void ES_axis_movement(int jid, int axis, int value) { } void ES_button_down(int jid, int button) { if(button == 1) exitX = true; } void ES_button_up(int jid, int button) { }