metal: create renderer
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user