glAlphaFunc(GL_GREATER, 128);glDisable( GL_ALPHA_TEST );glEnable(GL_TEXTURE_2D);glClearColor(0.0f, 0.0f, 0.0f, 0.0f);glClearDepth(1.0f); glDepthFunc(GL_LEQUAL);glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);glEnable(GL_DEPTH_TEST);
The next bit of code is part of an adaption of Nehe's tutorial 32 glPrint routine. colourVector[] holds the RGB values for an enumerated colour code. All works fine bar the alpha testing:
glEnable(GL_ALPHA_TEST);glBindTexture(GL_TEXTURE_2D, letters.texID);glColor3fv( colourVector[ GREY ] );glPushMatrix(); glLoadIdentity();glTranslatef(x,y,z); glListBase(lettersBase-32); glCallLists(strlen(text), GL_UNSIGNED_BYTE, text);glPopMatrix(); glDisable(ALPHA_TEST);
I've commented out all other references to blending and alpha testing, but still no joy. The graphics loader is taken from Nehe's tutorial #34.
The game is almost done, and hopefully I will be putting it somewhere come Monday. It's spaghetti code to the max, with coded slapped on and altered everytime I came to the point of adding a new feature to it. Nearly all of it has been coded without any foreward planning, so there's not much in the way of code structure.
My next project will be oh so different. Detailed game analysis & specs, structured code, OO used to the max and swarms of flying pigs. Well, I'll try to have a bit more on paper of how I plan to achieve certain aspects of it.
Please don't sweat about the code - I've managed to get by without the background image. But if there is an obvious mistake, point it out.
Jeroen
edit: changed the typo to [/source]
[edited by - Bigboy on February 28, 2003 9:08:34 AM]