Add Switch game framework target
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
#include "core/game_config.h"
|
||||
#include "scene/whitebox_scene.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include <frostbite2D/core/application.h>
|
||||
#include <frostbite2D/scene/scene_manager.h>
|
||||
#include <switch.h>
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
padConfigureInput(1, HidNpadStyleSet_NpadStandard);
|
||||
|
||||
auto config = frostbite2D::AppConfig::createDefault();
|
||||
config.appName = "NS Unknown Game";
|
||||
config.windowConfig.title = "NS Unknown Game";
|
||||
config.windowConfig.width = ns_game::config::kVirtualWidth;
|
||||
config.windowConfig.height = ns_game::config::kVirtualHeight;
|
||||
config.windowConfig.resizable = false;
|
||||
config.windowConfig.vsync = true;
|
||||
config.useVirtualResolution = true;
|
||||
config.virtualWidth = ns_game::config::kVirtualWidth;
|
||||
config.virtualHeight = ns_game::config::kVirtualHeight;
|
||||
config.resolutionMode = frostbite2D::ResolutionScaleMode::Fit;
|
||||
config.renderStyleProfile = frostbite2D::RenderStyleProfileId::PixelArt2D;
|
||||
config.maxFps = 60;
|
||||
|
||||
auto& app = frostbite2D::Application::get();
|
||||
if (!app.init(config)) {
|
||||
std::puts("NS Unknown Game Switch init failed.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
app.run([]() {
|
||||
frostbite2D::SceneManager::get().ReplaceScene(
|
||||
frostbite2D::MakePtr<ns_game::WhiteboxScene>());
|
||||
});
|
||||
|
||||
app.shutdown();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user