Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Overpainting with OpenGL 3.1 (with array buffers)
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Overpainting with OpenGL 3.1 (with array buffers)

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Morphine_OD
    wrote on 21 Feb 2011, 06:44 last edited by
    #1

    Hi. I'm trying to use QPainter for overpainting purposes in a renderer that is based on QGLWidget with 3.1 OpenGL version. I use CG shaders and index buffers. Every time I turn the rendering off, QPainter works. But when I try to render something, it doesn't. Just no showing anything at all, only resetting the veiwport. Already tried rendering inside of QPainter::beginNativeRendering, but to no avail. Is there some kind of a trick I should use? Or is it a dead cause?

    Edit: QT 4.7.1. on XWindow system

    Edit: I've noticed that glBindBuffer is the culprit. After the call to it, QPainter doesn't paint a thing. Is there any way to fix it? Every example strangely uses only primitive gl functions, but tells nothing about advanced techniques such as drawing from buffers.

    Solution: Before the call to QPainter::begin(); It is essential to call glBindBuffer(/buffer type/, 0); to unbind all the buffers.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      stukdev
      wrote on 1 Mar 2011, 08:29 last edited by
      #2

      Solved. Solution: Before the call to QPainter::begin(); It is essential to call glBindBuffer(/buffer type/, 0); to unbind all the buffers.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved