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. OpenGL Problems
Forum Updated to NodeBB v4.3 + New Features

OpenGL Problems

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 971 Views
  • 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.
  • D Offline
    D Offline
    devmane144
    wrote on last edited by
    #1

    Hello all,

    I recently decided to switch from QGLWidget to QOpenGLWidget for a rendering context for my game engine editor. It went smoothly; I set the version (OpenGL 3.3), using default format, and I am using GLEW for most of the OpenGL standard functions. Everything was working perfectly before I switched to the QOpenGLWidget (recommended by a stack exchange post about another small tweak I was making). I checked the rendering context using the QT valid() function, and I made sure the context wasn't lost by verifying they were the same pointer.

    My problem is that my VAOs throw INVALID_OPERATION whenever I bind them, and my draw function does the same. It's nothing out of the ordinary, standard triangles and such. And it actually worked hunky dory on the QGLWidget. The funny thing is that it's not all the VAOs; the skybox I have and the basic line drawer does work, it's just the models.

    Is there a way to verify VAO integrity if I'm stuck using GLEW? I initialize the same as if I were making the skybox, but I'm open to solutions.

    Thanks,
    Devmane144

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rondog
      wrote on last edited by
      #2

      One thing I would check is that you have the Qt::MSWindowsOwnDC flag set when you construct the QOpenGLWidget. You don't need this for the older QGLWidget but I found it must be set for the new QOpenGLWidget. If it is not set then strange things happen (and lots of crashes).

      The rendering context is associated with the device context in Win32. The Qt::MSWindowsOwnDC sets the equivalent flag in the Win32 window class that QOpenGLWidget uses. You need this set for any Win32 opengl program you create on Windows as far as I know.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        devmane144
        wrote on last edited by
        #3

        Hello,

        I did a tiny bit of googling and found that it is a window flag, so I set that flag in addition to the other flags that are automatically added. The problem does persist, but I wouldn't be surprised if there is still a setup thing I am missing. Do you have any other ideas?

        Thanks,
        devmane144

        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