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:

<quote>
cAlphaBits
Specifies the number of alpha bitplanes in each RGBA color buffer. Alpha bitplanes are not supported.
</quote>

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
850-883-1294
john.fay@eglin.af.mil
 
-----Original Message-----
From: freeglut-bugs-bounces@lists.sourceforge.net [mailto:freeglut-bugs-bounces@lists.sourceforge.net] On Behalf Of Ashwin Nanjappa

Sent: Saturday, June 24, 2006 6:53 AM
To: freeglut-bugs@lists.sourceforge.net
Subject: [Freeglut-bugs] FreeGLUT alpha problem

Hi,

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?

TIA,
~ash

//=======================================================
#include <stdlib.h>
#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 display();
void initGl(int, char **);
void reshape(int, int);
void glUpdate();

int main(int argc, char * argv[])
{
        initGl(argc, argv);
        glutMainLoop();

        return 0;

}

void initGl(int argc, char ** argv)
{
        glutInit(&argc, argv);
        glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGBA|GLUT_DEPTH|GLUT_ALPHA);
        glutInitWindowPosition(WIN_POS_X, WIN_POS_Y);
        glutInitWindowSize(WIN_WIDTH, WIN_HEIGHT);
        glutCreateWindow("FreeGLUT example");

        // Set white as clear color
        glClearColor(1.0, 1.0, 1.0, 0.0);
        glShadeModel(GL_SMOOTH);
        glEnable(GL_DEPTH_TEST);

        glutDisplayFunc(display);

        return;

}

void display()
{
        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
        gluPerspective(45.0, WIN_WIDTH / WIN_HEIGHT, 1.0, 2000.0);
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();
        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);
        glutSolidCube(60.0);

        // imdebug debugging
#if 1
        GLubyte * buf = new GLubyte[4 * WIN_WIDTH * WIN_HEIGHT];
        glReadPixels(0, 0, WIN_WIDTH, WIN_HEIGHT, GL_RGBA,
                                         GL_UNSIGNED_BYTE, buf);
        imdebug("rgba w=%d h=%d %p", WIN_WIDTH, WIN_HEIGHT, buf);
        delete(buf);
#endif

        glutSwapBuffers();

        return;
}

//=======================================================

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

http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freeglut-bugs mailing list
Freeglut-bugs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freeglut-bugs