OpenGL context under X11 now picks up the best possible framebuffer that includes an alpha mask in the X visual info. The code is currently disabled as it needs more debugging.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36815 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ivucica 2013-07-03 09:36:29 +00:00
parent 430751201b
commit ed31e1321a
4 changed files with 41 additions and 7 deletions

View file

@ -1,3 +1,12 @@
2013-07-03 Ivan Vucica <ivan@vucica.net>
* Source/x11/XGGLContext.m:
* Source/x11/XGGLFormat.m:
* Headers/x11/XGOpenGL.h:
OpenGL context under X11 now picks up the best possible
framebuffer that includes an alpha mask in the X visual info.
The code is currently disabled as it needs more debugging.
2013-06-27 German A. Arias <german@xelalug.org>
* Source/x11/XGServerEvent.m (-processEvent:): Don't add events

View file

@ -58,8 +58,8 @@
{
Display * display;
long int glxminorversion;
GLXFBConfig *fbconfig;
XVisualInfo *visualinfo;
GLXFBConfig *fbconfig; int pickedFBConfig;
XVisualInfo *visualinfo;
int configurationCount;
}

View file

@ -282,7 +282,7 @@ static XGGLContext *currentGLContext;
MAKE_DISPLAY(dpy);
if (currentGLContext == self)
{
{
[XGGLContext clearCurrentContext];
}

View file

@ -39,6 +39,10 @@
#include <X11/Xlib.h>
#include <math.h>
#ifdef XRENDER
#include <X11/extensions/Xrender.h>
#endif
@implementation XGGLPixelFormat
+ (int) glxMinorVersion
@ -85,7 +89,7 @@
if (glxminorversion >= 3)
{
error = glXGetFBConfigAttrib(display, fbconfig[0], attrib, vals);
error = glXGetFBConfigAttrib(display, fbconfig[pickedFBConfig], attrib, vals);
if ( error != 0 )
NSDebugMLLog( @"GLX", @"Can not get FB attribute for pixel format %@ - Error %u",
self, error );
@ -344,7 +348,28 @@ do \
[glxAttributes mutableBytes],
&configurationCount);
visualinfo = glXGetVisualFromFBConfig(display,fbconfig[0]);
#if defined(XRENDER) && 0
int i;
for (i = 0; i < configurationCount; i++)
{
XVisualInfo * vinfo = glXGetVisualFromFBConfig(display, fbconfig[i]);
XRenderPictFormat* pictFormat = XRenderFindVisualFormat (display, vinfo->visual);
if (NULL != pictFormat
&& (pictFormat->type == PictTypeDirect)
&& (pictFormat->direct.alphaMask))
{
pickedFBConfig = i;
visualinfo = vinfo;
break;
}
}
#endif
if(!visualinfo && configurationCount > 0)
{
visualinfo = glXGetVisualFromFBConfig(display,fbconfig[0]);
pickedFBConfig = 0;
}
}
else
{
@ -384,7 +409,7 @@ do \
if (glxminorversion >= 3)
{
context = glXCreateNewContext(display, fbconfig[0],
context = glXCreateNewContext(display, fbconfig[pickedFBConfig],
GLX_RGBA_TYPE, [share glxcontext], YES);
}
else
@ -410,7 +435,7 @@ do \
if (glxminorversion >= 3)
{
win = glXCreateWindow(display, fbconfig[0], xwindowid, NULL);
win = glXCreateWindow(display, fbconfig[pickedFBConfig], xwindowid, NULL);
}
else
{