Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt on Android: Cube OpenGL ES 2.0 not working
QtWS25 Last Chance

Qt on Android: Cube OpenGL ES 2.0 not working

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 3 Posters 5.4k 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.
  • A Offline
    A Offline
    and.fo
    wrote on last edited by
    #1

    Hi there,

    I'm working extensively on a Qt for Android project and already managed to try a lot of things on a Nexus 7 tablet running with Android 4.3 and supprting OpenGL ES 2.0.

    Currently I'm exploring the possibilities in Open GL and therefore I used the example "Cube OpenGL ES 2.0" which comes with the installation of the Qt framwork:
    ...\Qt\Qt5.1.1\5.1.1\mingw48_32\examples\opengl\cube

    While this example works on the Desktop envrionment, I just get a black screen on the Android tablet after successfull deployment. There is nor error in the build and deployment process and no error in the runtime log in QtCreator.

    After I changed the background color to red, I recognized that the cube is there and can be rotated by touch gestures but has just a black color.

    @qglClearColor(Qt::red);@

    This means that the texture "cube.png" is not rendered on the device. I tried using "cube.jpg" but this doesn't work too.

    Do I miss something?

    Is there a problem with textures in the current Qt for Android version?

    I managed to run another example using OpenGL ES 2.0 with shaders and triangles, but without textures.

    Does anyone have a hint for me or face the same experience?

    Regards Andreas

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Moster
      wrote on last edited by
      #2

      Are you familiar with adb logcat? If yes, maybe checkout if some error messages show up there.
      http://developer.android.com/tools/help/logcat.html

      1 Reply Last reply
      0
      • A Offline
        A Offline
        and.fo
        wrote on last edited by
        #3

        I checked the adb log file but could not recognize a failure regarding the topic.

        1 Reply Last reply
        0
        • E Offline
          E Offline
          EiNDouble
          wrote on last edited by
          #4

          I've faced the same issue when running the project for the iOS platform, and most likely the problem is the same, since it was OpenGL ES related.

          After a long search, I've found that the example cube problem was related with the texture dimensions not being power of two. So, in order to solve this, you need to set linear filtering and clamp to edge and disable mipmap.

          From the following link:
          http://stackoverflow.com/questions/11069441/non-power-of-two-textures-in-ios

          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