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. Problem in running cube example: 'glActiveTexture' was not declared in this scope'
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Game Development
4 Posts 2 Posters 8.8k 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.
  • K Offline
    K Offline
    Karunesh
    wrote on last edited by
    #1

    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
    0
    • B Offline
      B Offline
      Blizzard
      wrote on last edited by
      #2

      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
      0
      • B Offline
        B Offline
        Blizzard
        wrote on last edited by
        #3

        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
        0
        • K Offline
          K Offline
          Karunesh
          wrote on last edited by
          #4

          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
          0

          • Login

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