corregits missatges de log en opengl_shader.cpp que no deurien d'eixir en versions release
This commit is contained in:
@@ -257,8 +257,8 @@ auto OpenGLShader::init(SDL_Window* window,
|
|||||||
SDL_GetWindowSize(window_, &window_width_, &window_height_);
|
SDL_GetWindowSize(window_, &window_width_, &window_height_);
|
||||||
SDL_GetTextureSize(back_buffer_, &texture_width_, &texture_height_);
|
SDL_GetTextureSize(back_buffer_, &texture_width_, &texture_height_);
|
||||||
|
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Inicializando shaders: ventana=%dx%d, textura=%.0fx%.0f",
|
"Initializing shaders: window=%dx%d, texture=%.0fx%.0f",
|
||||||
window_width_,
|
window_width_,
|
||||||
window_height_,
|
window_height_,
|
||||||
texture_width_,
|
texture_width_,
|
||||||
@@ -268,7 +268,7 @@ auto OpenGLShader::init(SDL_Window* window,
|
|||||||
const char* renderer_name = SDL_GetRendererName(renderer_);
|
const char* renderer_name = SDL_GetRendererName(renderer_);
|
||||||
if ((renderer_name == nullptr) || strncmp(renderer_name, "opengl", 6) != 0) {
|
if ((renderer_name == nullptr) || strncmp(renderer_name, "opengl", 6) != 0) {
|
||||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Renderer no es OpenGL: %s",
|
"Renderer is not OpenGL: %s",
|
||||||
(renderer_name != nullptr) ? renderer_name : "unknown");
|
(renderer_name != nullptr) ? renderer_name : "unknown");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -277,7 +277,7 @@ auto OpenGLShader::init(SDL_Window* window,
|
|||||||
// Inicializar extensiones OpenGL en Windows/Linux
|
// Inicializar extensiones OpenGL en Windows/Linux
|
||||||
if (!initGLExtensions()) {
|
if (!initGLExtensions()) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Error al inicializar extensiones OpenGL");
|
"Failed to initialize OpenGL extensions");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -294,7 +294,7 @@ auto OpenGLShader::init(SDL_Window* window,
|
|||||||
|
|
||||||
if (vertex_shader == 0 || fragment_shader == 0) {
|
if (vertex_shader == 0 || fragment_shader == 0) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Error al compilar shaders");
|
"Failed to compile shaders");
|
||||||
if (vertex_shader != 0) {
|
if (vertex_shader != 0) {
|
||||||
glDeleteShader(vertex_shader);
|
glDeleteShader(vertex_shader);
|
||||||
}
|
}
|
||||||
@@ -313,7 +313,7 @@ auto OpenGLShader::init(SDL_Window* window,
|
|||||||
|
|
||||||
if (program_id_ == 0) {
|
if (program_id_ == 0) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Error al crear programa de shaders");
|
"Failed to create shader program");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,21 +324,21 @@ auto OpenGLShader::init(SDL_Window* window,
|
|||||||
glUseProgram(program_id_);
|
glUseProgram(program_id_);
|
||||||
texture_size_location_ = glGetUniformLocation(program_id_, "TextureSize");
|
texture_size_location_ = glGetUniformLocation(program_id_, "TextureSize");
|
||||||
if (texture_size_location_ != -1) {
|
if (texture_size_location_ != -1) {
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Configurando TextureSize uniform: %.0fx%.0f",
|
"Configuring TextureSize uniform: %.0fx%.0f",
|
||||||
texture_width_,
|
texture_width_,
|
||||||
texture_height_);
|
texture_height_);
|
||||||
glUniform2f(texture_size_location_, texture_width_, texture_height_);
|
glUniform2f(texture_size_location_, texture_width_, texture_height_);
|
||||||
checkGLError("glUniform2f(TextureSize)");
|
checkGLError("glUniform2f(TextureSize)");
|
||||||
} else {
|
} else {
|
||||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Uniform 'TextureSize' no encontrado en shader");
|
"Uniform 'TextureSize' not found in shader");
|
||||||
}
|
}
|
||||||
glUseProgram(0);
|
glUseProgram(0);
|
||||||
|
|
||||||
is_initialized_ = true;
|
is_initialized_ = true;
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"** OpenGL 3.3 Shader Backend inicializado correctamente");
|
"** OpenGL 3.3 Shader Backend initialized successfully");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user