WHOOPS! I spent a good bit of time today tracking down the problem on Linux. On Windows it's fairly simple: the code isn't implemented yet. The Windows code is found starting around line 174 of freeglut_windows.c; it doesn't mention alphas at all. For that matter, I don't see much about red, green, or blue bits independently of each other either. There is something in there about color bits.
Digging through the help file (I selected the "PIXELFORMATDESCRIPTOR" ekyword and pressed F1 for help) I find the following helpful message:
Specifies the number of alpha bitplanes in each RGBA color buffer. Alpha bitplanes are not supported.
I'm pretty sure this is why I didn't put the alpha support in when I went over this part of the code earlier. Does this indeed mean that we are out of luck in this department?
John F. Fay
Technical Fellow, Jacobs/Sverdrup TEAS Group
From: email@example.com [mailto:firstname.lastname@example.org] On Behalf Of Ashwin Nanjappa
Sent: Saturday, June 24, 2006 6:53 AM
Subject: [Freeglut-bugs] FreeGLUT alpha problem
I'm trying to move from Nate Robins' GLUT to FreeGLUT on Windows.
There seems to be some problem with FreeGLUT, I'm always seeing the framebuffer's alpha values being set to 1.0, even though I'm rendering with alpha 0.0.
I've given a simple C++ program below which depicts the problem. When I use glut, the alpha values on the framebuffer are 0.0. When I use FreeGLUT, they are always set to 1.0.
Why is this? Is there some ALPHA setting I'm missing?
#include <GL/freeglut.h> // use <GL/glut.h> for GLUT #include <imdebug.h>
static const unsigned int WIN_POS_X = 50; static const unsigned int WIN_POS_Y = WIN_POS_X; static const unsigned int WIN_WIDTH = 640; static const unsigned int WIN_HEIGHT = WIN_WIDTH;
void initGl(int, char **);
void reshape(int, int);
int main(int argc, char * argv)
void initGl(int argc, char ** argv)
// Set white as clear color
glClearColor(1.0, 1.0, 1.0, 0.0);
gluPerspective(45.0, WIN_WIDTH / WIN_HEIGHT, 1.0, 2000.0);
gluLookAt( 0.0, 0.0, 600.0,
0.0, 0.0, 0.0,
0.0, 1.0, 0.0);
// Render front model in light
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor4f(0.0, 1.0, 0.0, 0.0);
// imdebug debugging
GLubyte * buf = new GLubyte[4 * WIN_WIDTH * WIN_HEIGHT];
glReadPixels(0, 0, WIN_WIDTH, WIN_HEIGHT, GL_RGBA,
imdebug("rgba w=%d h=%d %p", WIN_WIDTH, WIN_HEIGHT, buf);
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Freeglut-bugs mailing list