2010-12-28 01:53:15 +00:00
|
|
|
#include "base.hpp"
|
|
|
|
Application application;
|
|
|
|
|
|
|
|
#include "interface.cpp"
|
|
|
|
|
|
|
|
#include "general/main-window.cpp"
|
|
|
|
|
|
|
|
void Application::main(int argc, char **argv) {
|
|
|
|
quit = false;
|
|
|
|
|
2010-12-30 07:18:47 +00:00
|
|
|
#if defined(PHOENIX_WINDOWS)
|
|
|
|
proportionalFont.create("Tahoma", 8);
|
|
|
|
proportionalFontBold.create("Tahoma", 8, Font::Style::Bold);
|
|
|
|
monospaceFont.create("Courier New", 8);
|
|
|
|
#else
|
|
|
|
proportionalFont.create("Sans", 8);
|
|
|
|
proportionalFontBold.create("Sans", 8, Font::Style::Bold);
|
|
|
|
monospaceFont.create("Liberation Mono", 8);
|
|
|
|
#endif
|
2010-12-28 01:53:15 +00:00
|
|
|
|
2010-12-30 07:18:47 +00:00
|
|
|
mainWindow.create();
|
2010-12-28 01:53:15 +00:00
|
|
|
mainWindow.setVisible();
|
2010-12-30 07:18:47 +00:00
|
|
|
OS::run();
|
2010-12-28 01:53:15 +00:00
|
|
|
|
2010-12-30 07:18:47 +00:00
|
|
|
video.driver("OpenGL");
|
|
|
|
video.set(Video::Handle, (uintptr_t)mainWindow.viewport.handle());
|
2010-12-31 05:43:47 +00:00
|
|
|
video.set(Video::Synchronize, true);
|
2010-12-30 07:18:47 +00:00
|
|
|
video.set(Video::Filter, (unsigned)0);
|
|
|
|
video.init();
|
2010-12-28 01:53:15 +00:00
|
|
|
|
2010-12-30 07:18:47 +00:00
|
|
|
input.driver("SDL");
|
|
|
|
input.set(Input::Handle, (uintptr_t)mainWindow.viewport.handle());
|
|
|
|
input.init();
|
|
|
|
|
|
|
|
GameBoy::system.init(&interface);
|
2010-12-30 07:15:10 +00:00
|
|
|
|
2010-12-28 01:53:15 +00:00
|
|
|
while(quit == false) {
|
|
|
|
OS::run();
|
2010-12-28 06:03:02 +00:00
|
|
|
|
|
|
|
if(GameBoy::cartridge.loaded()) {
|
|
|
|
GameBoy::system.run();
|
|
|
|
}
|
2010-12-28 01:53:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
application.main(argc, argv);
|
|
|
|
return 0;
|
|
|
|
}
|