Hi list !

If a post something that have been reported many times, Im sorry.
But I searched to google and to this ML's archive and didn't find
anything close to what I got.

Ive coded a little game (ensemblist, hosted at savannah), and I just
realized that the game does not work on my new laptop (dell d600, with a
radeon 9000 vide card).

Ive spent my week end to get a simple code that reveal the bug, and
there it is n attachment.

Symptom : after several call to the display function (about 30), the
computer start freezing (strace last words : mmaping something).

The incredible thing here is how the bug is related to the alpha channel
: in the exemple below, if I change the glColor4f by a glColor3f or,
more incredibly by a glcolor4f(r,g,b, 1.), then there is no freeze
anymore. I hope this rings a bell.

Here is the code (wich display nothing, but quit without freezing on
all computers I tested it on, except the dell with the radeon card.
If you want to know if DRI is installed OK on the dell : yes, and quake
3 runs incredibly smooth :-)


#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#include <stdio.h>
#include <stdio.h>
#include <stdio.h>
#include <stdio.h>
#include <stdio.h>
#include <stdio.h>
#include <stdio.h>
#include <GL/glut.h>
#include <GL/glx.h>
#include <GL/gl.h>

unsigned glut_interval = 50;	/* msec */

GLfloat points[] = {
-1.16672,0.80168,-0.201248,
-1.20596,0.870454,-0.00743363,
-1.07598,1.02177,-0.00743363
};
GLuint faces[] = {
0,1,2
};

void glut_display() {
	/* without this, it does not freeze */
	glEnableClientState(GL_VERTEX_ARRAY);
	glVertexPointer(3, GL_FLOAT, 0, points);
	glDrawElements(GL_TRIANGLES, 1*3, GL_UNSIGNED_INT, faces);
	
	glEnable(GL_BLEND);	// optionnal
	/* turn this glColor4f to a glColor3f, or make it a glColor4f(r,g,b, 1.), and it won't freeze */
	glColor4f(.2,.1,.5,.2);
	/* remove the and it wont freeze neither */
	glEnableClientState(GL_VERTEX_ARRAY);
	glVertexPointer(3, GL_FLOAT, 0, points);
	glDrawElements(GL_TRIANGLES, 1*3, GL_UNSIGNED_INT, faces);
	glDisable(GL_BLEND);	// optionnal

	static int count = 0;
	printf("%d\n", count++);
}

static void glut_key(unsigned char c, int x, int y) {
	exit(0);
}

static void glut_timer(int timer) {
	glutPostRedisplay();
	glutTimerFunc(glut_interval, glut_timer, timer);
}

int main(int nb_args, char **args) {
	glutInit(&nb_args, args);
	glutInitWindowSize(800, 600);
	glutInitWindowPosition(-1,-1);
	glutInitDisplayMode(GLUT_RGBA);
	glutCreateWindow("FreezeMe");
	glutDisplayFunc(glut_display);
	glutKeyboardFunc(glut_key);
	glutTimerFunc(glut_interval, glut_timer, 1);
	glutMainLoop();
	return 0;
}

Reply via email to