1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

add option to create opengl core context

This commit is contained in:
FunkyFr3sh 2022-09-24 01:41:18 +02:00
parent 3b69255158
commit 1186c9cc00
3 changed files with 8 additions and 0 deletions

View File

@ -139,6 +139,7 @@ typedef struct CNCDDRAW
BOOL fpupreserve;
BOOL allow_wmactivate;
int d3d9_adapter;
BOOL opengl_core;
BOOL accurate_timers;
BOOL resizable;
BOOL nonexclusive;

View File

@ -51,6 +51,7 @@ void cfg_load()
g_ddraw->fpupreserve = cfg_get_bool("fpupreserve", FALSE);
g_ddraw->allow_wmactivate = cfg_get_bool("allow_wmactivate", FALSE);
g_ddraw->d3d9_adapter = cfg_get_int("d3d9_adapter", 0);
g_ddraw->opengl_core = cfg_get_bool("opengl_core", FALSE);
cfg_get_string("screenshotdir", ".\\Screenshots\\", g_ddraw->screenshot_dir, sizeof(g_ddraw->screenshot_dir));
if (g_ddraw->locktopleft)
@ -352,6 +353,7 @@ static void cfg_create_ini()
"\n"
"; Undocumented settings\n"
"d3d9_adapter=0\n"
"opengl_core=false\n"
"d3d9on12=false\n"
"game_handles_close=false\n"
"accuratetimers=false\n"

View File

@ -214,6 +214,11 @@ void oglu_init()
g_oglu_got_version3 = FALSE;
wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)xwglGetProcAddress("wglCreateContextAttribsARB");
}
if (g_ddraw->opengl_core)
{
wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)xwglGetProcAddress("wglCreateContextAttribsARB");
}
}
BOOL oglu_ext_exists(char* ext, HDC hdc)