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. OpenGL without Qt OpenGL classes?
Forum Updated to NodeBB v4.3 + New Features

OpenGL without Qt OpenGL classes?

Scheduled Pinned Locked Moved Game Development
8 Posts 6 Posters 3.9k 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.
  • Z Offline
    Z Offline
    Zingam
    wrote on last edited by
    #1

    I read somewhere that it should be possible to use Qt to do the inialization for OpenGL and the use pure OpenGL (for example: imporing the functions with glew) but that could be tricky. Is there source code or samples how to do that?

    Particularly I am interested to use QtQuick for GUI and to have completely separate rendering framework.

    P.S. I am not sure if it is better to post this question here or in the Desktop Qt section.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sreich
      wrote on last edited by
      #2

      not sure if you found an answer. but in short you're better off using qtopengl's builtin function definitions. this does not mean you need to use the QOpenGLBuffer etc classes. Just inherit all your renderers from QOpenGLFunctions_3_3_Core etc and call initializeOpenGLFunctions in each one (i'm told it's cheap to do more than once), and call your regular glclear etc functions.

      this is the best approach i've found, you will find that glew and qt do not mix well. or most any other function pointer library/file..

      Software Developer for KDE

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Cmdr
        wrote on last edited by
        #3

        I've been using Qt in combination with gl3w without a problem. I've also used glew and had some problems, but those were not related to Qt, so it might also work for you.

        Doing this is pretty straightforward: Just call the functions. The same requirements about active contexts and render threads apply compared to QOpenGLFunctions.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          Korchkidu
          wrote on last edited by
          #4

          We do exactly this: use Qt for GUI and basic opengl initialization only. All our 3D is done with "manual" opengl. Never had any issues. Actually, real issues started when we tried to add some Qt-oriented opengl stuff in our software^^'.

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            qtoptus
            wrote on last edited by
            #5

            My application (in-progress) uses OpenGL and Direct3D, the whole graphics system is abstracted on top of lower level APIs. So yes it's possible.

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              qtoptus
              wrote on last edited by
              #6

              My application (in-progress) uses OpenGL and Direct3D, the whole graphics system is abstracted on top of lower level APIs. So yes it's possible.

              1 Reply Last reply
              0
              • T Offline
                T Offline
                Tripanarium
                wrote on last edited by
                #7

                Hi all!
                Don't know how does it work on C++, but in a small application written in PyQt to show and move some QGraphicsSvgItems, I have noted some improvement just by adding a line to my code:

                @class MyView(QtWidgets.QGraphicsView):

                def __init__(self, parent=None):
                    
                    """A very simple instance of QGraphicsView."""
                
                    super(MyView, self).__init__(parent)
                
                    # self.setRenderHints(QtGui.QPainter.Antialiasing | QtGui.QPainter.SmoothPixmapTransform)
                    self.setViewport(QtOpenGL.QGLWidget())
                    (...)@
                

                The line 10 was magic for me! And I havent touch nothing openGL related (that I know), just regular code with QtGui, QtCore, QtSvg and QWidgets. Maybe it's called internally...

                Einstein: "God does not play dice."
                Bohr: "Einstein, stop telling God what to do... No, no, you're not thinking; you're just being logical."

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  Tripanarium
                  wrote on last edited by
                  #8

                  Hi all!
                  Don't know how does it work on C++, but in a small application written in PyQt to show and move some QGraphicsSvgItems, I have noted some improvement just by adding a line to my code:

                  @class MyView(QtWidgets.QGraphicsView):

                  def __init__(self, parent=None):
                      
                      """A very simple instance of QGraphicsView."""
                  
                      super(MyView, self).__init__(parent)
                  
                      # self.setRenderHints(QtGui.QPainter.Antialiasing | QtGui.QPainter.SmoothPixmapTransform)
                      self.setViewport(QtOpenGL.QGLWidget())
                      (...)@
                  

                  The line 10 was magic for me! And I havent touch nothing openGL related (that I know), just regular code with QtGui, QtCore, QtSvg and QWidgets. Maybe it's called internally...

                  Einstein: "God does not play dice."
                  Bohr: "Einstein, stop telling God what to do... No, no, you're not thinking; you're just being logical."

                  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