Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Problem in running cube example: 'glActiveTexture' was not declared in this scope'

    Game Development
    2
    4
    8392
    Loading More Posts
    • 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.
    • K
      Karunesh last edited by

      I am trying to run the cube example for Symbian^3 with OpenGL ES 2,0 but it does not compile. There are two errors, one saying that glActiveTexture is not declared and the other saying the same for GL_TEXTURE0.

      I chanced upon a forum post "here ":https://qt-project.org/forums/viewthread/6884, and it turns out that we have to include the QGLFunctions module, but still one error remains: 'glActiveTexture' was not declared in this scope', i.e. the glActiveTexture primitive is not being identified by opengl.

      The glActiveTexture primitive only sets the texture mode to GL_TEXTURE0, which is default. So removing the line (the first line in function 'initTextures' in mainwidget.cpp) should be fine, but the application crashes on doing so.

      Any help is appreciated. Thanks.

      Thanks and regards
      Karunesh

      1 Reply Last reply Reply Quote 0
      • B
        Blizzard last edited by

        Use "glext.h":www.opengl.org/registry/api/glext.h and make sure you have the following 2 lines in your code:
        @#define GL_GLEXT_PROTOTYPES
        #include <GL/gl.h>@

        Software Engineer | Aerospace & Defence

        1 Reply Last reply Reply Quote 0
        • B
          Blizzard last edited by

          If it still doesn't work, try using:
          @#define GL_GLEXT_LEGACY@

          in place of

          @#define GL_GLEXT_PROTOTYPES@

          Software Engineer | Aerospace & Defence

          1 Reply Last reply Reply Quote 0
          • K
            Karunesh last edited by

            Hi

            I inserted the two lines (with both GL_GLEXT_PROTOTYPES and GL_GLEXT_LEGACY i.e. first one then the other). The code is compiling fine but its crashing with an assertion in the qglfunctions.h file.

            Exact debugger output:
            bq. Initializing shaders...
            Initializing geometries...
            ASSERT: "QGLFunctions::isInitialized(d_ptr)" in file ........\Desktop\Qt\4.8.0\mingw\include/QtOpenGL/qglfunctions.h, line 719
            Invalid parameter passed to C runtime function.
            Invalid parameter passed to C runtime function.

            I also tried directly including glext.h, but the same assertion persists.

            Thanks and regards
            Karunesh

            1 Reply Last reply Reply Quote 0
            • First post
              Last post