From 7f00942517ee4d3dae8f880918e61ee6223d4451 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Wed, 10 Sep 2025 20:44:10 +0200 Subject: [PATCH] treballant en metal --- source/screen.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/source/screen.cpp b/source/screen.cpp index e80f554..5ae077d 100644 --- a/source/screen.cpp +++ b/source/screen.cpp @@ -296,17 +296,29 @@ auto Screen::initSDLVideo() -> bool { // Obtener información de la pantalla getDisplayInfo(); +#ifdef __APPLE__ + // Configurar hint para Metal + if (!SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal")) { + SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, + "Warning: Failed to set Metal hint!"); + } + // Configurar flags para la creación de la ventana + SDL_WindowFlags window_flags = SDL_WINDOW_METAL; +#else // NOT APPLE // Configurar hint para OpenGL if (!SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl")) { SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "Warning: Failed to set OpenGL hint!"); } - - // Crear ventana + // Configurar flags para la creación de la ventana SDL_WindowFlags window_flags = SDL_WINDOW_OPENGL; +#endif + // Configurar flags para la creación de la ventana if (Options::video.fullscreen) { window_flags |= SDL_WINDOW_FULLSCREEN; } + + // Crear ventana window_ = SDL_CreateWindow( Options::window.caption.c_str(), param.game.width * Options::window.zoom,