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. Modern OpenGL pipeline implementation in Qt

Modern OpenGL pipeline implementation in Qt

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

    Hi all.I am new to -QT- Qt and I need to develop a desktop app with GUI which utilizes OpenGL 3x (modern not fixed pipeline ). I read the docs and the OpenGL examples seem to be fixed pipeline. Does -QT- Qt at all supports OpenGL 3.1/4.1 version ? Are there any examples on how to load vert/frag shaders, create buffers and programs "-QT- Qt way" ?

    Thanks .

    1 Reply Last reply
    0
    • T Offline
      T Offline
      task_struct
      wrote on last edited by
      #2

      Hi,

      take a look at "Qt 3D":http://doc.qt.nokia.com/qt3d-snapshot/index.html and "QGLShaderProgram":http://doc.trolltech.com/4.7-snapshot/qglshaderprogram.html
      I think this will help you.

      "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

      • Linu...
      1 Reply Last reply
      0
      • M Offline
        M Offline
        minimoog77
        wrote on last edited by
        #3

        Well I did give you example of which uses programmable pipeline. :)

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sasmaster
          wrote on last edited by
          #4

          Yes ,man ,thanks .Now I think I forgot using VBO...

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

            My recommendation for VBO, use 'packed' vertices with stride parameter.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sasmaster
              wrote on last edited by
              #6

              Sorry ,but what do you mean by "stride parameter. " ?

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

                You have packed vertices in one array of this struct:

                @Struct Vertex {
                float x, y, z;
                float nx, ny, nz;
                float some_vertex_attribute;
                }@

                Which has size, 28 bytes, if I am not wrong.

                Stride parameter is byte offset between consecutive vertices, then for example, x, y, z (vertex pos) stride would be, you guess, 28 bytes: the driver would take three floats, and then will jump 28 bytes, take three floats, then jump, etc...

                I hope you understand.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sasmaster
                  wrote on last edited by
                  #8

                  I think I got you.You mean packing different data for the vertex buffer in a single vertex array.Like vertices positions,color, like :
                  @
                  GLfloat vertAndColors[]={
                  23.0f,12.0f,23.43f,/vertex 1 /0.23f,0.75f,1.0f.1.0f / RGBA color for that vertex/ ,
                  ....
                  ......
                  ........
                  }
                  @
                  ?

                  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