unclebob Posted October 13, 2014 Share Posted October 13, 2014 Hello, ladies and gentlemen! Good news for every human being living in a managed world. Description A simple wrapper (source code included) which shows how to integrate Unigine with .NET and create apps (both WinForms and WPF). You have to have Unigine SDK if you want to use this sample. Build Instructions Extract contents of dot_net_sample.zip to <SDK> directory. Final path should be: <SDK>/source/samples/App/DotNet1. Make sure that $(UNIGINE_DIR) system variable set to Unigine 2.0 Alpha preview installation directory. Open Unigine.NET.sln in VS2012/VS2013; Select build configuration (Debug/Debug Double/Release/Release Double) and platform (x86/x64) according to your needs; Build Solution (F7); Copy <SDK>/source/samples/App/DotNet/unigine.cfg inside <built solution dir>/bin folder; Run built applications (AppWinForms.exe or AppWPF.exe); Have fun! Note: if you want to use float binaries from the sim sdk, you have to copy them inside <sdk_root>/lib folder in order to compile sample properly. You can find this sample in the attachments. Feel free to ask any questions! dot_net_sample.zip 1 Link to comment
scott.richmond Posted October 13, 2014 Share Posted October 13, 2014 Great thanks! I'll check it out tonight. What's your plan with this integration at the moment? Do you plan to officially support it and start building a framework around it? Link to comment
scott.richmond Posted October 14, 2014 Share Posted October 14, 2014 Couple of things: I followed your instructions - It compiled fine and ran fine. When I hit the Load button it crashes. I tried with all 4 build configuration options. I'm using the Sim 2.0 Alpha SDK. Maybe I'm mistaken, but this is just a C#-based bootstrap loader? All game/engine code must still be done in C++? I had hoped this was the beginning of moving to a more modern managed scripting framework. Link to comment
silent Posted October 14, 2014 Share Posted October 14, 2014 scott.richmond I followed your instructions - It compiled fine and ran fine. When I hit the Load button it crashes. I tried with all 4 build configuration options. I'm using the Sim 2.0 Alpha SDK. Sorry, can't reproduce. If you are using Sim SDK you need to build Double configurations. For example, Debug Double x64. After that you should copy unigine.cfg into DotNet/Debug Double/x64/bin directory. Could you please provide more information about this issue: Is AppWPF sample is working (only AppWinForms not working)? Is there near AppWinForms.exe and AppWPF.exe engine log file (log.html)? If there is log file could you please attach it in your response. If you copy <SDK>/lib/Unigine_x64d,dll into DotNet/Debug Double/x64/bin directly and launch samples again will they crash? Maybe I'm mistaken, but this is just a C#-based bootstrap loader? All game/engine code must still be done in C++? I had hoped this was the beginning of moving to a more modern managed scripting framework. Yes, currently it is C#-based loader. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
scott.richmond Posted October 14, 2014 Share Posted October 14, 2014 Hey Silent, Thanks for replying. However I had mistaken this feature to be the beginnings of a C#-based framework to replace your depreciated UnigineScript. I'm not interested in a C#-based loader, so I'll stop here. Thanks anyway! Link to comment
unclebob Posted October 14, 2014 Author Share Posted October 14, 2014 Hey Scott, The trickiest part is to wrap Unigine interpreter as it's using C++ templates a lot. There should be no problems to wrap the rest though. Link to comment
scott.richmond Posted October 14, 2014 Share Posted October 14, 2014 I take it you guys aren't interested in doing it yourselves and officially supporting it though? Link to comment
binstream Posted October 14, 2014 Share Posted October 14, 2014 Scott, adding C# API is in the to do list, but it doesn't has high priority for now. Link to comment
binstream Posted October 23, 2014 Share Posted October 23, 2014 There is some progress on C# API: it will have the same level of access as C++ API. 1 Link to comment
scott.richmond Posted October 24, 2014 Share Posted October 24, 2014 There is some progress on C# API: it will have the same level of access as C++ API. That's great news! When do you expect to deliver the first implementation? Link to comment
maimonides Posted October 24, 2014 Share Posted October 24, 2014 [dream on] As a last phase of this .net integration, please migrate all your script code to .net. [dream off] Link to comment
binstream Posted October 25, 2014 Share Posted October 25, 2014 That's great news! When do you expect to deliver the first implementation? I guess it will be available in alpha 2. Link to comment
scott.richmond Posted October 25, 2014 Share Posted October 25, 2014 I guess it will be available in alpha 2. Not exactly a helpful piece of information there. When is Alpha 2 due? Early 2015? Link to comment
alcino.major Posted October 30, 2014 Share Posted October 30, 2014 Can Unigine be hosted by .NET application through ActiveX? Link to comment
silent Posted November 6, 2014 Share Posted November 6, 2014 alcino.major Yes, it would be possible with the next SDK update. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Simon.Anderson Posted May 8, 2015 Share Posted May 8, 2015 Hi, I'm trying to use the sample with the UNIGINE 2 Game SDK source but there are headers and things that seem to have moved all over the place so I'm having trouble compiling this. Is there an update for the sample or any other examples of setting up a .net project available? Cheers, Simon Link to comment
silent Posted May 8, 2015 Share Posted May 8, 2015 Hi Simon, I'm afraid this sample is deprecated, because we added recently C# API and few examples of intergration: https://developer.unigine.com/en/docs/1.0/csharp_api/usage/unigine_app/ They are available for download through the new SDK Browser (if you are using latest beta2 SDK). Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
kevinEval Posted June 14, 2015 Share Posted June 14, 2015 One additional question here as I did not find the answer on your site (I apologize if I overlooked it). So given the current state of the C# API, would you think there are any disadvantages of using C# instead of C++ API? Or would you say the C# API is very much production-ready in all scenarios the C++ API can be used in? Link to comment
silent Posted June 15, 2015 Share Posted June 15, 2015 Hi Kevin, Yes, the C# API is production ready. C# also can be a little slower then C++ API in some cases. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Simon.Anderson Posted July 3, 2015 Share Posted July 3, 2015 Hang on - just to get things straight here. As of now we can use c# as an alternative to uniginescript correct? This means we basically just upgrade any deprecated c++ code to 2.0 and then we can bind any backend code (c++) with frontend c# AND/OR uniginescript right? If not - is this in the roadmap? and if so when is it planned for? I'd really like this cleared up as I've informed my team that we no longer have to use uniginescript and we are making plans to switch to c# (dynamic breakpoints being one of the main reasons). Link to comment
Simon.Anderson Posted July 3, 2015 Share Posted July 3, 2015 Also, I'm still struggling to get a c# sample working within a WPF application using xaml. I'd like to bind some basic xaml UI controls to perform actions in Unigine. If you had a simple walkthrough on how to set this up I think you'd make a lot of people happy! Link to comment
silent Posted July 3, 2015 Share Posted July 3, 2015 Hi Simon, As of now we can use c# as an alternative to uniginescript correct? Yes, but there not all the UnigineScript functions available in C# and C++ API. We are continue to extending these APIs and we hope to export all the UnigineScript function to the C++ / C# API by the end of this year. This means we basically just upgrade any deprecated c++ code to 2.0 and then we can bind any backend code (c++) with frontend c# AND/OR uniginescript right? Yes, I think it is possible even right now. Also, I'm still struggling to get a c# sample working within a WPF application using xaml. I'd like to bind some basic xaml UI controls to perform actions in Unigine. Could you please provide us a sample with build instructions where you are getting issues? We would try to help you and maybe if everything will work fine add a new sample to the C# section with WPF and xaml. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Simon.Anderson Posted July 3, 2015 Share Posted July 3, 2015 Ok - great that you're working towards a complete c# api. As far as the WPF goes - 2 problems: 1. How do I embed the unigine 3d window into a xaml application? Should I use a xaml control/binding to do this? 2. How do I map xaml control events (button press etc) back to unigine? These are the two biggest problems - not even at the compile error stage yet. So, if you make some suggestions on how to do this I'd me more than happy to implement it and give you the code! Cheers, Simon Link to comment
Simon.Anderson Posted July 3, 2015 Share Posted July 3, 2015 Ok - so as far as 1. goes it looks like using WinformsHost in the xaml file to host the unigine window might be an option right? Link to comment
Recommended Posts