#include <SDL.h>
#include <SDL_haa.h>
-static bool fullscreen = false;
-
static SDL_Surface *screen;
static HAA_Actor *actor;
return interval;
}
-static void setup_video_mode()
-{
- unsigned flags = SDL_SWSURFACE | (fullscreen ? SDL_FULLSCREEN : 0);
- printf("video mode ...\n");
- screen = SDL_SetVideoMode(0, 0, 16, flags);
- assert(screen);
- printf("video mode set\n");
-}
-
int main()
{
int res;
res = HAA_Init(0);
assert(res == 0);
- setup_video_mode();
+ screen = SDL_SetVideoMode(0, 0, 16, SDL_SWSURFACE | SDL_FULLSCREEN);
+ assert(screen);
SDL_TimerID timer = SDL_AddTimer(10, tick, NULL);
assert(timer != NULL);
case SDL_QUIT:
goto quit;
case SDL_VIDEOEXPOSE:
- //HAA_SetRotation(actor, HAA_Y_AXIS, degrees, 0, 0, 0);
+ HAA_SetRotation(actor, HAA_Y_AXIS, degrees, 0, 0, 0);
res = HAA_Flip(actor);
assert(res == 0);
break;
- case SDL_MOUSEBUTTONUP:
- printf("Switching fullscreen\n");
- fullscreen = !fullscreen;
- setup_video_mode();
- break;
}
}
return 0;
}
+