Commit 33143672 authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

winex11.drv: Opengl init fix.

parent 37df23db
...@@ -1124,6 +1124,11 @@ BOOL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev, ...@@ -1124,6 +1124,11 @@ BOOL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev,
const PIXELFORMATDESCRIPTOR *ppfd) { const PIXELFORMATDESCRIPTOR *ppfd) {
TRACE("(%p,%d,%p)\n", physDev, iPixelFormat, ppfd); TRACE("(%p,%d,%p)\n", physDev, iPixelFormat, ppfd);
if (!has_opengl()) {
ERR("No libGL on this box - disabling OpenGL support !\n");
return 0;
}
/* At the moment we only support the pixelformat corresponding to the main /* At the moment we only support the pixelformat corresponding to the main
* x11drv visual which got created at x11drv initialization. More formats * x11drv visual which got created at x11drv initialization. More formats
* can be supported if there was a way to recreate x11 windows in x11drv * can be supported if there was a way to recreate x11 windows in x11drv
...@@ -1198,6 +1203,11 @@ HGLRC X11DRV_wglCreateContext(X11DRV_PDEVICE *physDev) ...@@ -1198,6 +1203,11 @@ HGLRC X11DRV_wglCreateContext(X11DRV_PDEVICE *physDev)
TRACE("(%p)->(PF:%d)\n", hdc, hdcPF); TRACE("(%p)->(PF:%d)\n", hdc, hdcPF);
if (!has_opengl()) {
ERR("No libGL on this box - disabling OpenGL support !\n");
return 0;
}
/* First, get the visual in use by the X11DRV */ /* First, get the visual in use by the X11DRV */
if (!gdi_display) return 0; if (!gdi_display) return 0;
...@@ -1253,6 +1263,11 @@ BOOL X11DRV_wglDeleteContext(HGLRC hglrc) ...@@ -1253,6 +1263,11 @@ BOOL X11DRV_wglDeleteContext(HGLRC hglrc)
TRACE("(%p)\n", hglrc); TRACE("(%p)\n", hglrc);
if (!has_opengl()) {
ERR("No libGL on this box - disabling OpenGL support !\n");
return 0;
}
wine_tsx11_lock(); wine_tsx11_lock();
/* A game (Half Life not to name it) deletes twice the same context, /* A game (Half Life not to name it) deletes twice the same context,
* so make sure it is valid first */ * so make sure it is valid first */
...@@ -1299,6 +1314,11 @@ PROC X11DRV_wglGetProcAddress(LPCSTR lpszProc) ...@@ -1299,6 +1314,11 @@ PROC X11DRV_wglGetProcAddress(LPCSTR lpszProc)
if (padding < 0) if (padding < 0)
padding = 0; padding = 0;
if (!has_opengl()) {
ERR("No libGL on this box - disabling OpenGL support !\n");
return 0;
}
/* Check the table of WGL extensions to see if we need to return a WGL extension /* Check the table of WGL extensions to see if we need to return a WGL extension
* or a function pointer to a native OpenGL function. */ * or a function pointer to a native OpenGL function. */
if(strncmp(lpszProc, "wgl", 3) != 0) { if(strncmp(lpszProc, "wgl", 3) != 0) {
...@@ -1329,6 +1349,11 @@ BOOL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) { ...@@ -1329,6 +1349,11 @@ BOOL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) {
TRACE("(%p,%p)\n", hdc, hglrc); TRACE("(%p,%p)\n", hdc, hglrc);
if (!has_opengl()) {
ERR("No libGL on this box - disabling OpenGL support !\n");
return 0;
}
wine_tsx11_lock(); wine_tsx11_lock();
if (hglrc == NULL) { if (hglrc == NULL) {
ret = pglXMakeCurrent(gdi_display, None, NULL); ret = pglXMakeCurrent(gdi_display, None, NULL);
...@@ -1381,6 +1406,11 @@ BOOL X11DRV_wglMakeContextCurrentARB(X11DRV_PDEVICE* hDrawDev, X11DRV_PDEVICE* h ...@@ -1381,6 +1406,11 @@ BOOL X11DRV_wglMakeContextCurrentARB(X11DRV_PDEVICE* hDrawDev, X11DRV_PDEVICE* h
BOOL ret; BOOL ret;
TRACE("(%p,%p,%p)\n", hDrawDev, hReadDev, hglrc); TRACE("(%p,%p,%p)\n", hDrawDev, hReadDev, hglrc);
if (!has_opengl()) {
ERR("No libGL on this box - disabling OpenGL support !\n");
return 0;
}
wine_tsx11_lock(); wine_tsx11_lock();
if (hglrc == NULL) { if (hglrc == NULL) {
ret = pglXMakeCurrent(gdi_display, None, NULL); ret = pglXMakeCurrent(gdi_display, None, NULL);
...@@ -1414,6 +1444,11 @@ BOOL X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) { ...@@ -1414,6 +1444,11 @@ BOOL X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) {
TRACE("(%p, %p)\n", org, dest); TRACE("(%p, %p)\n", org, dest);
if (!has_opengl()) {
ERR("No libGL on this box - disabling OpenGL support !\n");
return 0;
}
if (NULL != dest && dest->ctx != NULL) { if (NULL != dest && dest->ctx != NULL) {
ERR("Could not share display lists, context already created !\n"); ERR("Could not share display lists, context already created !\n");
return FALSE; return FALSE;
...@@ -1553,6 +1588,11 @@ BOOL X11DRV_wglUseFontBitmapsA(X11DRV_PDEVICE *physDev, DWORD first, DWORD count ...@@ -1553,6 +1588,11 @@ BOOL X11DRV_wglUseFontBitmapsA(X11DRV_PDEVICE *physDev, DWORD first, DWORD count
TRACE("(%p, %d, %d, %d) using font %ld\n", physDev->hdc, first, count, listBase, fid); TRACE("(%p, %d, %d, %d) using font %ld\n", physDev->hdc, first, count, listBase, fid);
if (!has_opengl()) {
ERR("No libGL on this box - disabling OpenGL support !\n");
return 0;
}
if (fid == 0) { if (fid == 0) {
return internal_wglUseFontBitmaps(physDev->hdc, first, count, listBase, GetGlyphOutlineA); return internal_wglUseFontBitmaps(physDev->hdc, first, count, listBase, GetGlyphOutlineA);
} }
...@@ -1571,6 +1611,11 @@ BOOL X11DRV_wglUseFontBitmapsW(X11DRV_PDEVICE *physDev, DWORD first, DWORD count ...@@ -1571,6 +1611,11 @@ BOOL X11DRV_wglUseFontBitmapsW(X11DRV_PDEVICE *physDev, DWORD first, DWORD count
TRACE("(%p, %d, %d, %d) using font %ld\n", physDev->hdc, first, count, listBase, fid); TRACE("(%p, %d, %d, %d) using font %ld\n", physDev->hdc, first, count, listBase, fid);
if (!has_opengl()) {
ERR("No libGL on this box - disabling OpenGL support !\n");
return 0;
}
if (fid == 0) { if (fid == 0) {
return internal_wglUseFontBitmaps(physDev->hdc, first, count, listBase, GetGlyphOutlineW); return internal_wglUseFontBitmaps(physDev->hdc, first, count, listBase, GetGlyphOutlineW);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment