DXGL r872 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r871‎ | r872 | r873 >
Date:23:48, 28 September 2018
Author:admin
Status:new
Tags:
Comment:
Add fallback stub functions for wglSwapIntervalEXT and wglGetSwapIntervalEXT for compatibility with old versions of Mesa.
Modified paths:
  • /ddraw/glExtensions.c (modified) (history)

Diff [purge]

Index: ddraw/glExtensions.c
@@ -19,6 +19,17 @@
2020 #include "glExtensions.h"
2121 extern DXGLCFG dxglcfg;
2222
 23+static int stubswapinterval = 1;
 24+static BOOL APIENTRY wglSwapIntervalEXTStub(GLint interval)
 25+{
 26+ stubswapinterval = interval;
 27+ return FALSE;
 28+}
 29+static GLint APIENTRY wglGetSwapIntervalEXTStub()
 30+{
 31+ return stubswapinterval;
 32+}
 33+
2334 void glExtensions_Init(glExtensions *ext)
2435 {
2536 const GLubyte *glversion;
@@ -231,4 +242,9 @@
232243 }
233244 ext->wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
234245 ext->wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)wglGetProcAddress("wglGetSwapIntervalEXT");
 246+ if((!ext->wglSwapIntervalEXT) || (!ext->wglGetSwapIntervalEXT))
 247+ {
 248+ ext->wglSwapIntervalEXT = wglSwapIntervalEXTStub;
 249+ ext->wglGetSwapIntervalEXT = wglGetSwapIntervalEXTStub;
 250+ }
235251 }