[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch] Handle 15bpp modes in XGGLPixelFormat
From: |
Alexander Malmberg |
Subject: |
[patch] Handle 15bpp modes in XGGLPixelFormat |
Date: |
Sun, 29 Feb 2004 22:38:35 +0100 |
Spotted this while auditing. The important part, hidden in the
whitespace fixes, is to handle 15 bpp in addition to 16 bpp, and to not
request 6 bits of blue in such modes (in all 16bpp modes I've ever seen,
there are 6 bits of green).
Requesting 5 bits of each component works for 15bpp, and since it's a
minimum size, it should give us 6 bits of green in 16bpp modes.
I can't test this (glX too old), so it would be nice if someone could
confirm that it works.
- Alexander Malmberg
Index: Source/x11/XGGLFormat.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/back/Source/x11/XGGLFormat.m,v
retrieving revision 1.4
diff -u -r1.4 XGGLFormat.m
--- Source/x11/XGGLFormat.m 31 Jul 2003 23:57:11 -0000 1.4
+++ Source/x11/XGGLFormat.m 29 Feb 2004 20:50:14 -0000
@@ -123,31 +123,32 @@
//append(GLX_ACCUM_BLUE_SIZE, *ptr/3);
AccumSize=*ptr;
switch (AccumSize){
- case 8:
+ case 8:
append(GLX_ACCUM_RED_SIZE, 3);
append(GLX_ACCUM_GREEN_SIZE, 3);
append(GLX_ACCUM_BLUE_SIZE, 2);
append(GLX_ACCUM_ALPHA_SIZE, 0);
break;
- case 16:
+ case 15:
+ case 16:
append(GLX_ACCUM_RED_SIZE, 5);
append(GLX_ACCUM_GREEN_SIZE, 5);
- append(GLX_ACCUM_BLUE_SIZE, 6);
+ append(GLX_ACCUM_BLUE_SIZE, 5);
append(GLX_ACCUM_ALPHA_SIZE, 0);
break;
- case 24:
+ case 24:
append(GLX_ACCUM_RED_SIZE, 8);
- append(GLX_ACCUM_GREEN_SIZE, 8);
- append(GLX_ACCUM_BLUE_SIZE, 8);
+ append(GLX_ACCUM_GREEN_SIZE, 8);
+ append(GLX_ACCUM_BLUE_SIZE, 8);
append(GLX_ACCUM_ALPHA_SIZE, 0);
break;
- case 32:
+ case 32:
append(GLX_ACCUM_RED_SIZE, 8);
- append(GLX_ACCUM_GREEN_SIZE, 8);
- append(GLX_ACCUM_BLUE_SIZE, 8);
- append(GLX_ACCUM_ALPHA_SIZE, 8);
+ append(GLX_ACCUM_GREEN_SIZE, 8);
+ append(GLX_ACCUM_BLUE_SIZE, 8);
+ append(GLX_ACCUM_ALPHA_SIZE, 8);
break;
- };
+ };
break;
//can not be handle by X11
case NSOpenGLPFAMinimumPolicy:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [patch] Handle 15bpp modes in XGGLPixelFormat,
Alexander Malmberg <=