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,