1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-25 10:07:47 +01:00

fix opengl renderer on older hardware

This commit is contained in:
FunkyFr3sh 2024-09-27 18:11:07 +02:00
parent 57287686db
commit b57ec635fc
2 changed files with 15 additions and 5 deletions

View File

@ -231,11 +231,17 @@ void oglu_init()
BOOL oglu_ext_exists(char* ext, HDC hdc)
{
BOOL got_num_extensions = FALSE;
if (glGetIntegerv && glGetStringi)
{
GLint n = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &n);
if (glGetError() == GL_NO_ERROR)
{
got_num_extensions = TRUE;
for (GLint i = 0; i < n; i++)
{
char* glext = (char*)glGetStringi(GL_EXTENSIONS, i);
@ -244,7 +250,9 @@ BOOL oglu_ext_exists(char* ext, HDC hdc)
return TRUE;
}
}
else
}
if (!got_num_extensions)
{
char* glext = (char*)glGetString(GL_EXTENSIONS);

View File

@ -111,6 +111,8 @@ DWORD WINAPI ogl_render_main(void)
{
GL_CHECK(oglu_init());
g_ogl.got_error = g_ogl.got_error || (err = glGetError()) != GL_NO_ERROR;
BOOL got_swap_ctrl;
GL_CHECK(got_swap_ctrl = oglu_ext_exists("WGL_EXT_swap_control", g_ogl.hdc));