Horde3D

Next-Generation Graphics Engine
It is currently 29.11.2024, 14:34

All times are UTC + 1 hour




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: .NET Project Files
PostPosted: 01.04.2009, 19:19 
Offline

Joined: 01.04.2009, 16:46
Posts: 9
Hi
I'm trying to build Horde3D 1.0.0 Beta 3 with Mono 2.0 and Monodevelop 2.0 Beta 2 on Linux.
I modified the Visual Studio project files from the download section and succeeded to compile the library. However when I try to run a sample I get an error about resource files.

Quote:
Unhandled Exception: System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Horde3DNET.Properties.Resources.resources" was correctly embedded or linked into assembly "Horde3D.NET" at compile time, or that all the satellite assemblies required are loadable and fully signed.
at System.Resources.ResourceManager.AssemblyResourceMissing (System.String fileName) [0x00000]
at System.Resources.ResourceManager.InternalGetResourceSet (System.Globalization.CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) [0x00000]
at System.Resources.ResourceManager.InternalGetResourceSet (System.Globalization.CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) [0x00000]
at System.Resources.ResourceManager.InternalGetResourceSet (System.Globalization.CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) [0x00000]
at System.Resources.ResourceManager.GetString (System.String name, System.Globalization.CultureInfo culture) [0x00000]
at Horde3DNET.Properties.Resources.get_VersionString () [0x00000]
at Horde3DNET.Horde3D.init () [0x00000]
at HordeDe.Program.Main () [0x00000]


clearly I still need to change some things in the resource files but what? anyone got any luck compiling it on linux?

VS2005 compatible MonoDevelop Project files are attached if anyone wants to modify...
PS: I separated Horde3D.NET.dll and Horde3DUtils.NET.dll. They were linked together in official .NET project file.


Attachments:
Horde3D.NET.zip [33.51 KiB]
Downloaded 843 times
Top
 Profile  
Reply with quote  
 Post subject: Re: .NET Project Files
PostPosted: 05.04.2009, 10:56 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
As you mentioned in the other thread, your problem has been solved, hasn't it? Can you tell us, what was the problem?


Top
 Profile  
Reply with quote  
 Post subject: Re: .NET Project Files
PostPosted: 05.04.2009, 14:12 
Offline

Joined: 01.04.2009, 16:46
Posts: 9
Volker wrote:
As you mentioned in the other thread, your problem has been solved, hasn't it? Can you tell us, what was the problem?


the problem was with localization files. somehow mono couldn't parse string data from *.resx files. Thanks to phoenix64 from #horde3d@freenode I made it work with hard-coding string data and getting completely rid off resource file. However as you see, it's not an elegant solution at all. So, when I have time, I'll try to port the resource files to Mono and post the final project files. It will also address some other issues such as:

*MonoDevelop IDE's VS2008 project file support is not yet very good. It would be better to provide a VS2005 project file for cross-platform compatibility. (Currently I get some errors while opening the .NET solution in MonoDevelop)
*Samples uses Windows specific code. They can be ported to other platforms with the use of GLFW instead of Winforms
*Horde3D.NET.dll and Horde3DUtils.dll are not separated. They are merged into 1 DLL file.
*PlatfromInvoke.cs contains Windows specific code. I don't know what it does but deleting it doesn't seem to affect anything on linux.
*Also it's recommended by mono team that, when wrapping native libraries in C#, it's better to call the native dlls without their extension: instead of Horde3D.dll, it should be called Horde3D. From what I understand when done in this way .NET looks for Horde3D.dll and Mono looks for libHorde3D.so which improves cross-platform compatbility. BUT I couldn't get it work yet. For some reason, in linux, it only accepst libHorde3D.so. It may be a Mono bug. I'll try to figure it out

EDIT:NodeHandle and ResHandle are not defined in .NET bindings. Is it made on purpose since they are only typedefs to int or is it forgotten?
cheers


Top
 Profile  
Reply with quote  
 Post subject: Re: .NET Project Files
PostPosted: 05.04.2009, 17:11 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
I had taken over the bindings from the original attempt by Martin Burkhard. Since then I only updated them using VS2005 and checked that there are no big problems when running the basic samples. If you can provide a better cross platform solution, I would be very thankful, since I don't have much time to do more than the basic support I did so far.


Top
 Profile  
Reply with quote  
 Post subject: Re: .NET Project Files
PostPosted: 05.04.2009, 23:30 
Offline

