Hi, Attached is a small example (test4.cpp) of using the Qt OpenGL widget to draw a white filled triangle. I was hoping that someone else could try it out and see if they get the same results I do. Here is a table of what I see: Video Rendering Method Result TDFX 3500 DRI Glide Direct Looks OK TDFX 3500 DRI Indirect Blank window TDFX 3500 Mesa 3.5 Looks OK Mach 64 DRI Indirect Triangle is shifted to the right Mach 64 Mesa 3.5 Looks OK This is using RH 7.1 and the 0.5 DRI release. A GLUT implementation (test5.c) looks OK in all cases. Thanks, Allen
#include <iostream> #include <qapplication.h> #include <qgl.h> class GLView : public QGLWidget { void initializeGL ( void ) { cout << "Mesa GL version: " << glGetString( GL_RENDERER ) << " " << glGetString( GL_VERSION ) << endl; cout << "Mesa GLU version: " << gluGetString( GLU_VERSION ) << endl; } void resizeGL ( int width, int height ) { glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); glOrtho( -1., 1., -1., 1., -1., 1. ); } void paintGL ( void ) { glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); glBegin( GL_POLYGON ); glVertex3f( 0., 0., 0. ); glVertex3f( 1., 0., 0. ); glVertex3f( 0., 1., 0. ); glEnd(); } }; int main ( int argc, char* argv[] ) { QApplication test4( argc, argv ); GLView view; test4.setMainWidget( &view ); view.resize( 300, 300 ); view.show(); return test4.exec(); }
/* * Simple test */ #include <stdio.h> #include <GL/glut.h> void init ( void ) { glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); glOrtho( -1., 1., -1., 1., -1., 1. ); } void display ( void ) { glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); glBegin( GL_POLYGON ); glVertex3f( 0., 0., 0. ); glVertex3f( 1., 0., 0. ); glVertex3f( 0., 1., 0. ); glEnd(); glutSwapBuffers(); } int main ( int argc, char* argv[] ) { glutInit( &argc, argv ); glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH ); glutInitWindowSize( 300, 300 ); glutCreateWindow( argv[0] ); init(); printf( "Mesa GL Version: %s %s\n", glGetString( GL_RENDERER ), glGetString( GL_VERSION ) ); glutDisplayFunc( display ); glutMainLoop(); return 0; }