Hello,

I have started to develop a 3D viewer on a computer, and I would like to test it on another one. Both of them are under ubuntu lucid lynx. Unfortunately, on the second computer, the QGLWidget is blank. I have made up a minimal application that doesn't work neither on that second computer :

Qt Code:
  1. #ifndef GLVIEWER_H
  2. #define GLVIEWER_H
  3. #include <QtOpenGL/qgl.h>
  4.  
  5. class GLViewer : public QGLWidget {
  6.  
  7. public:
  8. GLViewer(QWidget * parent = 0);
  9. ~GLViewer();
  10.  
  11. protected:
  12. int viewport[4];
  13.  
  14. void initializeGL();
  15. void resizeGL (int width, int height);
  16. void paintGL();
  17.  
  18.  
  19. };
  20.  
  21. #endif // GLVIEWER_H
To copy to clipboard, switch view to plain text mode 

and

Qt Code:
  1. #include "GLViewer.h"
  2.  
  3. GLViewer::GLViewer(QWidget * parent)
  4. : QGLWidget(parent)
  5. {
  6.  
  7. }
  8.  
  9. GLViewer::~GLViewer() {
  10.  
  11. }
  12.  
  13. void GLViewer::initializeGL() {
  14.  
  15. }
  16.  
  17. void GLViewer::resizeGL(int width, int height) {
  18. viewport[0] = 0;
  19. viewport[1] = 0;
  20. viewport[2] = width;
  21. viewport[3] = height;
  22. glViewport(0, 0, width, height);
  23. }
  24.  
  25. void GLViewer::paintGL() {
  26. glClearColor(1,1,1,1);
  27. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  28. glMatrixMode(GL_PROJECTION);
  29. glLoadIdentity();
  30. glOrtho(-1.0, 1.0, -1.0, 1.0, 0, 1);
  31. glMatrixMode(GL_MODELVIEW);
  32. glLoadIdentity();
  33. glColor3f(0.0f, 0.0f, 1.0f);
  34. glBegin(GL_TRIANGLES);
  35. glVertex3f(0,0,.5);
  36. glVertex3f(0,1,.5);
  37. glVertex3f(1,1,.5);
  38. glEnd();
  39. }
To copy to clipboard, switch view to plain text mode 

What it does is to draw a blank area in clearColor, but nothing else. It seems however that the Qt precompiled demo are working well with opengl. Where can the problem come from ?