1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-26 02:19:24 +01:00

only check texture if no error

This commit is contained in:
FunkyFr3sh 2024-08-03 08:57:38 +02:00
parent 663743b49f
commit b50ff36ffc

View File

@ -120,9 +120,11 @@ DWORD WINAPI ogl_render_main(void)
GL_CHECK(ogl_init_shader1_program()); GL_CHECK(ogl_init_shader1_program());
GL_CHECK(ogl_init_shader2_program()); GL_CHECK(ogl_init_shader2_program());
g_ogl.got_error = g_ogl.got_error || (err = glGetError()) != GL_NO_ERROR;
GL_CHECK(g_ogl.got_error = g_ogl.got_error || !ogl_texture_upload_test()); GL_CHECK(g_ogl.got_error = g_ogl.got_error || !ogl_texture_upload_test());
GL_CHECK(g_ogl.got_error = g_ogl.got_error || !ogl_shader_test()); GL_CHECK(g_ogl.got_error = g_ogl.got_error || !ogl_shader_test());
g_ogl.got_error = g_ogl.got_error || (err = glGetError()) != GL_NO_ERROR; g_ogl.got_error = g_ogl.got_error || (err = glGetError()) != GL_NO_ERROR;
g_ogl.use_opengl = (g_ogl.main_program || g_ddraw.bpp == 16 || g_ddraw.bpp == 32) && !g_ogl.got_error; g_ogl.use_opengl = (g_ogl.main_program || g_ddraw.bpp == 16 || g_ddraw.bpp == 32) && !g_ogl.got_error;
GL_CHECK(ogl_render()); GL_CHECK(ogl_render());
@ -1546,6 +1548,8 @@ static BOOL ogl_shader_test()
glBindTexture(GL_TEXTURE_2D, fbo_tex_id); glBindTexture(GL_TEXTURE_2D, fbo_tex_id);
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, surface_tex); glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, surface_tex);
if (glGetError() == GL_NO_ERROR)
{
int i; int i;
for (i = 0; i < g_ogl.surface_tex_height * g_ogl.surface_tex_width; i++) for (i = 0; i < g_ogl.surface_tex_height * g_ogl.surface_tex_width; i++)
{ {
@ -1556,6 +1560,7 @@ static BOOL ogl_shader_test()
} }
} }
} }
}
glBindTexture(GL_TEXTURE_2D, 0); glBindTexture(GL_TEXTURE_2D, 0);