mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-22 06:02:28 +01:00
byuu says: Windows port should run mostly well now, although exiting fullscreen breaks the application in a really bizarre way. (clicking on the window makes it sink to background rather than come to the foreground o_O) I also need to add the doModalChange => audio.clear() thing for the accursed menu stuttering with DirectSound. I also finished porting all of the ruby drivers over to the newer API changes from nall. Since I can't compile the Linux or OS X drivers, I have no idea if there are any typos that will result in compilation errors. If so, please let me know where they're at and I'll try and fix them. If they're simple, please try and fix them on your end to test further if you can. I'm hopeful the udev crash will be gone now that nall::string checks for null char* values passed to its stringify function. Of course, it's a problem it's getting a null value in the first place, so it may not work at all. If you can compile on Linux (or by some miracle, OS X), please test each video/audio/input driver if you don't mind, to make sure there's no "compiles okay but still typos exist" bugs.
104 lines
2.2 KiB
C++
104 lines
2.2 KiB
C++
#if defined(Hiro_Application)
|
|
|
|
Application::State Application::state;
|
|
|
|
auto Application::doMain() -> void {
|
|
if(state.onMain) return state.onMain();
|
|
}
|
|
|
|
auto Application::font() -> string {
|
|
return state.font;
|
|
}
|
|
|
|
auto Application::name() -> string {
|
|
return state.name;
|
|
}
|
|
|
|
auto Application::onMain(const function<void ()>& callback) -> void {
|
|
state.onMain = callback;
|
|
}
|
|
|
|
auto Application::run() -> void {
|
|
return pApplication::run();
|
|
}
|
|
|
|
auto Application::pendingEvents() -> bool {
|
|
return pApplication::pendingEvents();
|
|
}
|
|
|
|
auto Application::processEvents() -> void {
|
|
return pApplication::processEvents();
|
|
}
|
|
|
|
auto Application::quit() -> void {
|
|
state.quit = true;
|
|
return pApplication::quit();
|
|
}
|
|
|
|
auto Application::setFont(const string& font) -> void {
|
|
state.font = font;
|
|
}
|
|
|
|
auto Application::setName(const string& name) -> void {
|
|
state.name = name;
|
|
}
|
|
|
|
//Windows
|
|
//=======
|
|
|
|
auto Application::Windows::doModalChange(bool modal) -> void {
|
|
if(state.windows.onModalChange) return state.windows.onModalChange(modal);
|
|
}
|
|
|
|
auto Application::Windows::onModalChange(const function<void (bool)>& callback) -> void {
|
|
state.windows.onModalChange = callback;
|
|
}
|
|
|
|
//Cocoa
|
|
//=====
|
|
|
|
auto Application::Cocoa::doAbout() -> void {
|
|
if(state.cocoa.onAbout) return state.cocoa.onAbout();
|
|
}
|
|
|
|
auto Application::Cocoa::doActivate() -> void {
|
|
if(state.cocoa.onActivate) return state.cocoa.onActivate();
|
|
}
|
|
|
|
auto Application::Cocoa::doPreferences() -> void {
|
|
if(state.cocoa.onPreferences) return state.cocoa.onPreferences();
|
|
}
|
|
|
|
auto Application::Cocoa::doQuit() -> void {
|
|
if(state.cocoa.onQuit) return state.cocoa.onQuit();
|
|
}
|
|
|
|
auto Application::Cocoa::onAbout(const function<void ()>& callback) -> void {
|
|
state.cocoa.onAbout = callback;
|
|
}
|
|
|
|
auto Application::Cocoa::onActivate(const function<void ()>& callback) -> void {
|
|
state.cocoa.onActivate = callback;
|
|
}
|
|
|
|
auto Application::Cocoa::onPreferences(const function<void ()>& callback) -> void {
|
|
state.cocoa.onPreferences = callback;
|
|
}
|
|
|
|
auto Application::Cocoa::onQuit(const function<void ()>& callback) -> void {
|
|
state.cocoa.onQuit = callback;
|
|
}
|
|
|
|
//Internal
|
|
//========
|
|
|
|
auto Application::initialize() -> void {
|
|
static bool initialized = false;
|
|
if(initialized == false) {
|
|
initialized = true;
|
|
return pApplication::initialize();
|
|
}
|
|
}
|
|
|
|
#endif
|