March 2, 2012

Karunesh Karunesh
Lab Rat
11 posts

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

 

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 [qt-project.org], 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.

 Signature 

Thanks and regards
Karunesh

3 replies

March 2, 2012

Blizzard Blizzard
Lab Rat
67 posts

Use glext.h and make sure you have the following 2 lines in your code:

  1. #define GL_GLEXT_PROTOTYPES
  2. #include <GL/gl.h>

 Signature 

Software Engineer | Aerospace & Defence

March 2, 2012

Blizzard Blizzard
Lab Rat
67 posts

If it still doesn’t work, try using:

  1. #define GL_GLEXT_LEGACY

in place of

  1. #define GL_GLEXT_PROTOTYPES

 Signature 

Software Engineer | Aerospace & Defence

March 3, 2012

Karunesh Karunesh
Lab Rat
11 posts

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.

 Signature 

Thanks and regards
Karunesh

 
  ‹‹ Position touch event in QWidget      Open GL ES2.0 - glDrawelements() ››

You must log in to post a reply. Not a member yet? Register here!