1 /* basic - a simple SDL_haa sample
3 * This file is in the public domain, furnished "as is", without technical
4 * support, and with no warranty, express or implied, as to its usefulness for
16 static SDL_Surface *screen;
18 static HAA_Actor *actor;
20 static int degrees = 0;
22 static Uint32 tick(Uint32 interval, void* param)
25 e.type = SDL_VIDEOEXPOSE;
27 degrees = (degrees+2) % 360;
36 res = SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER);
42 screen = SDL_SetVideoMode(0, 0, 16, SDL_SWSURFACE);
45 SDL_TimerID timer = SDL_AddTimer(10, tick, NULL);
46 assert(timer != NULL);
48 actor = HAA_CreateActor(SDL_SWSURFACE, 200, 200, 16);
51 SDL_FillRect(actor->surface, NULL,
52 SDL_MapRGB(actor->surface->format, 0, 255, 0));
54 HAA_SetPosition(actor, 200, 100);
58 while (SDL_WaitEvent(&event)) {
59 if (HAA_FilterEvent(&event) == 0) continue;
64 HAA_SetRotation(actor, HAA_Y_AXIS, degrees, 0, 0, 0);
65 res = HAA_Flip(actor);