Shard Posted July 13, 2010 Share Posted July 13, 2010 Is it possible to use windows forms with Leadwerks? The basic setup I'm trying to do is have buttons and value boxes on the bars on the sides of the main window with a Leadwerks window rendering things in the center. The reason I need this is because I'm looking to do a fairly complicated UI with multiple options and settings but I don't need the UI to be run on top of Leadwerks, since this is not for a game (for that, I'll be using CEGUI) and instead for a sim. Is this possible? Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
ZioRed Posted July 13, 2010 Share Posted July 13, 2010 I would suggest to do it in C# if you can, for anything UI related I think C# is much more simpler than C++ and we already have a render control that you can add in a .NET Windows Form. Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
Shard Posted July 13, 2010 Author Share Posted July 13, 2010 I would suggest to do it in C# if you can, for anything UI related I think C# is much more simpler than C++ and we already have a render control that you can add in a .NET Windows Form. Could you explain this a bit more as I have not done much C# and I don't know anything about the render controls or .NET. Also, I'm far more proficient in C++ and I would much rather code this sim in C++. Is there anyway to do this in C++? Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
ZioRed Posted July 13, 2010 Share Posted July 13, 2010 With C# you can create a Windows Form application and then "draw it" drag&dropping components from a huge list (and the C# community has released a NET control to render LE inside it, thanks to klepto). But if you want to code in C++ then Pixel Perfect has published a showcase some days ago for its own navArea editor in which he has the scene rendered in an area of the window (may be you need GL commands), may be he can help. Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
Shard Posted July 13, 2010 Author Share Posted July 13, 2010 With C# you can create a Windows Form application and then "draw it" drag&dropping components from a huge list (and the C# community has released a NET control to render LE inside it, thanks to klepto). But if you want to code in C++ then Pixel Perfect has published a showcase some days ago for its own navArea editor in which he has the scene rendered in an area of the window (may be you need GL commands), may be he can help. I've asked Pixel to take a look at this thread. Is it possible for someone to post a sample project in C# so that I can take a look at how its setup. Also, would it be possible to port the wrapper to C++? Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Laurens Posted July 13, 2010 Share Posted July 13, 2010 We already have a "ported version of the C# wrapper". LEO Quote Link to comment Share on other sites More sharing options...
Shard Posted July 13, 2010 Author Share Posted July 13, 2010 We already have a "ported version of the C# wrapper". LEO I thought that LEO was a C++ wrapper for Leadwerks. If not, then how do I integrate LEO/Leadwerks with a windows form application? Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Roland Posted July 13, 2010 Share Posted July 13, 2010 LEO is a C++ Wrapper and nothing else. Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Laurens Posted July 14, 2010 Share Posted July 14, 2010 I may be confused here as to what you are asking. Anyway. I doubt the render control can easily be ported to C++ with all the GUI libraries around. I would strongly urge you not too use C++ for creating a GUI-heavy application anyway because C# is far better at it. It basically is just drag-and-drop. I do not have a sample lying around though, sorry Quote Link to comment Share on other sites More sharing options...
Shard Posted July 14, 2010 Author Share Posted July 14, 2010 I may be confused here as to what you are asking. Anyway. I doubt the render control can easily be ported to C++ with all the GUI libraries around. I would strongly urge you not too use C++ for creating a GUI-heavy application anyway because C# is far better at it. It basically is just drag-and-drop. I do not have a sample lying around though, sorry Yea but its also drag and drop in C++ in a Windows Form application. The reason I'm stressing for C++ is because I want to get this product out rather than learn C#. And I do know that they are similar, but they are not the same and this will slow me down. Edit: Is the render controller source avaliable so that I can try to port it myself? I really need a Windows Forms app instead of something like CEGUI. Edit: Can someone outline the process of creating a Windows Forms Application with Leadwerks in C#(maybe a tutorial?) Again the basic idea is that in the center of the screen there is the Leadwerks window which runs all the time. On the left and right are context menus that display information based off of the item selected on screen be able able to transmit data and check data in boxes, etc. For example, if I click on the planet on the Leadwerks window, on the right bar, all the relevant boxes will come up and then in the right box, I can set the mass to be 100. Then I can click apply and the mass of the planet becomes 100 in the Leadwerks game. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
ZioRed Posted July 14, 2010 Share Posted July 14, 2010 It's a custom User Control which deeply use the C# wrapper classes. However the source is free available on the Google Code space (you should use a SVN client like TortoiseSVN to download the branch: /trunk/Leadwerks.Controls). EDIT: I'm writing some tutorials on C# in the C# Programming section of tutorials, more coming next. RE-EDIT: the thing you're speaking about (adjusting controls on a form when something happens on the LE's control) should be simple in C#, I would try something later since I need a kind of little editor too. Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
Shard Posted July 14, 2010 Author Share Posted July 14, 2010 It's a custom User Control which deeply use the C# wrapper classes. However the source is free available on the Google Code space (you should use a SVN client like TortoiseSVN to download the branch: /trunk/Leadwerks.Controls). EDIT: I'm writing some tutorials on C# in the C# Programming section of tutorials, more coming next. RE-EDIT: the thing you're speaking about (adjusting controls on a form when something happens on the LE's control) should be simple in C#, I would try something later since I need a kind of little editor too. Yes, the system would be useful in many ways. Altho I am resistant to learn C#, I think it would definitely be helpful to further my horizons and have another language under my belt. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Laurens Posted July 14, 2010 Share Posted July 14, 2010 I believe this is what you are looking for: http://code.google.com/p/leadwerks-csharp/ EDIT: Beaten to it EDIT2: Learning C# comes with great benefits. I think most people will agree when I say that building GUI applications is an order of magnitude faster in C#. And the Unified Event Model. Oh how I love the Unified Event Model. Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted July 14, 2010 Share Posted July 14, 2010 I simply capture the Leadwerks window and make it a child of mine (as per MasterXilo's original method in the old forum) and am using the WIN32 API directly - no excess baggage lol. No-one had custom buffers working with C++ at the time I started my editor although I seem to recollect MasterXilo later posted example code of doing just that so be it there were a few small issues associated with it. Looking at that and the the c# wrapper would probably be your best way forward unless you decide to just use C#. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
ZioRed Posted July 14, 2010 Share Posted July 14, 2010 As promised I superficially tested the control and was able to select a mesh from a scene loaded in the control and update some TextBoxes and NumericUpDowns, if you're still interested you can download a sample program here (requires VC# 2010, it already contains the engine and wrapper DLLs in its debug directory so you need only to start debugging from the IDE or launch the compiled debug exe). In that example you can rotate the camera with holding the right button and select a mesh/terrain with left button. EDIT: the example assumes that your SDK folder is "C:\Leadwerks Engine SDK", else you need to change the code in the Init event of the control. Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.