Visible text bug

ShiftZ

22-11-2010 17:20:13

I have a strange bug with text.

Here is the first scene:



Then, on button click, im sending all these buttons to invisible:

for (usize w = 0; w < widgets.size(); w++)
widgets[w]->setVisible(false);


.. and loading a new scene
widgets = LayoutManager::getInstancePtr()->getByName("NewScene")->createLayout();

and here what i've got:



Amount of visible text depends on count of button in new scene.
If not load new scene at all, text stay invisible as should be.

Altren

22-11-2010 20:28:46

Do you have file "NewScene" in your resources (without ".layout")?
Also why you loading through "getByName("NewScene")->createLayout();" and not through LayoutManager::getInstance().loadLayout ? The way that you use for load looks uncommon.

ShiftZ

22-11-2010 21:01:23

I dont have a file NewScene. its a resource name.

Also why you loading through "getByName("NewScene")->createLayout();" and not through LayoutManager::getInstance().loadLayout ? The way that you use for load looks uncommon.


I have a project file with set of scenes created by LayoutEditor - mainmenu.xml. Im loading that project file as resource on startup and using scenes form that project by its name. Could it cause any troubles?

By the way, i have created a topic dedicated to scene loading and managment viewtopic.php?f=17&t=13664. Unfortunally its left wihout attention.
Also i cannot see the way how to unload skin with releated texture. Removing skin by its name leave texture untouched. Should i track all textures manually?

Altren

23-11-2010 02:04:45

I have a project file with set of scenes created by LayoutEditor - mainmenu.xml. Im loading that project file as resource on startup and using scenes form that project by its name. Could it cause any troubles?No, I forgot about this new feature. Actually this was implemented for a different purpose, but you can use it this way too. Anyway I recommend you to useLayoutManager::getInstance().loadLayout("NewScene"); because this will track loaded layout name in log in case of related warnings or errors.

Your error looks like memory corruption. Neither me nor my.name never seen such bug before, and I see no way to do a mistake in logic to get that.
You should post here your layout and I'll try to reproduce bug, also try to use default skin. If there's no bug with default skin post your custom skin too.
By the way, i have created a topic dedicated to scene loading and managment viewtopic.php?f=17&t=13664. Unfortunally its left wihout attention.
Also i cannot see the way how to unload skin with releated texture. Removing skin by its name leave texture untouched. Should i track all textures manually?

I guess I either missed it or wasn't able to understand what you asked. I'll reply in few minutes.

ShiftZ

23-11-2010 12:54:53

and I see no way to do a mistake in logic to get that.

Well, the way is pretty simple. I have implemented my own mygui renderer (OpenGL ES) and lets take a look at
void MyGuiRenderManager::doRender( MyGUI::IVertexBuffer* _buffer, MyGUI::ITexture* _texture, size_t _count )

I was thinking what's the point of _count argument when MyGUI::IVertexBuffer has getVertextCount method, probably it's a legacy argument or something... i was wrong. :oops:

Btw there is mistype in its name getVertextCount

Altren

23-11-2010 15:26:03

So did you fixed your error? And by the way, what do you think about including your implementation of MyGUI OpenGL ES renderer into MyGUI repository?

ShiftZ

23-11-2010 16:25:06

Yes, its fixed.

what do you think about including your implementation of MyGUI OpenGL ES renderer into MyGUI repository?

That what i was thinking about when created that topic viewtopic.php?f=17&t=13485

I've made OpenGL ES renderer for CEGUI, that wasn't hard at all, but as i can see most people here uses native Ogre renderer even on iPhone, and there are no requests to implement ES renderer except mine. So i decided to intergrate mygui with my own render engine.

Fortunally, i have a pair of contribution for you, i hope more useful then OpenGL ES renderer.