debug: Añadir logs en inicialización de shaders

Para debuggear problema de pantalla negra en RPi al iniciar con shaders activos.
Logs muestran tamaños de ventana/textura y configuración de uniforms.
This commit is contained in:
2025-10-02 21:40:12 +02:00
parent dcc223d287
commit 54ceaa3042
2 changed files with 9 additions and 6 deletions

View File

@@ -232,6 +232,10 @@ bool OpenGLShader::init(SDL_Window* window,
SDL_GetWindowSize(window_, &window_width_, &window_height_);
SDL_GetTextureSize(back_buffer_, &texture_width_, &texture_height_);
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Inicializando shaders: ventana=%dx%d, textura=%.0fx%.0f",
window_width_, window_height_, texture_width_, texture_height_);
// Verificar que es OpenGL
const char* renderer_name = SDL_GetRendererName(renderer_);
if (!renderer_name || strncmp(renderer_name, "opengl", 6) != 0) {
@@ -287,6 +291,9 @@ bool OpenGLShader::init(SDL_Window* window,
glUseProgram(program_id_);
texture_size_location_ = glGetUniformLocation(program_id_, "TextureSize");
if (texture_size_location_ != -1) {
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
"Configurando TextureSize uniform: %.0fx%.0f",
texture_width_, texture_height_);
glUniform2f(texture_size_location_, texture_width_, texture_height_);
checkGLError("glUniform2f(TextureSize)");
} else {