summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd
diff options
context:
space:
mode:
author couriersud <couriersud@arcor.de>2015-03-05 02:44:07 +0100
committer couriersud <couriersud@arcor.de>2015-03-05 02:44:07 +0100
commit8477b99c8c683cf29000bb65a18912095d4aea69 (patch)
tree4bc0b6c663482beafd1214d0e75097ca1f055f83 /src/osd
parent972de7ee3ded59291af636bb6231556afa5b3109 (diff)
Swap interval for baseline opengl.
I can't test this. Neither virtualbox nor wine seem to support WGL Extensions. (nw)
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/modules/render/drawogl.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/osd/modules/render/drawogl.c b/src/osd/modules/render/drawogl.c
index 860d33ae1a8..328310ba9c6 100644
--- a/src/osd/modules/render/drawogl.c
+++ b/src/osd/modules/render/drawogl.c
@@ -204,6 +204,19 @@ public:
this->pfn_wglDeleteContext = (BOOL (WINAPI *)(HGLRC hglrc)) GetProcAddress(m_module, "wglDeleteContext");
this->pfn_wglMakeCurrent = (BOOL (WINAPI *)(HDC hdc, HGLRC hglrc)) GetProcAddress(m_module, "wglMakeCurrent");
+ this->pfn_wglGetExtensionsStringEXT = (const char *(WINAPI *) (void)) pfn_wglGetProcAddress("wglGetExtensionsStringEXT");
+
+ if (WGLExtensionSupported("WGL_EXT_swap_control"))
+ {
+ this->pfn_wglSwapIntervalEXT = (BOOL (WINAPI *) (int)) getProcAddress("wglSwapIntervalEXT");
+ this->pfn_wglGetSwapIntervalEXT = (int (WINAPI *) (void)) getProcAddress("wglGetSwapIntervalEXT");
+ }
+ else
+ {
+ pfn_wglSwapIntervalEXT = NULL;
+ pfn_wglGetSwapIntervalEXT = NULL;
+ }
+
m_hdc = GetDC(window);
if (!setupPixelFormat(m_hdc))
{
@@ -246,7 +259,10 @@ public:
virtual int SetSwapInterval(const int swap)
{
- // FIXME: Missing!
+ if (this->pfn_wglSwapIntervalEXT != NULL)
+ {
+ this->pfn_wglSwapIntervalEXT(swap ? 1 : 0);
+ }
return 0;
}
@@ -300,6 +316,16 @@ private:
return 0;
}
+ bool WGLExtensionSupported(const char *extension_name)
+ {
+ //if (pfn_wglGetExtensionsStringEXT != NULL)
+ // printf("%s\n", this->pfn_wglGetExtensionsStringEXT());
+
+ if (pfn_wglGetExtensionsStringEXT != NULL && strstr(pfn_wglGetExtensionsStringEXT(), extension_name) != NULL)
+ return true;
+ else
+ return false;
+ }
HGLRC m_context;
HWND m_window;
@@ -311,6 +337,10 @@ private:
BOOL (WINAPI *pfn_wglDeleteContext)(HGLRC hglrc);
BOOL (WINAPI *pfn_wglMakeCurrent)(HDC hdc, HGLRC hglrc);
+ const char *(WINAPI *pfn_wglGetExtensionsStringEXT) (void);
+ BOOL (WINAPI *pfn_wglSwapIntervalEXT) (int interval);
+ int (WINAPI * pfn_wglGetSwapIntervalEXT) (void);
+
static HMODULE m_module;
};