metal: create renderer

This commit is contained in:
Samuliak
2024-08-16 11:06:23 +02:00
parent 98b5d56021
commit 58e1a53699
7 changed files with 34 additions and 8 deletions

View File

@@ -67,6 +67,16 @@ FrontendSDL::FrontendSDL() : keyboardMappings(InputMappings::defaultKeyboardMapp
}
#endif
#ifdef PANDA3DS_ENABLE_METAL
if (config.rendererType == RendererType::Metal) {
window = SDL_CreateWindow("Alber", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 400, 480, SDL_WINDOW_METAL | SDL_WINDOW_RESIZABLE);
if (window == nullptr) {
Helpers::warn("Window creation failed: %s", SDL_GetError());
}
}
#endif
emu.initGraphicsContext(window);
}
@@ -286,7 +296,7 @@ void FrontendSDL::run() {
}
break;
}
case SDL_CONTROLLERSENSORUPDATE: {
if (event.csensor.sensor == SDL_SENSOR_GYRO) {
auto rotation = Gyro::SDL::convertRotation({
@@ -370,4 +380,4 @@ void FrontendSDL::setupControllerSensors(SDL_GameController* controller) {
if (haveGyro) {
SDL_GameControllerSetSensorEnabled(controller, SDL_SENSOR_GYRO, SDL_TRUE);
}
}
}