Hi,

I have the following very simple class -

Qt Code:
  1. #ifndef GLTEST_H_
  2. #define GLTEST_H_
  3.  
  4. #include <QtGui>
  5. #include <GL/glew.h>
  6. #include <QGLWidget>
  7. #include <iostream>
  8.  
  9. using namespace std;
  10.  
  11. class GlTest : public QGLWidget
  12. {
  13.  
  14. public:
  15. Q_OBJECT
  16.  
  17. public:
  18.  
  19. GlTest(){}
  20.  
  21. virtual void initWindow(){}
  22.  
  23. virtual void initializeGL()
  24. {
  25. QGLWidget::initializeGL();
  26. }
  27.  
  28. virtual void paintGL()
  29. {
  30. cout << "paintGL"<< endl;
  31. QGLWidget::paintGL();
  32. }
  33.  
  34. virtual void swapBuffers()
  35. {
  36. QGLWidget::swapBuffers();
  37. }
  38. };
To copy to clipboard, switch view to plain text mode 

which I call via -

Qt Code:
  1. if(!glWindow.get())
  2. glWindow.reset(new GlTest());
  3.  
  4. glWindow->showFullScreen();
To copy to clipboard, switch view to plain text mode 

I'm using two screens so the above code will fill the first screen with the gl window. If I then click on another application in the second window, the above program prints - "paintGL". Then, when I click on the gl window again, this message is again printed. However if I use show() instead of showFullScreen() then this behavior does not happen. In other words, I can click on other windows and the paintGL() function is not entered - as expected. Why might this difference between show() and showFullScreen() be? If this is a bug what might a work around be? I don't wish for paintGL() to be called when the gl window stops being active (or when it starts being active again for that matter). I wish it to work as it does with show().

The above code is a very stripped down version of what I am actually doing. At the moment I am having problems when in full screen mode because the scene I wish to show in the gl window is being recalculated each time paintGL() is being called.

Any tips?

Barry.