fix: Dejar que SDL elija OpenGL automáticamente en Linux
- Windows: opengl + 3.3 Core Profile explícito - Linux: opengl sin atributos, SDL elige: * Desktop 3.3 en PC con GPU normal * ES 3.0 en RPi automáticamente Resuelve problema de colores invertidos (azul->naranja) causado por forzar opengles2.
This commit is contained in:
@@ -349,24 +349,20 @@ auto Screen::initSDLVideo() -> bool {
|
||||
}
|
||||
#else
|
||||
// Configurar hint de render driver
|
||||
#ifdef _WIN32
|
||||
// Windows: Usar OpenGL Desktop
|
||||
if (!SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl")) {
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"Warning: Failed to set OpenGL hint!");
|
||||
}
|
||||
// Pedir explícitamente OpenGL 3.3 Core Profile
|
||||
|
||||
#ifdef _WIN32
|
||||
// Windows: Pedir explícitamente OpenGL 3.3 Core Profile
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Solicitando OpenGL 3.3 Core Profile");
|
||||
#else
|
||||
// Linux/RPi: Intentar OpenGL ES primero
|
||||
if (!SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengles2,opengl")) {
|
||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||
"Warning: Failed to set OpenGL ES hint!");
|
||||
}
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Solicitando OpenGL ES (fallback a OpenGL Desktop)");
|
||||
// Linux: Dejar que SDL elija (Desktop 3.3 en PC, ES 3.0 en RPi automáticamente)
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Usando OpenGL por defecto del sistema");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user