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. OpenGL shader functions not working

OpenGL shader functions not working

Scheduled Pinned Locked Moved General and Desktop
openglqt 5.4.0
8 Posts 2 Posters 3.1k 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.
  • J Offline
    J Offline
    Jordan69
    wrote on 10 Mar 2015, 07:44 last edited by
    #1

    Hi, i am using Qt version 5.4.1. My gpu can support OpenGL version 4.2 but functions such as glCreateShader or glCompileShader etc. do not work. Other functions such as glGenBuffers work perfectly fine. I am using QOpenGLFunctions and i have called initializeOpenGLFunctions in my initializeGL() function. I am very sorry if this is a noob question as i am new to Qt and OpenGL. Thanks!

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on 10 Mar 2015, 08:16 last edited by
      #2

      Hi Jordan69!

      There is an example in the docs that shows how to use QOpenGLShaderProgram: http://doc.qt.io/qt-5/qtquick-scenegraph-openglunderqml-example.html

      Hope that helps :-)

      J 3 Replies Last reply 10 Mar 2015, 09:06
      0
      • ? A Former User
        10 Mar 2015, 08:16

        Hi Jordan69!

        There is an example in the docs that shows how to use QOpenGLShaderProgram: http://doc.qt.io/qt-5/qtquick-scenegraph-openglunderqml-example.html

        Hope that helps :-)

        J Offline
        J Offline
        Jordan69
        wrote on 10 Mar 2015, 09:06 last edited by
        #3

        @Wieland

        Thanks ill check it out!

        1 Reply Last reply
        0
        • ? A Former User
          10 Mar 2015, 08:16

          Hi Jordan69!

          There is an example in the docs that shows how to use QOpenGLShaderProgram: http://doc.qt.io/qt-5/qtquick-scenegraph-openglunderqml-example.html

          Hope that helps :-)

          J Offline
          J Offline
          Jordan69
          wrote on 10 Mar 2015, 09:10 last edited by Jordan69 3 Oct 2015, 09:11
          #4

          @Wieland

          Ok I got a question, with QOpenGLShaderProgram, all I have to do is add the header right?

          ? 1 Reply Last reply 10 Mar 2015, 10:09
          0
          • J Jordan69
            10 Mar 2015, 09:10

            @Wieland

            Ok I got a question, with QOpenGLShaderProgram, all I have to do is add the header right?

            ? Offline
            ? Offline
            A Former User
            wrote on 10 Mar 2015, 10:09 last edited by
            #5

            @Jordan69 Yes:

            #include <QtGui/QOpenGLShaderProgram>

            J 1 Reply Last reply 10 Mar 2015, 11:17
            0
            • ? A Former User
              10 Mar 2015, 10:09

              @Jordan69 Yes:

              #include <QtGui/QOpenGLShaderProgram>

              J Offline
              J Offline
              Jordan69
              wrote on 10 Mar 2015, 11:17 last edited by
              #6

              @Wieland

              Thank you so much Wieland.

              1 Reply Last reply
              0
              • ? A Former User
                10 Mar 2015, 08:16

                Hi Jordan69!

                There is an example in the docs that shows how to use QOpenGLShaderProgram: http://doc.qt.io/qt-5/qtquick-scenegraph-openglunderqml-example.html

                Hope that helps :-)

                J Offline
                J Offline
                Jordan69
                wrote on 11 Mar 2015, 09:28 last edited by
                #7

                @Wieland

                Am I meant to put shaders in a specific function like initializeGL?

                ? 1 Reply Last reply 11 Mar 2015, 19:22
                0
                • J Jordan69
                  11 Mar 2015, 09:28

                  @Wieland

                  Am I meant to put shaders in a specific function like initializeGL?

                  ? Offline
                  ? Offline
                  A Former User
                  wrote on 11 Mar 2015, 19:22 last edited by
                  #8

                  @Jordan69 No, you can compile your shaders and link them whenever you need them. But keep in mind that your shaders are compiled by the GPU at runtime. So, compilation takes time and you can't afford to do this everytime you render a single frame. Thus it's wise to have some init function that is called only on startup or when you need to make changes to your shader program(s).

                  1 Reply Last reply
                  0

                  1/8

                  10 Mar 2015, 07:44

                  • Login

                  • Login or register to search.
                  1 out of 8
                  • First post
                    1/8
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved