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. Using OGRE with Qt for Android
Forum Update on Monday, May 27th 2025

Using OGRE with Qt for Android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 1 Posters 1.0k 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.
  • FerniF Offline
    FerniF Offline
    Ferni
    wrote on last edited by
    #1

    Hi everyone!

    Has anyone used OGRE in an Android application? In OGRE webpage I found a tutorial to use OGRE in a QWindow and it works perfectly for Linux-x86 since I have dynamic link libraries but for Android many changes must be done.

    Some of them are installing the plugins manually (not with plugin.cfg file) but I still don't know how to access to the resources from Assets for OGRE and what is missing because my app crashes after trying to create a render window.

    Any help, example or whatever would be really appreciated :)

    Thanks,
    Fernando

    1 Reply Last reply
    0
    • FerniF Offline
      FerniF Offline
      Ferni
      wrote on last edited by Ferni
      #2

      Here is my Qt project. Could someone give a hint if I'm doing something wrong?
      You just need to set the path to plugins.cfg and resources.cfg for linux (in QTOgreWindow.cpp) and include and libraries path for Android in .pro.

      You also need OGRE libraries and sources for headers and materials, models, etc.

      QtOgre project

      1 Reply Last reply
      0
      • FerniF Offline
        FerniF Offline
        Ferni
        wrote on last edited by
        #3

        OKs.. I had to read a lot to find the cause of the problem.

        I have to set parameters first with the right values. From OGRE webpage I have the two following lines but I found in this forum that winId() is useless for Android and I have to get ANativeWindow_fromSurface function but I don't know how to do that from my Qt application.

        parameters["externalWindowHandle"] = Ogre::StringConverter::toString((unsigned long)(this->winId()));
        parameters["parentWindowHandle"] =   Ogre::StringConverter::toString((unsigned long)(this->winId()));
        

        After getting the right external window handle, the following line should be ok and everything should work.

        m_ogreWindow = m_ogreRoot->createRenderWindow("QT Window",
                this->width(),
                this->height(),
                false,
                &parameters);
        

        Could any Android developer explain me how to how to get this? I need to use QAndroidJniObject class but I'm really lost,

        Thanks,
        Fernando

        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