It has been a while since I looked into this, but I have seen numerous posts in the last couple years about using glRotatef(...) to rotate text in OpenGL using renderText. Is glRotatef(...) working on renderText and if so, what is wrong with my simple test?

This is some QUICK test code I wrote up and manually copied (meaning re-typed) the code from another system, so please excuse any typos as this code compiles and "works". The text appears on a white background, however it is NOT rotated 90 degrees. Am I doing something wrong, so does QGLWidget no support rotating of renderText?

Qt Code:
  1. #ifndef GL_WIDGET_H
  2. #define GL_WIDGET_H
  3.  
  4. #include <QGLWidget>
  5.  
  6. class GLWidget : public QGLWidget
  7. {
  8. Q_OBJECT
  9.  
  10. public:
  11. GLWidget( QWidget *parent ) : QGLWidget( parent ) {};
  12.  
  13. protected:
  14. void initializeGL()
  15. {
  16. qglClearColor( Qt::white );
  17. glEnable( GL_DEPTH_TEST );
  18. }
  19.  
  20. void resizeGL( int w, int h )
  21. {
  22. glViewport( 0.0, 0.0, 100, 100 );
  23.  
  24. glMatrixMode( GL_PROJECTION );
  25. glLoadIdentity();
  26. glOrtho( -50, 50, -50, 50, -1, 1 );
  27.  
  28. glMatrixMode( GL_MODELVIEW );
  29. }
  30.  
  31. void paintGL()
  32. {
  33. QString textStr = "Hello World";
  34.  
  35. glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
  36.  
  37. glLoadIdentity();
  38.  
  39. qglColor( Qt::Black );
  40.  
  41. glPushMatrix();
  42. glRotatef( 90.0, 0.0f, 1.0f, 0.0f );
  43.  
  44. renderText( 0.0, 0.0, 0.0, textStr );
  45. glPopMatrix();
  46. }
  47. };
  48.  
  49. #endif
To copy to clipboard, switch view to plain text mode 

Thanks