Android build openmw

Everything about development and the OpenMW source code.
User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger »

.
Last edited by sandstranger on 01 Aug 2014, 16:37, edited 1 time in total.
User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger »

.
Last edited by sandstranger on 01 Aug 2014, 16:37, edited 1 time in total.
User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger »

.
Last edited by sandstranger on 01 Aug 2014, 16:37, edited 1 time in total.
User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger »

.
Last edited by sandstranger on 01 Aug 2014, 16:37, edited 1 time in total.
User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger »

.
Last edited by sandstranger on 01 Aug 2014, 16:38, edited 1 time in total.
User avatar
gus
Posts: 390
Joined: 11 Aug 2011, 15:41

Re: Android build openmw

Post by gus »

it's nice to see your progress!
User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger »

.
Last edited by sandstranger on 01 Aug 2014, 16:37, edited 2 times in total.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Android build openmw

Post by scrawl »

I know what is causing that. Will push a fix soon.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Android build openmw

Post by scrawl »

Please try this patch:

Code: Select all

diff --git a/libs/openengine/gui/manager.cpp b/libs/openengine/gui/manager.cpp
index 383d376..028192e 100644
--- a/libs/openengine/gui/manager.cpp
+++ b/libs/openengine/gui/manager.cpp
@@ -135,28 +135,6 @@ public:
         setRenderWindow(_window);
         setSceneManager(_scene);
 
-        // ADDED
-        sh::MaterialInstance* mat = sh::Factory::getInstance().getMaterialInstance("MyGUI/NoTexture");
-        sh::Factory::getInstance()._ensureMaterial("MyGUI/NoTexture", "Default");
-        mVertexProgramNoTexture = static_cast<sh::OgreMaterial*>(mat->getMaterial())->getOgreTechniqueForConfiguration("Default")->getPass(0)
-                ->getVertexProgram()->_getBindingDelegate();
-
-        mat = sh::Factory::getInstance().getMaterialInstance("MyGUI/OneTexture");
-        sh::Factory::getInstance()._ensureMaterial("MyGUI/OneTexture", "Default");
-        mVertexProgramOneTexture = static_cast<sh::OgreMaterial*>(mat->getMaterial())->getOgreTechniqueForConfiguration("Default")->getPass(0)
-                ->getVertexProgram()->_getBindingDelegate();
-
-        mat = sh::Factory::getInstance().getMaterialInstance("MyGUI/NoTexture");
-        sh::Factory::getInstance()._ensureMaterial("MyGUI/NoTexture", "Default");
-        mFragmentProgramNoTexture = static_cast<sh::OgreMaterial*>(mat->getMaterial())->getOgreTechniqueForConfiguration("Default")->getPass(0)
-                ->getFragmentProgram()->_getBindingDelegate();
-
-        mat = sh::Factory::getInstance().getMaterialInstance("MyGUI/OneTexture");
-        sh::Factory::getInstance()._ensureMaterial("MyGUI/OneTexture", "Default");
-        mFragmentProgramOneTexture = static_cast<sh::OgreMaterial*>(mat->getMaterial())->getOgreTechniqueForConfiguration("Default")->getPass(0)
-                ->getFragmentProgram()->_getBindingDelegate();
-
-
 
         MYGUI_PLATFORM_LOG(Info, getClassTypeName() << " successfully initialized");
         mIsInitialise = true;
@@ -359,6 +337,30 @@ public:
         }
     }
 
+    void initShaders()
+    {
+        // ADDED
+        sh::MaterialInstance* mat = sh::Factory::getInstance().getMaterialInstance("MyGUI/NoTexture");
+        sh::Factory::getInstance()._ensureMaterial("MyGUI/NoTexture", "Default");
+        mVertexProgramNoTexture = static_cast<sh::OgreMaterial*>(mat->getMaterial())->getOgreTechniqueForConfiguration("Default")->getPass(0)
+                ->getVertexProgram()->_getBindingDelegate();
+
+        mat = sh::Factory::getInstance().getMaterialInstance("MyGUI/OneTexture");
+        sh::Factory::getInstance()._ensureMaterial("MyGUI/OneTexture", "Default");
+        mVertexProgramOneTexture = static_cast<sh::OgreMaterial*>(mat->getMaterial())->getOgreTechniqueForConfiguration("Default")->getPass(0)
+                ->getVertexProgram()->_getBindingDelegate();
+
+        mat = sh::Factory::getInstance().getMaterialInstance("MyGUI/NoTexture");
+        sh::Factory::getInstance()._ensureMaterial("MyGUI/NoTexture", "Default");
+        mFragmentProgramNoTexture = static_cast<sh::OgreMaterial*>(mat->getMaterial())->getOgreTechniqueForConfiguration("Default")->getPass(0)
+                ->getFragmentProgram()->_getBindingDelegate();
+
+        mat = sh::Factory::getInstance().getMaterialInstance("MyGUI/OneTexture");
+        sh::Factory::getInstance()._ensureMaterial("MyGUI/OneTexture", "Default");
+        mFragmentProgramOneTexture = static_cast<sh::OgreMaterial*>(mat->getMaterial())->getOgreTechniqueForConfiguration("Default")->getPass(0)
+                ->getFragmentProgram()->_getBindingDelegate();
+    }
+
     void doRender(IVertexBuffer* _buffer, ITexture* _texture, size_t _count)
     {
         if (getManualRender())
@@ -368,6 +370,8 @@ public:
         }
 
         // ADDED
+        if (!mVertexProgramNoTexture)
+            initShaders();
 
         if (_texture)
         {
User avatar
sandstranger
Posts: 438
Joined: 19 May 2014, 19:53
Location: Oblivion

Re: Android build openmw

Post by sandstranger »

.
Last edited by sandstranger on 01 Aug 2014, 16:38, edited 1 time in total.
Locked