Using glBitmap with ATI DRI driver while the depth test is on
is resulting in randomly passing/failing each bit, resulting
in garbage. There are patterns in the pass/fail that make it look
like a depth lookup is occuring, but in a messed up way.
Here is a quick demo. Can some other ATI user test this out?
I am using a current CVS XFree86 on a Radeon. The 4.2 release
was completely unstable for my Radeon.
Joe Krahn
-----------------------------------
glbitmapbug.c:
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <GL/glut.h>
GLboolean depth=GL_FALSE;
void gprint(int x, int y, char *fmt, ... ) {
va_list ap;
char string[256];
int i;
va_start(ap, fmt);
vsprintf(string, fmt, ap);
va_end(ap);
glRasterPos2i(x, y);
for (i = 0; i < strlen(string); i++)
glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, string[i]);
}
void key(unsigned char key, int x, int y) {
if (key == 27) { exit(0); }
if (key=='z'){
depth=!depth;
if (depth)printf("Enabling depth test.\n");
else printf("Disabling depth test.\n");
glutPostRedisplay();
}
}
int width,height;
void reshape(int w, int h){
width=w; height=h;
glViewport(-0.1,-0.1,w,h);
glMatrixMode(GL_PROJECTION_MATRIX);
glLoadIdentity();
gluOrtho2D(0,w,h,0);
glutPostRedisplay();
}
void display(void)
{
int i;
if (depth) glEnable(GL_DEPTH_TEST);
else glDisable(GL_DEPTH_TEST);
glDrawBuffer(GL_FRONT);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glColor3f(1,0.5,0.5);
gprint (10,20,"Press 'z' to toggle depth test.\n");
for(i=40;i<250;i++)
gprint (10,i,"XXXXXXXXXXXXXX");
glFlush();
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
glutCreateWindow("Bitmap BUG test");
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(key);
glutMainLoop();
return 0;
}
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert