[SOLVED]Library question - MogreNewt, Miyagi

PantheR

23-10-2009 08:05:28

I have a hard time making my project work right :( Different versions of addon dlls make me sick realy. I was working with MogreNewt dll that utilizes callback UserProcess fuction of type: public override Int32 UserProcess()
Now i want to use Miyagi and i've got many exceptions so i've decided to recompile all libraries manualy to be sure they all use single Mogre version dll. I've got latest SVN sources of MogreNewt and Miyagi and compiled them, but i've got another problems:
1. MogreNewt library versions seems to be different!
Was OK: public override Int32 UserProcess()
SVN: public override void UserProcess(ContactJoint contact, float timestep, int threadIndex)

WasOK: Body.AttachToNode(Node)
SVN: Body.AttachNode(Node)

Was OK: MogreNewt.MomentOfInertia.CalcSphereSolid()
SVN: ??? No MomentOfInertia namespace! How to get Inertia?


My OK version is well tuned and was working, now i don't know what to do. Can anyone comment on about that differences? Can i somehow still get th version with public override Int32 UserProcess()? Or where i can find some info on hoe to modify UserProcess according new function definition - int is now void - how to cancel collision? Realy need some help as i'm already pissed by this dll problems :(
PS: Also in SVN sources no MomentOfInertia namespace, no m_body0 definition in UserProcess and many other things... seems to be very different version... Have no idea how to port all of this ^(

2. Miyagi from latest SDK: GuiManager.Singleton.Initialize(mMouse, mKeyboard, false); - and some redefenitions i suppose
From SVN: GuiManager.Singleton.Initialize(false); - ONLY

Is that normal? doh...

PantheR

23-10-2009 09:15:30

And tell me please - what version of MogreNewt is actual one? I found several SVN links from different people and i want to be sure that i use version that will be somehow updated and is actual at the moment :) Now i'm trying to use Gantz version i suppose: https://mogre.svn.sourceforge.net/svnroot/mogre/trunk/MogreNewt
And i definetly having some problems... Comment anyone? Should i use this version and start porting my project?
Realy don't remember from where i got prevoius MogreNewt dll... i was using it for a while, so maybe it is obsolete and in this case i have many unanswered questions about porting ^(

GantZ

23-10-2009 09:34:29

i would suggest you to use the 1.53 source, available here : https://mogre.svn.sourceforge.net/svnroot/mogre/tags/MogreNewt-1.53, the current version on svn is the 2.0 one, but it still a beta version (for mogrenewt and newton as well), and the porting is not straightforward, (lot of change have occurred in the newton library). you have 2 include to remove in the 1.53 source (the #include "OgreNoMemoryMacros.h" one) to make it compile on 1.6.

if you want to use MogreNewt 2.0 you could check this thread : viewtopic.php?f=8&t=9193, you will find some info about porting your application, also, if you have any question regarding newton 2.0, post it here.

smiley80

23-10-2009 11:20:33

Miyagi is still in beta and the API still in a state of flux.
That'll change once it becomes final. Subsequent minor (0.x.0) and patch (0.0.x) releases will try to avoid changing the API and mark members as obsolete without breaking existing code (except it has to be done to fix a bug).


2. Miyagi from latest SDK: GuiManager.Singleton.Initialize(mMouse, mKeyboard, false); - and some redefenitions i suppose
From SVN: GuiManager.Singleton.Initialize(false); - ONLY

This particular change became necessary, because MOIS isn't hardwired into Miyagi anymore.

PantheR

23-10-2009 12:13:54

Miyagi is still in beta and the API still in a state of flux.
That'll change once it becomes final. Subsequent minor (0.x.0) and patch (0.0.x) releases will try to avoid changing the API and mark members as obsolete without breaking existing code (except it has to be done to fix a bug).

This particular change became necessary, because MOIS isn't hardwired into Miyagi anymore.

Ok ok, thank you! That's fine!

i would suggest you to use the 1.53 source, available here : https://mogre.svn.sourceforge.net/svnro ... eNewt-1.53, the current version on svn is the 2.0 one, but it still a beta version (for mogrenewt and newton as well), and the porting is not straightforward, (lot of change have occurred in the newton library). you have 2 include to remove in the 1.53 source (the #include "OgreNoMemoryMacros.h" one) to make it compile on 1.6.
Thank you! I will try now to compile and use 1.53 version. Will see if it is ok...

PantheR

23-10-2009 12:32:07

Btw, another question - very tightly connected to the addons issue: i'm using VC9 as compiler - is there any way to know which files needed to run my app instead of uninformative exceptions on startup? I'm always having an issue with it... And right now too, trying to determine what the hell... HRESULT: 0x8007007E again... Any ideas?

PS: Is there any list of files - minimal on that needed to run simple app? In my plugins.cfg there is only D3D and OGL dlls defined. I'm using MogreNewt and Miyagi so...
OgreMain.dll
OIS.dll
MOIS.dll
cg.dll
RenderSystem_Direct3D9.dll
RenderSystem_GL.dll

MogreNewt.dll
Newton.dll

Miyagi.dll

All cfg files are seems to be fine. But i still have HRESULT: 0x8007007E exception. Btw, before i;ve started probing Miyagi my app was running fine. I've recompiled MogreNewt and Miyagi in Release setting by myself - changing only paths to Newton and Mogre. So... Any ideas what is missing or the way to know what my app demands to run?

GantZ

23-10-2009 13:24:22

check if you use the good dll again. you could replace the dll with the one in the SDK you use (apart the Mois, Mogre, Mogrenewt and Miyagi dll). i 've got this kind of error when i have a dll version mismatch.

also, try to test your dll (mogrenewt and miyagi) separately in a sample app first, to see if they work properly

smiley80

23-10-2009 13:36:32

Mogre needs the VC++ 2008 redist + OgreMain.dll.
MOIS only needs OIS.dll. (EDIT: not required for the one included in the 1.6.4 download)
RenderSystem_Direct3D9 needs the DirectX 9.0c redist (I believe, March 2009 is sufficient)
RenderSystem_GL needs some OpenGL dlls which should come with the driver of your graphics card.
Plugin_CgProgramManager needs cg.dll.

You can use Reflector for managed and Dependency Walker for native dependencies.
The Assembly Binding Log Viewer should show any bind failures (at least for managed assemblies).

PantheR

23-10-2009 15:13:47

Oki, thank you, i'll try it if i'll have time today!

PantheR

24-10-2009 02:08:13

Strange... smth goes wrong with additional libraries i think. I've installed:
Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)
Microsoft .NET Framework Version 2.0 Redistributable Package (x86)

The Assembly Binding Log Viewer shows ann error when i run my app:
File - msvcm90, Version=9.0.30729.4148, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

Журнал: поиск в GAC выполнен неудачно. (FAILED search in GAC)
Журнал: попытка загрузки нового URL file:///D:/my/BM/BombermanReborn/bin/Debug/msvcm90.DLL.
Журнал: попытка загрузки нового URL file:///D:/my/BM/BombermanReborn/bin/Debug/msvcm90/msvcm90.DLL.
Журнал: попытка загрузки нового URL file:///D:/my/BM/BombermanReborn/bin/Debug/msvcm90.EXE.
Журнал: попытка загрузки нового URL file:///D:/my/BM/BombermanReborn/bin/Debug/msvcm90/msvcm90.EXE.

Cannot find file in those directories, sure... I've tried to copy file with the same exact version into app directory but got another strange error:
Smth about MDA and wrong use of C Runtime library. Damn it. Realy tired of all this dlls crap :( Suppose that strict copying is smth like hack, so... doh... just want it all begin to work :((

PantheR

24-10-2009 02:43:29

Mmmm... just tested on a new project. It seems to be MogreNewt causing this problem... Miyagi don't spoil anything on simple GuiManager operations, but when i init mWorld of MogreNewt library then the error described above occurs... Investigating what might be wrong with manual Build... any clues will be helpful.

Btw, Gantz and smiley80 - thank you for your help! Digging next...

PantheR

24-10-2009 03:57:14

Ok guys, the question is off, just solved the issue by recompiling MogreNewt... ftw, don't know what i've changed realy O.o but it works now.

PS: FPS in my app bossted up to 4x times O.o well, neat side effect :)))

Gantz, It seems to be that 1.53 version of Newton is the version that i was using before ;) So by now it completely satisfies me and no porting needed, thank you.

