summaryrefslogtreecommitdiff
path: root/hw/xwin/glx/indirect.c
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2012-02-05 20:08:23 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2012-02-05 20:08:23 +0000
commit6c2ed1dea3f3c935c67d53d17be9da82506f97b0 (patch)
tree758cb0bb25a2b4ef199fec65ef00b1554f70eddd /hw/xwin/glx/indirect.c
parent8bdd96726009f79bc3209ded4e8ebc1a05e544c8 (diff)
parent0f1d8defe5b0fc676a7cbd09675d0d694b887426 (diff)
Merge branch 'cygwin-patches-for-1.11' into cygwin-release-1.11xserver-cygwin-1.11.4-3
Diffstat (limited to 'hw/xwin/glx/indirect.c')
-rw-r--r--hw/xwin/glx/indirect.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index a5b225102..0873c5e4a 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -469,7 +469,7 @@ static void
glxLogExtensions(const char *prefix, const char *extensions)
{
int length = 0;
- char *strl;
+ const char *strl;
char *str = strdup(extensions);
if (str == NULL)
@@ -515,6 +515,7 @@ glxWinScreenProbe(ScreenPtr pScreen)
{
glxWinScreen *screen;
const char *gl_extensions;
+ const char *gl_renderer;
const char *wgl_extensions;
HWND hwnd;
HDC hdc;
@@ -538,14 +539,6 @@ glxWinScreenProbe(ScreenPtr pScreen)
if (NULL == screen)
return NULL;
- /* Wrap RealizeWindow, UnrealizeWindow and CopyWindow on this screen */
- screen->RealizeWindow = pScreen->RealizeWindow;
- pScreen->RealizeWindow = glxWinRealizeWindow;
- screen->UnrealizeWindow = pScreen->UnrealizeWindow;
- pScreen->UnrealizeWindow = glxWinUnrealizeWindow;
- screen->CopyWindow = pScreen->CopyWindow;
- pScreen->CopyWindow = glxWinCopyWindow;
-
/* Dump out some useful information about the native renderer */
// create window class
@@ -592,13 +585,21 @@ glxWinScreenProbe(ScreenPtr pScreen)
ErrorF("GL_VERSION: %s\n", glGetStringWrapperNonstatic(GL_VERSION));
ErrorF("GL_VENDOR: %s\n", glGetStringWrapperNonstatic(GL_VENDOR));
- ErrorF("GL_RENDERER: %s\n", glGetStringWrapperNonstatic(GL_RENDERER));
+ gl_renderer = (const char *)glGetStringWrapperNonstatic(GL_RENDERER);
+ ErrorF("GL_RENDERER: %s\n", gl_renderer);
gl_extensions = (const char *)glGetStringWrapperNonstatic(GL_EXTENSIONS);
glxLogExtensions("GL_EXTENSIONS: ", gl_extensions);
wgl_extensions = wglGetExtensionsStringARBWrapper(hdc);
if (!wgl_extensions) wgl_extensions = "";
glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions);
+ if (strcasecmp(gl_renderer, "GDI Generic") == 0)
+ {
+ free(screen);
+ LogMessage(X_ERROR,"AIGLX: Won't use generic native renderer as it is not accelerated\n");
+ return NULL;
+ }
+
// Can you see the problem here? The extensions string is DC specific
// Different DCs for windows on a multimonitor system driven by multiple cards
// might have completely different capabilities. Of course, good luck getting
@@ -716,9 +717,6 @@ glxWinScreenProbe(ScreenPtr pScreen)
__glXScreenInit(&screen->base, pScreen);
- // dump out fbConfigs now fbConfigIds and visualIDs have been assigned
- fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs);
-
// Override the GL extensions string set by __glXScreenInit()
screen->base.GLextensions = strdup(gl_extensions);
@@ -762,6 +760,17 @@ glxWinScreenProbe(ScreenPtr pScreen)
ReleaseDC(hwnd, hdc);
DestroyWindow(hwnd);
+ // dump out fbConfigs now fbConfigIds and visualIDs have been assigned
+ fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs);
+
+ /* Wrap RealizeWindow, UnrealizeWindow and CopyWindow on this screen */
+ screen->RealizeWindow = pScreen->RealizeWindow;
+ pScreen->RealizeWindow = glxWinRealizeWindow;
+ screen->UnrealizeWindow = pScreen->UnrealizeWindow;
+ pScreen->UnrealizeWindow = glxWinUnrealizeWindow;
+ screen->CopyWindow = pScreen->CopyWindow;
+ pScreen->CopyWindow = glxWinCopyWindow;
+
return &screen->base;
}