fix opengl warning

This commit is contained in:
Isaac0-dev 2025-05-29 12:49:38 +10:00
parent 1f2e09da6e
commit 56a5e0b7d2

View file

@ -363,7 +363,7 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(struct ColorC
} }
if ((opt_alpha && opt_dither) || ccf.do_noise) { if ((opt_alpha && opt_dither) || ccf.do_noise) {
append_line(fs_buf, &fs_len, "uniform float uFrameCount;"); append_line(fs_buf, &fs_len, "uniform int uFrameCount;");
append_line(fs_buf, &fs_len, "float random(in vec3 value) {"); append_line(fs_buf, &fs_len, "float random(in vec3 value) {");
append_line(fs_buf, &fs_len, " float random = dot(sin(value), vec3(12.9898, 78.233, 37.719));"); append_line(fs_buf, &fs_len, " float random = dot(sin(value), vec3(12.9898, 78.233, 37.719));");
@ -558,7 +558,7 @@ static struct ShaderProgram *gfx_opengl_create_and_load_new_shader(struct ColorC
} else { } else {
prg->used_lightmap = false; prg->used_lightmap = false;
} }
prg->uniform_locations[6] = glGetUniformLocation(shader_program, "uFilter"); prg->uniform_locations[6] = glGetUniformLocation(shader_program, "uFilter");
return prg; return prg;
@ -706,14 +706,14 @@ static void gfx_opengl_init(void) {
sys_fatal("OpenGL 2.1+ is required.\nReported version: %s%d.%d", is_es ? "ES" : "", vmajor, vminor); sys_fatal("OpenGL 2.1+ is required.\nReported version: %s%d.%d", is_es ? "ES" : "", vmajor, vminor);
glGenBuffers(1, &opengl_vbo); glGenBuffers(1, &opengl_vbo);
glBindBuffer(GL_ARRAY_BUFFER, opengl_vbo); glBindBuffer(GL_ARRAY_BUFFER, opengl_vbo);
if (vmajor >= 3 && !is_es) { if (vmajor >= 3 && !is_es) {
glGenVertexArrays(1, &opengl_vao); glGenVertexArrays(1, &opengl_vao);
glBindVertexArray(opengl_vao); glBindVertexArray(opengl_vao);
} }
glDepthFunc(GL_LEQUAL); glDepthFunc(GL_LEQUAL);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
} }