switch to gdi on failure
This commit is contained in:
parent
6981b51973
commit
1d43b112c9
6 changed files with 34 additions and 19 deletions
13
src/render.c
13
src/render.c
|
@ -24,8 +24,6 @@
|
|||
|
||||
#define TEXTURE_COUNT 4
|
||||
|
||||
char OpenglVersion[128];
|
||||
|
||||
static HGLRC OpenGLContext;
|
||||
static int MaxFPS;
|
||||
static BOOL VSyncEnabled;
|
||||
|
@ -92,6 +90,7 @@ DWORD WINAPI render_main(void)
|
|||
|
||||
if (!UseOpenGL)
|
||||
{
|
||||
ShowDriverWarning = TRUE;
|
||||
ddraw->renderer = render_soft_main;
|
||||
render_soft_main();
|
||||
}
|
||||
|
@ -104,16 +103,6 @@ static HGLRC CreateContext(HDC hdc)
|
|||
HGLRC context = wglCreateContext(hdc);
|
||||
BOOL madeCurrent = context && wglMakeCurrent(hdc, context);
|
||||
|
||||
char *glversion = (char *)glGetString(GL_VERSION);
|
||||
if (glversion)
|
||||
{
|
||||
strncpy(OpenglVersion, glversion, sizeof(OpenglVersion));
|
||||
const char deli[2] = " ";
|
||||
strtok(OpenglVersion, deli);
|
||||
}
|
||||
else
|
||||
OpenglVersion[0] = '0';
|
||||
|
||||
if (!madeCurrent || (ddraw->autorenderer && glGetError() != GL_NO_ERROR))
|
||||
{
|
||||
if (madeCurrent)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue