Daki
Topic Author
Posts: 57
Joined: 16 Aug 2013, 00:48

Ogre Bindings and VS11

17 Aug 2013, 22:35

I recently purchased a Noesis GUI library and I am trying to integrate into my existing project using Ogre and VS11 on Windows 8. I would really prefer not to have to downgrade my IDE to integrate NoesisGUI but I am running into a lot of issues so hopefully someone can help me.

I downloaded the NoesisGUI Ogre Bindings. This is a VS10 project so I upgraded converted it to VS11. I also replaced the included Ogre libraries with ones I compiled against VS11 (the same ones I am using in my project) and replaced the boost libraries with the ones from my Ogre build. After all of this the project builds.

When I try to run the sample projects however Ogre can't seem to locate the Direct3D 9 render system, which is odd because it is specified in the plugins.cfg and there is a ogre.cfg file saying that the D3D system is the default. Presumably this should be loaded and the window to choose configuration options should be bypassed but it is not. When I check the root for its available renderers there are none. Neither sample runs in debug because they are looking for MSVCP100D.dll and I am using VS11.

The OgreBindings project builds though so I integrated it and Noesis into my project. Everything compiles and links fine. However I notice two issues.

1) The Ogre Bindings are assuming that the window is created automatically. I am creating one manually because I need more control over its initialization. I had to write a new Noesis_Init method to take a window as a parameter in order to have gD3D9Device come from the right window. This was simple to do but regardless of my VS11 issues this is a bug which would probably be fixed in future versions.

2) When I call Noesis_Init the application crashes when it calls NsGetKernel()->InitSystems(); This happens in both debug and release. I would paste my log but it appears to be encoded in some odd format and there are a lot of null characters so pasting is difficult. One potentially relevant line is "guids.txt not found". I am not sure why this is as I copied the media folder containing this and the other Noesis assets from the OgreBindings example. I've tried placing those assets in various locations (the default location in the same directly as the sln, in the same directory as the build, etc.) but I always see that in the log.

So I am currently stuck. My next step is try and downgrade to VS10 but I really do not want to do that. If anyone can help I would appreciate it. Thanks!

EDIT:

I installed VS10 and ran the Ogre Bindings project again with unmodified files (except for changing the SetDebugFlags function to SetFlags so it compiles) and I still get the same odd behavior with no available renderers.
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: Ogre Bindings and VS11

18 Aug 2013, 19:23

Hi,

I have just downloaded a clean version of the OgreBindings now, copied NoesisGUI 1.0.2 include, libraries and dlls to the proper directories. I just opened the solution with VS2010, compile it and it seems that eveything is working fine, both OgreTicTacToe and BasicOgreSample.

So before, going to VS11 and changing the Ogre version, let's try to solve this scenario.

So, if I understand you right, in this scenario you get an error from Ogre saying that there are not renderers available?
 
Daki
Topic Author
Posts: 57
Joined: 16 Aug 2013, 00:48

Re: Ogre Bindings and VS11

20 Aug 2013, 02:43

Thanks for the response!

I re-downloaded clean versions of Noesis GUI and the updated bindings project and put all the resources where they belong.

I believe the error with no renderers is due to a resource path issue. I was attempting to run this in VS10 Express which does not support solution folders and the Ogre Bindings project relies on it. When I changed paths to absolute values it picked up the properties and was able to progress further, but it fails trying to use some resources: "[DX9] Resource Gui/Core/BaseStyle.xaml not found". This error occurs within the call to NsGetKernel()->InitSystems() on line 297 in OgreNsGuiBindings.cpp.

I then attempted to load the project as a VS11 project (which supports solution folders in the express version) but maintaining the v100 toolset. The same errors occur. Without absolute paths the plugins and resources files cannot be located, and with full paths it progresses until the error with BaseStyle.xaml.

These errors appear to be specific to how these VS solutions are configured to build so I am going to attempt to move on. Before trying to recompile things for VS11 I will investigate how easy it will be to link against v100 versions of the other libraries I am using in my project, and switch to the v100 compiler. If that is doable I am not opposed to using it as a solution for now. I will post relevant updates as I progress.

It would be nice however to get the sample running, and I am sure it will helpful to reference later on so if you have any suggestions with that I would still like to discuss it.

Lastly, the project I am working on that will be using Noesis is a side project that I can only devote time to in my free time (I program games all day at my real job then come home and program games again :) ), so please forgive me if it takes me a while to respond or post updates - some days I can only devote a very small amount of time to this.
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: Ogre Bindings and VS11

20 Aug 2013, 15:41

I believe the error with no renderers is due to a resource path issue. I was attempting to run this in VS10 Express which does not support solution folders and the Ogre Bindings project relies on it. When I changed paths to absolute values it picked up the properties and was able to progress further, but it fails trying to use some resources: "[DX9] Resource Gui/Core/BaseStyle.xaml not found". This error occurs within the call to NsGetKernel()->InitSystems() on line 297 in OgreNsGuiBindings.cpp.
I think you are not far from solving this. Let me explain this error: "[DX9] Resource Gui/Core/BaseStyle.xaml not found".

NoesisGUI needs at runtime a cache of resources. That cache is generated by our data builder and contains optimized files to be loaded very fast on each supported platform. By default, the cache is in the folder $EXE_PATH/Data. For example, in our SDK, you can find the cache for DX9 in the following path: NoesisSDK/Bin/Data/DX9

That is the default, but it can be changed by implementing a custom FileSystem and setting it before kernel initialization. OgreBindings are exactly doing that:
Noesis::Core::SetErrorHandler(NoesisErrorHandler);
NsGetKernel()->Init();

// Configure systems before their initialization
//@{
Ptr<IFileSystem> ogreFileSystem = *new OgreNsGuiFileSystem();
IResourceSystem::SetFileSystem(ogreFileSystem.GetPtr());

gD3D9Device->CreateStateBlock(D3DSBT_ALL, &gStateBlock);
IDX9RenderSystem::SetDevice(gD3D9Device);
//@}

NsGetKernel()->InitSystems();
The implementation of the filesystem is here: https://github.com/Noesis/OgreBindings/ ... System.cpp

I am not an Ogre expert but I think that debugging with this information you should be able to get it working with VS2011. Probably a simple change in the filesytem implementation will do it.

Ok, let's see if this helps.
 
Daki
Topic Author
Posts: 57
Joined: 16 Aug 2013, 00:48

Re: Ogre Bindings and VS11

21 Aug 2013, 02:02

So I changed everything over to use absolute paths. The plugins, resources, and ogre config files are all specified this way, and the resources within the resources.cfg file are also absolute paths. Ogre uses this file to locate resources so within it are all the Noesis GUI resource paths.

I verified that these are being set in Ogre properly and I put a breakpoint in OgreNsGuiFileSystem::OpenRead() to see when it is called with what file names. When NsGetKernel()->InitSystems() is called, it goes down into OpenRead and a few assets seem to load correctly. First the guids.txt file loads, then "C2FED14B4EE93F696FB2BA80E50E5005" which is mapped to Drawing/VGL/vglMask.shader, then "47130F8848A7B317F97122B7C00AEFDE" which is mapped to Drawing/VGL/vgl.shader. Both of those file names (the hex strings) exist within the media/NoesisGUI directories. Then it attempts to load "1F6F960C4EAB923AC20C789B4D09C01B", which corresponds to Gui/Core/BaseStyle.xaml and fails to locate the resource. I have no file within media/NoesisGUI with this name so this makes sense. You can see in the github repository that there is no resource with that name:

https://github.com/Noesis/OgreBindings/ ... I/Gui/Core

I am not sure if I need to do something to build this resource, of it is is supposed to be included. You mentioned it built and ran for you so I am curious if you have the resource and if so, how you got it.
 
Daki
Topic Author
Posts: 57
Joined: 16 Aug 2013, 00:48

Re: Ogre Bindings and VS11

21 Aug 2013, 04:11

I am also a little unsure on the proper way to integrate these bindings into an existing project. I had thought to include the generated OgreNsGuiBinding.lib and OgreNsGuiBinding_d.lib into my project but I noticed when examining the lib files they contain absolute paths on my computer to included files. I am not extremely well-versed in the nuances of statically linked libraries but this path information worries me as it seems like it would be tying that lib to a specific location on a specific computer.

Can you provide more detail on how you intend one to integrate the bindings into an existing project?
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: Ogre Bindings and VS11

21 Aug 2013, 11:03

It seems that all the problem was that the cache was not properly updated in the git repository. I have update it now. Let me know if this fixes your problems. Sorry for the inconvenience.

About the lib files... where are you seeing absolute paths?
 
Daki
Topic Author
Posts: 57
Joined: 16 Aug 2013, 00:48

Re: Ogre Bindings and VS11

22 Aug 2013, 03:16

Thanks for updating the repository, the sample bindings project builds correctly now.

Now for integrating it into my existing project, here is where I am:

I've temporarily got my project compiling as a VS10 project to eliminate compatibility issues there. One problem I do have still though is this:
The Ogre Bindings are assuming that the window is created automatically. I am creating one manually because I need more control over its initialization. I had to write a new Noesis_Init method to take a window as a parameter in order to have gD3D9Device come from the right window. This was simple to do but regardless of my VS11 issues this is a bug which would probably be fixed in future versions.
For some reason, even though my custom initialize method works when I call it from the TicTacToe and Sample applications when I try to use it in my own project I get an unresolved external error. I've been looking at it for a few hours now and I am stumped as to why. As I mentioned earlier I am not well-versed in creating and debugging issues with libs. Is there any way this functionality can be built into the bindings?

This also leads me back to my previous question of what is the recommended method for integrating the bindings into an existing project? As I said earlier I am copying the libs, the headers, etc. into my project but I am not sure this is the intended method so I would really appreciate clarification here. My libs also still have many full paths on my filesystem built into them. It's hard to describe precisely where as the file is binary but they are numerous.

Again, I am just assuming that I am supposed to copy these libs because I don't see any description of how to go from the steps listed on the github page for the bindings to the steps in the Ogre Integration Tutorial. This is the most important point that I need clarification on.

Thanks for your continued help!
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: Ogre Bindings and VS11

22 Aug 2013, 03:41

Hi,

I am writing you from a tablet now so I cannot extend much. Will do it later. But I wanted to make a fast clarification that may help you.

Libraries are headers do not need to be copied. You can adjust the path to them from your visual project. As soon as your project compiles fine the story ends here.

But, the binaries (noesis.dll and everything you find in the NoesisSDK/Bin/ directory) must be in the same location than your executable.

I think that this is the problem you are probably facing.
 
Daki
Topic Author
Posts: 57
Joined: 16 Aug 2013, 00:48

Re: Ogre Bindings and VS11

22 Aug 2013, 04:15

Thanks for taking the time to respond on your tablet.

When I copy them it is because I need the libraries to be included inside of my existing project because it is under source control . When a teammate updates they need to get the libs and headers and those libs need to work on their machines (hence my concern about my absolute paths showing up inside the libs). I've copied them from the Ogre Bindings project into my existing project for this purpose. This is what I am doing for all the other libraries I am using too.

My question was more about should existing projects link to the libs generated by the Ogre Bindings project (which your response seems to suggest), or is there another method that is preferred for integration?

Who is online

Users browsing this forum: No registered users and 2 guests