Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. How to setup OpenGL 3.x?

How to setup OpenGL 3.x?

Scheduled Pinned Locked Moved Game Development
5 Posts 5 Posters 4.7k 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.
  • K Offline
    K Offline
    kitfox
    wrote on last edited by
    #1

    I've done a lot of OpenGL programming, but am new to Qt. I'd like to be able to use programmable shaders to draw some shapes withing a QGLWidget. Being able to use VBOs and framebuffers would also be nice.

    I've set up my Qt build environment by following the instructions on this page:
    http://netbeans.org/kb/docs/cnd/qt-applications.html

    I've managed to create a Qt form with my custom widget in it that subclasses QGLWidget. I've even been able to use the OpenGL 1.1 pipeline to draw some simple shapes. However, I cannot figure out how to enable more advanced OpenGL 3.x functions.

    I've looked though the glext.h that came with Qt - it seems to be entirely missing shaders, vertex buffers and framebuffers (which makes me wonder what functions it does provide). I've read some other posts that recommend downloading and using GLEW, but it's not clear to me how I can add that to my project since I'd think the libraries would be incompatible.

    The version of Qt I'm using is a slightly older one - 2010-02-01. This is mainly because this was the one recommended by NetBeans, and I do like using NetBeans as an IDE. However, if the only way around this problem is to switch to a different SDK, I'd be willing to do that.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      greenlinux
      wrote on last edited by
      #2

      Hello,

      D/L and build Qt/3D instructions at: http://doc.qt.nokia.com/qt3d-snapshot/qt3d-building.html

      Then, for example, see the previous post on this forum... "Qt/3D OpenGl Simple Gooch Shader Example"

      J

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jmacey
        wrote on last edited by
        #3

        What platform are you on? If you are using windows or Linux you will need to load the extensions for the vbo shaders etc. I usually use glew to do this. http://glew.sourceforge.net/ you will need to include glew.h before any of the other GL headers else you get errors.

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZapB
          wrote on last edited by
          #4

          Qt doesn't ship a glext.h header. Rather, that is part of your platforms includes. Which platforms are you wishing to get OpenGL 3.x working on with Qt?

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          1 Reply Last reply
          0
          • M Offline
            M Offline
            minimoog77
            wrote on last edited by
            #5

            Example of using QGLWidget with GLEW:

            https://github.com/minimoog/portals

            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