mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-23 11:51:27 +00:00
ARGB visual is only picked if NSOpenGLPFAAlphaSize is specified in the pixel format.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@36821 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
774b5092bd
commit
9a67894038
3 changed files with 24 additions and 6 deletions
|
@ -1,3 +1,10 @@
|
|||
2013-07-03 Ivan Vucica <ivan@vucica.net>
|
||||
|
||||
* Source/x11/XGGLFormat.m:
|
||||
* Headers/x11/XGOpenGL.h:
|
||||
ARGB visual is only picked if NSOpenGLPFAAlphaSize is
|
||||
specified in the pixel format.
|
||||
|
||||
2013-07-03 Ivan Vucica <ivan@vucica.net>
|
||||
|
||||
* Source/x11/XGGLContext.m:
|
||||
|
|
|
@ -58,9 +58,14 @@
|
|||
{
|
||||
Display * display;
|
||||
long int glxminorversion;
|
||||
GLXFBConfig *fbconfig; int pickedFBConfig;
|
||||
XVisualInfo *visualinfo;
|
||||
|
||||
GLXFBConfig *fbconfig;
|
||||
int pickedFBConfig;
|
||||
int configurationCount;
|
||||
BOOL shouldRequestARGBVisual;
|
||||
|
||||
XVisualInfo *visualinfo;
|
||||
|
||||
}
|
||||
|
||||
+ (int) glxMinorVersion;
|
||||
|
|
|
@ -108,6 +108,8 @@
|
|||
int AccumSize;
|
||||
NSOpenGLPixelFormatAttribute *ptr = pixelFormatAttributes;
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
|
||||
shouldRequestARGBVisual = NO;
|
||||
|
||||
#define append(a, b) \
|
||||
do \
|
||||
|
@ -180,6 +182,8 @@ do \
|
|||
{
|
||||
ptr++;
|
||||
append(GLX_ALPHA_SIZE, *ptr);
|
||||
if (*ptr > 0)
|
||||
shouldRequestARGBVisual = YES;
|
||||
break;
|
||||
}
|
||||
case NSOpenGLPFADepthSize:
|
||||
|
@ -348,15 +352,17 @@ do \
|
|||
[glxAttributes mutableBytes],
|
||||
&configurationCount);
|
||||
|
||||
#if defined(XRENDER) && 0
|
||||
#if defined(XRENDER)
|
||||
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))
|
||||
if ((NULL != pictFormat
|
||||
&& (pictFormat->type == PictTypeDirect)
|
||||
&& (pictFormat->direct.alphaMask))
|
||||
||
|
||||
!shouldRequestARGBVisual)
|
||||
{
|
||||
pickedFBConfig = i;
|
||||
visualinfo = vinfo;
|
||||
|
|
Loading…
Reference in a new issue