From 8818954dcd19e6315a576a68c97234e8b4225475 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Fri, 26 Sep 2025 22:45:14 +0200 Subject: [PATCH] afegit define rapidet per a renderer metal basic en macos --- source/screen.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/source/screen.cpp b/source/screen.cpp index b016c1d..fd525a1 100644 --- a/source/screen.cpp +++ b/source/screen.cpp @@ -296,14 +296,25 @@ auto Screen::initSDLVideo() -> bool { // Obtener información de la pantalla getDisplayInfo(); - // Configurar hint para OpenGL + // Configurar hint para renderizado +#ifdef __APPLE__ + if (!SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal")) { + SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, + "Warning: Failed to set Metal hint!"); + } +#else if (!SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl")) { SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "Warning: Failed to set OpenGL hint!"); } +#endif // Crear ventana +#ifdef __APPLE__ + SDL_WindowFlags window_flags = SDL_WINDOW_METAL; +#else SDL_WindowFlags window_flags = SDL_WINDOW_OPENGL; +#endif if (Options::video.fullscreen) { window_flags |= SDL_WINDOW_FULLSCREEN; }