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. help with legacy opengl
Forum Updated to NodeBB v4.3 + New Features

help with legacy opengl

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 561 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.
  • L Offline
    L Offline
    lazuli_beast
    wrote on last edited by
    #1

    I have an existing Fortran program which uses freeglut and f03gl bindings to render a scene. That code uses legacy opengl draw calls like so

    ! loop over all triangles to render
    call glBegin( GL_TRIANGLES );
    call glVertex3fv( node(:,1)  );
    call glVertex3fv( node(:,2)  );
    call glVertex3fv( node(:,3)  );
    call glEnd();
    

    I know that this is a deprecated method, but it works great for the application. I would like to use Qt to add a simple user interface for this program (probably buttons and a top bar menu). I have not had much luck finding examples of Qt using legacy openGL. What I would like to do is have Qt C++ start my Fortran program, but replace the Fortran openGL calls to instead send the data to be rendered back to Qt. I have already got that working, but the last step of actually rendering in Qt is giving me trouble.

    In examples I have looked at, render data is hard coded in a function of some type of Q object. For example, the builtin example openglwindow has vertices data defined in a render() function of a openGLwindow class object. So I am having conceptual trouble with how to render my data that is being "streamed" in. I was trying to adapt that example to use legacy opengl calls but haven't got it to work.

    Is what I want to do even possible? Any advice would be helpful. Thanks

    1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      https://code.qt.io/cgit/qt/qtbase.git/tree/examples/opengl/textures?h=5.15

      L 1 Reply Last reply
      0
      • JoeCFDJ JoeCFD

        https://code.qt.io/cgit/qt/qtbase.git/tree/examples/opengl/textures?h=5.15

        L Offline
        L Offline
        lazuli_beast
        wrote on last edited by
        #3

        @JoeCFD What am I looking at here? This has static definition of data and uses modern openGL, right?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          From the looks of it, the QOpenGLFunctions class is likely what you are looking for in combination with QOpenGLWidget. With both together, you should be able to reuse what you already have.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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