Add Windows and Switch build support
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#include <cstdio>
|
||||
|
||||
#include <switch.h>
|
||||
|
||||
#include <frostbite2D/platform/switch.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
consoleInit(nullptr);
|
||||
padConfigureInput(1, HidNpadStyleSet_NpadStandard);
|
||||
|
||||
PadState pad;
|
||||
padInitializeDefault(&pad);
|
||||
|
||||
frostbite2D::switchInit();
|
||||
|
||||
std::printf("Frostbite2D Switch smoke test\n");
|
||||
std::printf("Press PLUS to exit.\n");
|
||||
|
||||
while (appletMainLoop()) {
|
||||
padUpdate(&pad);
|
||||
if (padGetButtonsDown(&pad) & HidNpadButton_Plus) {
|
||||
break;
|
||||
}
|
||||
consoleUpdate(nullptr);
|
||||
}
|
||||
|
||||
frostbite2D::switchShutdown();
|
||||
consoleExit(nullptr);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#include <cstdio>
|
||||
|
||||
#define SDL_MAIN_HANDLED
|
||||
#include <frostbite2D/core/application.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
auto config = frostbite2D::AppConfig::createDefault();
|
||||
config.appName = "Frostbite2D Windows Smoke";
|
||||
config.windowConfig.title = "Frostbite2D Windows Smoke";
|
||||
config.windowConfig.width = 640;
|
||||
config.windowConfig.height = 360;
|
||||
config.windowConfig.resizable = false;
|
||||
config.windowConfig.vsync = false;
|
||||
config.maxFps = 60;
|
||||
|
||||
auto &app = frostbite2D::Application::get();
|
||||
if (!app.init(config)) {
|
||||
std::puts("Frostbite2D Windows smoke init failed.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::puts("Frostbite2D Windows smoke init ok.");
|
||||
app.run([&app]() {
|
||||
app.quit();
|
||||
});
|
||||
app.shutdown();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user