2 --- main function is here ---
12 int main(int argc, char ** argv)
15 Game9 nineGame = Game9();
17 // rc = nineGame.run();
18 GraphicsDevice graphics;
19 SpriteLoader spriteloader;
21 GraphicsDevice::enter_mode13h();
23 spriteloader.loadFile("C:\\9game\\DJGPP\\sprites\\sprites");
26 printf("debugging info:\n");
27 printf("Width: %ld Height: %ld \n", spriteloader.getWidth(), spriteloader.getHeight());
28 printf("Size: %lu\n" , spriteloader.getSize());
30 // testSprite = spriteloader.getSprite(0,0,110,110);
31 spriteloader.setPalette(graphics);
32 spriteloader.unloadFile();
37 printf("an exception has occurred\n");
39 case SpriteLoader::FileNotLoadedException:
40 printf("Tried to run a function when no file loaded\n");
42 case SpriteLoader::BadFileNameException:
43 printf("File name is not valid\n");
45 case SpriteLoader::BadFileException:
46 printf("This file is bad. makes no sense\n");
48 case SpriteLoader::CannotReadException:
49 printf("This file is not supported\n");
58 // attach keyboard ISR
59 rc = attach_keyboard_handler();
62 detach_keyboard_handler();
66 while(nineGame.finished() == GameManager::NOT_FINISHED)
68 nineGame.processKeys();
69 nineGame.updateState();
70 nineGame.render(graphics);
73 // detach keyboard ISR
74 detach_keyboard_handler();
77 GraphicsDevice::leave_mode13h();