smiley80, btw, i have another question about Miyagi now ^)) It'll be nice if you or someone answer me.

I've tested this piece of code, but it shows nothing :(( trying to understand what to do:


GuiManager.Singleton.Initialize(false);
Gui mygui = GuiManager.Singleton.CreateGui("lvleditor_gui");
GuiManager.Singleton.DefaultTextScheme = GuiManager.Singleton.CreateTextScheme("MyTextScheme", "bluehigh.ttf", 16, 72, ColourValue.Black);
GuiManager.Singleton.Cursor = new Miyagi.Core.Cursor("CursorMaterial", new Miyagi.Core.Size(16, 16), new Position(0, 0), true);
GuiManager.Singleton.CreateMaterialScheme("PanelMaterial", typeof(Miyagi.Controls.Panel), "Panel", true);
Miyagi.Controls.Panel panel = new Miyagi.Controls.Panel("aa", "PanelMaterial", new Miyagi.Core.Size(100, 300), new Position(100, 100));
panel.Show(false);

GuiManager.Singleton.Update(false); //In main cycle

Am i using right scheme for material creation of "PanelMaterial"? And as i understand Miyagi searches for media files staring with "Panel" and converts them to MaterialScheme "PanelMaterial". I've checked - images has been loaded... no signs of a panel...

smiley80

24-10-2009 07:52:57

You have to add the panel to the gui:
mygui.Controls.Add(panel);

And make sure the texture file names follow the naming convention of the materials.
I.e., you have to have a texture file called 'Panel.png' (or any other supported image format).

PantheR

24-10-2009 14:13:13

You have to add the panel to the gui:
mygui.Controls.Add(panel);

Ah yes! That's the point! Thank you!