Hello,
This is an example from an opengl tutorial that I'm trying out. If I run it
with LIBGL_ALWAYS_INDIRECT it works fine, but with direct rendering I just
get a blank window. I'm using the radeon driver from recent CVS (checked
out yesterday anonymously) on a Dell Inspiron 4150 w/Radeon Mobility M7.
Any ideas?
Thanks,
-n8
--
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->
/*
gcc -o ex5 ex5.c -L/usr/X11R6/lib -I/usr/X11R6/include -lX11 -lGL -lGLU -lglut -lm
*/
#include <stdio.h>
#include <GL/glut.h>
void display (void) {
/* Called when OpenGL needs to update the display */
glClear (GL_COLOR_BUFFER_BIT); /* Clear the window */
glLoadIdentity ();
gluLookAt (0.0, 0.0, 5.0, /* Pos of camera */
0.0, 0.0, 0.0, /* Target to look at */
0.0, 1.0, 0.0); /* "up" vector */
glutWireCube(2.0);
}
void keyboard (unsigned char key, int x, int y) {
/* Called when a key is pressed */
if (key == 27) exit(0); /* 27 is Escape */
else printf("You pressed '%c' with the mouse at (%i, %i)\n", key, x, y);
}
void reshape (int w, int h) {
/* Called when the window is created, moved, or resized */
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION); /* Select the projection matrix */
glLoadIdentity(); /* Initialize it */
gluPerspective(60, (GLfloat)w / (GLfloat)h, 1.0, 100.0);
glMatrixMode (GL_MODELVIEW); /* Select the modelview matrix */
}
int main (int argc, char** argv) {
glutInit (&argc, argv);
glutInitWindowSize (500, 500);
glutInitWindowPosition(100,100);
glutCreateWindow ("ex5");
glutDisplayFunc (display); /* Register the display callback */
glutReshapeFunc (reshape); /* Register the reshape callback */
glutKeyboardFunc (keyboard); /* Register the keyboard callback */
/* Note that glutKeyboardFunc only works for keys with single
ascii codes. Arrow keys won't work. For that use
glutSpecialFunc */
glutMainLoop ();
return 0;
}