Odd OpenGL-related Errors attempting to run on phone



  • I have a Nokia N8 with Symbian that I'm trying to run a QGLWidget on. I'm gonna preface this by saying that in the Simulator, there are no problems whatsoever. But when I switch to trying to use a Symbian device, I get the following types of errors:

    [...]\glwidget.cpp:294: error: 'GL_MODELVIEW' was not declared in this scope
    [...]\glwidget.cpp:294: error: 'glMatrixMode' was not declared in this scope
    [...]\glwidget.cpp:295: error: 'glLoadIdentity' was not declared in this scope
    [...]\glwidget.cpp:296: error: 'GL_PROJECTION' was not declared in this scope

    Again, compiling AND running is perfectly fine in the Qt Simulator, where I'm even able to play the game perfectly fine.

    In my pro file, I have:
    QT += opengl

    In my GLWidget.ccp, I originally had:
    #include <QtOpenGL>

    But removing it didn't change any of the errors. Has anyone else encountered this that could point me in the right direction? I can't understand why none of these errors are appearing in the simulator build if they really are problems. Thanks in advance.



  • Okay, I figured it out. This was my first time using OpenGL ES and I didn't realize how different they were.



  • Yep I recently took the leap myself, having worked with OpenGL the previous time in around 1999, OpenGL ES 2.0 was rather.. different :P

    (but so much better since you can now control everything!)

    • m


  • [quote author="Reptile" date="1324779891"]Okay, I figured it out. This was my first time using OpenGL ES and I didn't realize how different they were.[/quote]

    hello im having the exact problem how did you fix it?



  • [quote author="imleet" date="1326144658"]
    [quote author="Reptile" date="1324779891"]Okay, I figured it out. This was my first time using OpenGL ES and I didn't realize how different they were.[/quote]

    hello im having the exact problem how did you fix it?[/quote]

    basically, in OpenGL ES, you can't use 90% of the functions you use in regular OpenGL (going the other way is easy, though - OpenGL can process OpenGL ES code just fine.

    What you need to do is convert all your rendering code to use shaders instead of what you're currently using and get rid of the helper functions that control the camera, matrices, etc since you'll be doing all that work and passing that in as a variable to the shaders.



  • thanks, but this is really bad news for me, if i have to use shaders ill have to rewrite a lot of code that is already done using opengl es 1.1 (which is supported on android, iphone, bada..) to 2.0 =(



  • haha, I totally understand



  • The good news is that once you familiarize yourself with the programmable pipeline you'll never look back!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.