extern uint16_t loading_pixels[]; /* data.asm */
-
int demo_init(int argc, char **argv)
{
- struct screen *scr;
+ if(demo_init1(argc, argv) == -1) {
+ return -1;
+ }
+ if(demo_init2() == -1) {
+ return -1;
+ }
+ return 0;
+}
+
+static struct screen *scr;
+
+int demo_init1(int argc, char **argv)
+{
char *env;
if(load_config("demo.cfg") == -1) {
if(parse_args(argc, argv) == -1) {
return -1;
}
+ return 0;
+}
+int demo_init2(void)
+{
/* reuse the loading image as our back buffer.
* adjust fb_pixels to leave 4 pixels guard band top/bottom. We have enough
* space since the loading image is 8 pixels taller.
extern float sball_matrix[16];
int demo_init(int argc, char **argv);
+int demo_init1(int argc, char **argv);
+int demo_init2(void);
void demo_cleanup(void);
int demo_resizefb(int width, int height, int bpp);
wgl_swap_interval_ext = wglGetProcAddress("wglSwapIntervalEXT");
#endif
- reshape(glutGet(GLUT_WINDOW_WIDTH), glutGet(GLUT_WINDOW_HEIGHT));
-
if(au_init() == -1) {
return 1;
}
time_msec = 0;
- if(demo_init(argc, argv) == -1) {
+ if(demo_init1(argc, argv) == -1) {
return 1;
}
- atexit(demo_cleanup);
if(opt.fullscreen) {
set_fullscreen(opt.fullscreen);
+ reshape(glutGet(GLUT_SCREEN_WIDTH), glutGet(GLUT_SCREEN_HEIGHT));
+ } else {
+ reshape(glutGet(GLUT_WINDOW_WIDTH), glutGet(GLUT_WINDOW_HEIGHT));
}
+ if(demo_init2() == -1) {
+ return 1;
+ }
+ atexit(demo_cleanup);
+
reset_timer();
glutMainLoop();