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. QT5 OpenGL include[SOLVED]
Forum Updated to NodeBB v4.3 + New Features

QT5 OpenGL include[SOLVED]

Scheduled Pinned Locked Moved Game Development
13 Posts 5 Posters 26.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.
  • S Offline
    S Offline
    Seraph
    wrote on 17 Dec 2012, 16:18 last edited by
    #3

    Hmm.. I think he just wants to know what to include and define to use GL ext.
    The preprocessor just includes OpenGL_ES_2 stuff by default. Got the same here.

    1 Reply Last reply
    0
    • O Offline
      O Offline
      obab30
      wrote on 18 Dec 2012, 11:36 last edited by
      #4

      Yes right, Seraph!
      I want to use OpenGL defines such as GLfloat in independent classes (not derived from any other class). How can i manage that?

      Thanks,

      obab

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Seraph
        wrote on 19 Dec 2012, 12:08 last edited by
        #5

        Hello Obab,

        It seems that in Qt 5 are still the old QGLXXX classes and new ones with the prefix QOpenGLXXX.
        I had a look in the QGLXXX header files which include GL_ES_2 stuff and the QOpenGLXXX classes include the normal open gl stuff.

        Maybe you should just replace your QGLXXX classes with the new QOpenGLXXX classes. Give it a try.

        I hope this will help you.

        1 Reply Last reply
        0
        • O Offline
          O Offline
          obab30
          wrote on 19 Dec 2012, 14:40 last edited by
          #6

          Okay all the OpenGL 3.3 Stuff is working when i use

          @
          #define GL_GLEXT_PROTOTYPES
          #include <QtOpenGL>
          @

          But how do i get all the deprecated stuff to work? Stuff like "GL_POLYGON" or "GL_QUAD_STRIP".
          Is there a special define for that?

          Thanks,

          obab

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            ZapB
            wrote on 20 Dec 2012, 14:23 last edited by
            #7

            OK first of all, are you using the pre-built Qt5 packages or did you compile Qt5 yourself? If you compiled it yourself what configure line did you use?

            Nokia Certified Qt Specialist
            Interested in hearing about Qt related work

            1 Reply Last reply
            0
            • O Offline
              O Offline
              obab30
              wrote on 20 Dec 2012, 16:04 last edited by
              #8

              Hey ZapB,

              i just used the pre-build msvc2010 package!

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                ZapB
                wrote on 20 Dec 2012, 16:24 last edited by
                #9

                [quote author="obab30" date="1356019442"]Hey ZapB,

                i just used the pre-build msvc2010 package!

                [/quote]

                OK that is the source of your issues then. The pre-compiled Windows desktop version of Qt5 is built against ANGLE which only provides OpenGL ES 2 support by implementing it on top of DirectX 9.

                This was done to ensure that QtQuick2 works on all windows systems, including those with crappy Intel OpenGL drivers ;)

                OpenGL ES 2 does not support the legacy fixed function pipeline, only a shader-based one.

                There is a bug open to provide a build of Qt 5 using the native desktop OpenGL implementation for Qt 5.0.1. Please go vote for https://bugreports.qt-project.org/browse/QTBUG-28715 to see this happen.

                For now, you have two choices:

                • Live with OpenGL ES 2 support and don't use legacy OpenGL
                • Build your own copy of Qt 5 to use the native OpenGL drivers by passing in

                @
                -opengl desktop
                @

                to configure.

                With the 2nd option you should have access to OpenGL from 1.0 up to 4.3 (if your card/driver support it).

                Nokia Certified Qt Specialist
                Interested in hearing about Qt related work

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Seraph
                  wrote on 20 Dec 2012, 18:16 last edited by
                  #10

                  OK that should solve my "thread":http://qt-project.org/forums/viewthread/22915/, too! Thanks ZapB!
                  I'll give it a try. Obab would you please respond here again if it worked?

                  Thanks and merry x mas to everyone

                  1 Reply Last reply
                  0
                  • O Offline
                    O Offline
                    obab30
                    wrote on 22 Dec 2012, 00:02 last edited by
                    #11

                    Okay thank you very much ZapB! You're really helped me out! The second option worked for me :)

                    Merry X Mas!

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      longlong
                      wrote on 17 Jun 2013, 10:37 last edited by
                      #12

                      I do as ZapB told but meet some problems when configure -opengl desktop.
                      My Qt version is 5.0.2.
                      I run the cmd.exe in windows and in the directory of D:\Qt\Qt5.0.2\5.0.2\Src\qtbase.
                      In order to compile Qt,
                      I input the commend "configure -opengl desktop". But it didn't work and no makefiles was got.
                      Could you tell me why? Dear ZapB?

                      1 Reply Last reply
                      0
                      • Z Offline
                        Z Offline
                        ZapB
                        wrote on 17 Jun 2013, 11:44 last edited by
                        #13

                        Which compiler are you trying to build with? If it's MSVC then you need to make sure that the environment is setup correctly by executing the MSVC Command Prompt rather than cmd.exe directly. This executes a batch script that correctly sets up the path to your compiler etc.

                        Can you paste the exact configure line and output that you get please?

                        Nokia Certified Qt Specialist
                        Interested in hearing about Qt related work

                        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