Previous 199869 Revisions Next

r36250 Thursday 5th March, 2015 at 01:44:07 UTC by Couriersud
Swap interval for baseline opengl.
I can't test this. Neither virtualbox nor wine seem to support WGL
Extensions. (nw)
[src/osd/modules/render]drawogl.c

trunk/src/osd/modules/render/drawogl.c
r244761r244762
204204      this->pfn_wglDeleteContext = (BOOL (WINAPI *)(HGLRC hglrc)) GetProcAddress(m_module, "wglDeleteContext");
205205      this->pfn_wglMakeCurrent = (BOOL (WINAPI *)(HDC hdc, HGLRC hglrc)) GetProcAddress(m_module, "wglMakeCurrent");
206206
207      this->pfn_wglGetExtensionsStringEXT = (const char *(WINAPI *) (void)) pfn_wglGetProcAddress("wglGetExtensionsStringEXT");
208
209      if (WGLExtensionSupported("WGL_EXT_swap_control"))
210      {
211         this->pfn_wglSwapIntervalEXT = (BOOL (WINAPI *) (int)) getProcAddress("wglSwapIntervalEXT");
212         this->pfn_wglGetSwapIntervalEXT = (int (WINAPI *) (void)) getProcAddress("wglGetSwapIntervalEXT");
213      }
214      else
215      {
216         pfn_wglSwapIntervalEXT = NULL;
217         pfn_wglGetSwapIntervalEXT = NULL;
218      }
219
207220      m_hdc = GetDC(window);
208221      if (!setupPixelFormat(m_hdc))
209222      {
r244761r244762
246259
247260   virtual int SetSwapInterval(const int swap)
248261   {
249      // FIXME: Missing!
262      if (this->pfn_wglSwapIntervalEXT != NULL)
263      {
264         this->pfn_wglSwapIntervalEXT(swap ? 1 : 0);
265      }
250266      return 0;
251267   }
252268
r244761r244762
300316       return 0;
301317   }
302318
319   bool WGLExtensionSupported(const char *extension_name)
320   {
321       //if (pfn_wglGetExtensionsStringEXT != NULL)
322       //   printf("%s\n", this->pfn_wglGetExtensionsStringEXT());
303323
324       if (pfn_wglGetExtensionsStringEXT != NULL && strstr(pfn_wglGetExtensionsStringEXT(), extension_name) != NULL)
325           return true;
326       else
327          return false;
328   }
329
304330   HGLRC m_context;
305331   HWND m_window;
306332   HDC m_hdc;
r244761r244762
311337   BOOL (WINAPI *pfn_wglDeleteContext)(HGLRC hglrc);
312338   BOOL (WINAPI *pfn_wglMakeCurrent)(HDC hdc, HGLRC hglrc);
313339
340   const char *(WINAPI *pfn_wglGetExtensionsStringEXT) (void);
341   BOOL (WINAPI *pfn_wglSwapIntervalEXT) (int interval);
342   int (WINAPI * pfn_wglGetSwapIntervalEXT) (void);
343
314344   static HMODULE m_module;
315345};
316346


Previous 199869 Revisions Next


© 1997-2024 The MAME Team