Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-844

OpenGL QGLWidget::renderText()

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Moved
    • P2: Important
    • Some future release
    • 4.3.0
    • GUI: OpenGL
    • None

    Description

      QGlWidget::renderText() can be slow. When looking at the actual renderText() code it is obvious that the reason
      for being slow when drawing a lot of text to the screen is because every time it is called all the OpenGL states have to be set to render the text. This is very inefficient from a OpenGL standpoint to be constantly changing/querying the OpenGL states.

      glGetDoublev(GL_MODELVIEW_MATRIX, &model[0][0]);
      glGetDoublev(GL_PROJECTION_MATRIX, &proj[0][0]);
      glGetIntegerv(GL_VIEWPORT, &view[0]);
      glMatrixMode(GL_PROJECTION);
      glLoadIdentity();
      glViewport(0, 0, width(), height());
      glOrtho(0, width(), height(), 0, 0, 1);
      glMatrixMode(GL_MODELVIEW);
      glLoadIdentity();
      glAlphaFunc(GL_GREATER, 0.0);
      glEnable(GL_ALPHA_TEST);
      glEnable(GL_DEPTH_TEST);

      It would be useful if some methods were added that would allow setting up a Text rendering mode in the OGLWidget context.

      It would work something like this:

      OGLWidget::EnableTextMode();

      // issue all the desired text to be drawn between the two methods
      for (;when done rendering text;
      {
      OGLWidget::renderTextMode(...);
      }

      OGLWidget::DisableTextMode();

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kjernase Trond Kjernåsen (Inactive)
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes