mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 06:04:49 +01:00
fix opengl renderer on older hardware
This commit is contained in:
parent
57287686db
commit
b57ec635fc
@ -231,20 +231,28 @@ 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);
|
||||
|
||||
for (GLint i = 0; i < n; i++)
|
||||
if (glGetError() == GL_NO_ERROR)
|
||||
{
|
||||
char* glext = (char*)glGetStringi(GL_EXTENSIONS, i);
|
||||
got_num_extensions = TRUE;
|
||||
|
||||
if (glext && strcmp(glext, ext) == 0)
|
||||
return TRUE;
|
||||
for (GLint i = 0; i < n; i++)
|
||||
{
|
||||
char* glext = (char*)glGetStringi(GL_EXTENSIONS, i);
|
||||
|
||||
if (glext && strcmp(glext, ext) == 0)
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (!got_num_extensions)
|
||||
{
|
||||
char* glext = (char*)glGetString(GL_EXTENSIONS);
|
||||
|
||||
|
@ -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));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user