Joined: 01.04.2009, 16:46
Posts: 9
*I fixed resource files. It compiles OK in linux with mono. And doesn't complain about resource strings anymore.
*I kept the library as 1 dll. Utils now has its own namespace: "Horde3DNET.Utils".
*Created a config file to map shared library names correctly in any platform (except macosx because I don't know where native horde3d libraries are installed, can someone tell me or change the *.config file in attachment according to it)
This config file always should be shipped with the .NET dlls. (if you create a bin package from VS2005 it will be automatically included in the package)
*No samples and platforminvoke.cs(if necessary?) yet.

Can someone test it in windows with VS2005 or VS2008?


Attachments:
Horde3D.NET.zip [25.36 KiB]
Downloaded 806 times
Top
 Profile  
Reply with quote  
 Post subject: Re: .NET Project Files
PostPosted: 06.04.2009, 09:39 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Thanks for the patch. I adjusted the samples as well and found no problems so far in your code under VS2005.
Can you test the complete patch attached to this post under Mono?


Attachments:
File comment: Complete Patch for trunk
Horde3D.NET.zip [42.54 KiB]
Downloaded 807 times
Top
 Profile  
Reply with quote  
 Post subject: Re: .NET Project Files
PostPosted: 06.04.2009, 11:15 
Offline

Joined: 01.04.2009, 16:46
Posts: 9
I can't apply the patch :o Tried to patch to svn trunk but I get errors.

Code:
~/Desktop/horde3d$ patch --dry-run -p0 -i Horde3D.NET.patch
(Stripping trailing CRs from patch.)
patching file 'Horde3D .NET wrapper CS.sln'
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 12.
Hunk #3 FAILED at 37.
Hunk #4 FAILED at 103.
4 out of 4 hunks FAILED -- saving rejects to file 'Horde3D .NET wrapper CS.sln.rej'
(Stripping trailing CRs from patch.)
patching file 'Horde3D/Bindings/C#/Source/Horde3D .NET/Horde3D .NET wrapper.csproj'
Reversed (or previously applied) patch detected!  Assume -R? [n] ^C


I created the project files from scratch so maybe it would be better to open the new solution and import the sample projects from the old solution instead of patching against it? I can make the project file structure match the svn structure in case you want to commit new solution? (...binding/C#/...)

Also would you prefer naturaldocs instead of .NET xml docs? I can convert the .NET doc comments in the solution if you want. Since C# bindings are in the same repo as native dlls, it would be easier to generate all documents with one line of naturaldoc command?

Cheers


Top
 Profile  
Reply with quote  
 Post subject: Re: .NET Project Files
PostPosted: 19.04.2009, 10:08 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
I committed the patch to the SourceForge SVN. If there are still some problems with Mono we just have to commit another patch to the svn.


Top
 Profile  
Reply with quote  
 Post subject: Re: .NET Project Files
PostPosted: 23.05.2009, 15:47 
Offline

Joined: 10.05.2009, 07:55
Posts: 30
Does anyone have sample code how to get the device context from winform on mono/linux to get the wrapper samples running?

-tommi


Top
 Profile  
Reply with quote  
 Post subject: Re: .NET Project Files
PostPosted: 26.05.2009, 19:29 
Offline

Joined: 10.05.2009, 07:55
Posts: 30
I am trying to run C# bindings on ubuntu 9.04. Native examples work ok but when I am running program with C# bindings I get:

=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

#6 0xaec13f22 in RendererBase::loadShader (this=0xa1067c0,
vertexShader=0xaec63b04 "uniform mat4 worldMat;\nvoid main() {\n\tgl_Position = gl_ModelViewProjectionMatrix * worldMat * gl_Vertex;\n}\n", fragmentShader=0xaec63b70 "uniform vec4 color;\nvoid main() {\n\tgl_FragColor = color;\n}\n")
at /home/tlaukkan/Development/horde3d/Horde3D/Source/Horde3DEngine/egRendererBase.cpp:441
#7 0xaec1434d in RendererBase::createShader (this=0xa1067c0,
vertexShader=0xaec63b04 "uniform mat4 worldMat;\nvoid main() {\n\tgl_Position = gl_ModelViewProjectionMatrix * worldMat * gl_Vertex;\n}\n", fragmentShader=0xaec63b70 "uniform vec4 color;\nvoid main() {\n\tgl_FragColor = color;\n}\n")
at /home/tlaukkan/Development/horde3d/Horde3D/Source/Horde3DEngine/egRendererBase.cpp:522
#8 0xaec23f6f in Renderer::createShaderComb (this=0xa1067c0,
vertexShader=0xaec63b04 "uniform mat4 worldMat;\nvoid main() {\n\tgl_Position = gl_ModelViewProjectionMatrix * worldMat * gl_Vertex;\n}\n", fragmentShader=0xaec63b70 "uniform vec4 color;\nvoid main() {\n\tgl_FragColor = color;\n}\n", sc=@0xa106a8c)
at /home/tlaukkan/Development/horde3d/Horde3D/Source/Horde3DEngine/egRenderer.cpp:225
#9 0xaec246c2 in Renderer::init (this=0xa1067c0)
at /home/tlaukkan/Development/horde3d/Horde3D/Source/Horde3DEngine/egRenderer.cpp:125
#10 0xaebeeace in init () at /home/tlaukkan/Development/horde3d/Horde3D/Source/Horde3DEngine/egMain.cpp:87


Top
 Profile  
Reply with quote  
 Post subject: Re: .NET Project Files
PostPosted: 26.05.2009, 22:13 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
If you are using the trunk, you may want to check out the latest fix. The .Net bindings were not updated to the latest trunk. Should be fixed now.


Top
 Profile  
Reply with quote  
 Post subject: Re: .NET Project Files
PostPosted: 28.05.2009, 02:52 
Offline

Joined: 10.05.2009, 07:55
Posts: 30
It seems the problem was related to cmake configuration. I had changed CMAKE_BUILD_TYPE to Debug. Then it had somehow switched to Release. Maybe I had accidentally pushed some button on ccmake when doing other changes. When build with Release those two examples seem to break. After checking from fresh checkout and noticing this difference I removed the Release and then the examples started working. I am new to cmake but is this not a bit odd behaviour?

- tommi


Top
 Profile  
Reply with quote  
 Post subject: Re: .NET Project Files
PostPosted: 28.05.2009, 06:32 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
I'm a bit confused,... you are compiling the .NET bindings using cmake? I did not know that we have CMake files for the .NET bindings.


Top
 Profile  
Reply with quote  
 Post subject: Re: .NET Project Files
PostPosted: 28.05.2009, 19:27 
Offline

Joined: 10.05.2009, 07:55
Posts: 30
The .net bindings use .so files which are build with cmake. Never mind me I am out of my depth on Linux and it takes time to get adjusted to things. Your support is appreciated.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group