[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54745] trunk/blender/intern/ghost/intern: bge bugfix: [#18967] alpha value is never available in the color buffer by Campbell Barton (X11 ) and me (Win32)

Dalai Felinto dfelinto at gmail.com
Fri Feb 22 08:37:17 CET 2013


Revision: 54745
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54745
Author:   dfelinto
Date:     2013-02-22 07:37:17 +0000 (Fri, 22 Feb 2013)
Log Message:
-----------
bge bugfix: [#18967] alpha value is never available in the color buffer by Campbell Barton (X11) and me (Win32)
This is and old patch (June, 2009). The reason it never made into trunk it's that we (me at least) thought that
it should be optional, as a ui or command-line option.

However, it seems that OSX always have the OpenGL context with alpha enabled. So I think it's consistent to
have the other OSs to follow.

The main usage of this is the BGE (or more specifically people using BGE for TV broadcasting) but I think
pydevs can have their share of fun with it in Blender as well.

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_WindowWin32.cpp
    trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowWin32.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowWin32.cpp	2013-02-22 07:28:45 UTC (rev 54744)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowWin32.cpp	2013-02-22 07:37:17 UTC (rev 54745)
@@ -712,6 +712,7 @@
 		WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB,
 		WGL_COLOR_BITS_ARB, pfd.cColorBits,
 		WGL_DEPTH_BITS_ARB, pfd.cDepthBits,
+		WGL_ALPHA_BITS_ART, pfd.cAlphaBits,
 		WGL_STENCIL_BITS_ARB, pfd.cStencilBits,
 		WGL_DOUBLE_BUFFER_ARB, GL_TRUE,
 		WGL_SAMPLE_BUFFERS_ARB, GL_TRUE,
@@ -1321,6 +1322,9 @@
 
 	weight += pfd.cColorBits - 8;
 
+	if (pdf.cAlphaBits > 0)
+		weight ++;
+
 	/* want swap copy capability -- it matters a lot */
 	if (pfd.dwFlags & PFD_SWAP_COPY) weight += 16;
 

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp	2013-02-22 07:28:45 UTC (rev 54744)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp	2013-02-22 07:37:17 UTC (rev 54745)
@@ -213,6 +213,7 @@
 		attributes[i++] = GLX_BLUE_SIZE;  attributes[i++] = 1;
 		attributes[i++] = GLX_GREEN_SIZE; attributes[i++] = 1;
 		attributes[i++] = GLX_DEPTH_SIZE; attributes[i++] = 1;
+		attributes[i++] = GLX_ALPHA_SIZE; attributes[i++] = 1;
 		/* GLX >= 1.4 required for multi-sample */
 		if (samples && (glxVersionMajor >= 1) && (glxVersionMinor >= 4)) {
 			attributes[i++] = GLX_SAMPLE_BUFFERS; attributes[i++] = 1;




More information about the Bf-blender-cvs mailing list