Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Anyone want to help me choose a framework for some tools I want to write [Windows 7]?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
17 replies to this topic

#1 CDProp   Members   -  Reputation: 1032

Like
1Likes
Like

Posted 14 August 2012 - 09:44 PM

It would be much appreciated.=)

Basically, the apps are just some tools to assist in game programming (editors and the like). So, there needs to be a panel that displays a 3D scene, along with a toolbar, property grid, etc.

I've written one such app before using WinForms in C#. I've found it to be a bit of a pain, because the 3D scene drawing was all done by a native C++ DLL, and I had to use p/Invoke in order to make calls into it. This means that my C++ DLL needed to have a flat API of C-linked functions (I could have omitted that step, but who wants to deal with mangling?). I could only marshal across PODS, basically, and I certainly couldn't instantiate C++ classes and manipulate the objects directly. The worst problem, though, is that any time I had an unhandled exception in the C++ DLL, I didn't get any information about it except a generic message that said "Something went kaboom" (or something equally uninformative).

I've also written one such app using WPF, but it had the same problem as above, with the additional problem that WPF doesn't give you a separate window handle for each control; instead, the entire window shares a device context, and so drawing just to one panel control (say) is difficult. The easiest solution ended up being to render to an offscreen buffer and read the pixels back, which was kinda gross.

I suppose I could use p/Invoke to make a thin wrapper around OpenGL32.dll (which I haven't tried before, but seems like it'd work), but I'd much rather just link to the same engine DLL that my game uses, so that code gets reused, instead of duplicating all of the functionality I need in C#.

So, I'm really itching to do something in native C++. What are my options here? As far as I can tell: Win32, MFC, and Qt. Out of these three, only Qt seems modern and friendly enough to use. However, it's the only one that I have no experience with.

What is the deal with the SDK? I installed it, and it's gargantuan (more than a gig), has it's own SDK, and installed some drivers on my machine (one of which was unsigned). I feel like I've swallowed a cow. I don't want to use their IDE. I see there is a Visual Studio Qt addon, so I suppose that would work. What do you think? Is it worth all of this? I was hoping for just a set of libraries and headers that I can link/include in my project.

My GUI needs are pretty simple. Window, menu, toolbar, property grid, panel with 3D scene. I can roll all of this programmatically; I don't need resource files, wizards, WYSIWYGs, etc. I admit I'll miss Xaml, though. =D

Edited by CDProp, 14 August 2012 - 09:46 PM.


Sponsor:

#2 Xanather   Members   -  Reputation: 712

Like
1Likes
Like

Posted 14 August 2012 - 11:03 PM

You could use C# to create a windows form and add buttons and such to it, and draw the scene on the form with XNA.

https://www.google.com.au/search?q=XNA+Windowsforms

it can be done:
http://www.codeproject.com/Articles/21330/Easy-Rendering-with-XNA-Inside-a-Windows-Form

Enjoy :)

#3 joew   Crossbones+   -  Reputation: 3677

Like
2Likes
Like

Posted 14 August 2012 - 11:41 PM

You could always take a look at wxWidgets which is lightweight in comparison to Qt

#4 CDProp   Members   -  Reputation: 1032

Like
0Likes
Like

Posted 14 August 2012 - 11:48 PM

I made a few C#/WinForms XNA apps for sprite sheet creation on an old 2D project. It was pretty cool. For this, though, I'd rather use the graphics DLL I wrote in native C++ so hat the tools and the game share the graphics engine.

wxWidgets looks fantastic.

Thanks for the suggestions, people.

#5 Eliad Moshe   Members   -  Reputation: 812

Like
0Likes
Like

Posted 15 August 2012 - 04:47 AM

The win32 API will give you the freedom you seek.

#6 ChaosEngine   Crossbones+   -  Reputation: 2473

Like
4Likes
Like

Posted 15 August 2012 - 04:29 PM

The win32 API will give you the freedom you seek.


Yep, and it will give you the freedom to write roughly 5 times the amount of code compared to an equivalent winforms app. :D


I've written one such app before using WinForms in C#. I've found it to be a bit of a pain, because the 3D scene drawing was all done by a native C++ DLL, and I had to use p/Invoke in order to make calls into it. This means that my C++ DLL needed to have a flat API of C-linked functions (I could have omitted that step, but who wants to deal with mangling?). I could only marshal across PODS, basically, and I certainly couldn't instantiate C++ classes and manipulate the objects directly. The worst problem, though, is that any time I had an unhandled exception in the C++ DLL, I didn't get any information about it except a generic message that said "Something went kaboom" (or something equally uninformative).

Your C++ engine has a defined API, right? Wrap that in C++/CLI and call it from winforms.
if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight

#7 CDProp   Members   -  Reputation: 1032

Like
0Likes
Like

Posted 15 August 2012 - 05:28 PM

Your C++ engine has a defined API, right? Wrap that in C++/CLI and call it from winforms.


Hmmmm, this sounds promising. So how does this work? I write a C++\CLI wrapper library that links to the native C++ library, and then write a C# WinForms app that references the C++\CLI wrapper?

Edited by CDProp, 15 August 2012 - 05:33 PM.


#8 nfactorial   Members   -  Reputation: 731

Like
3Likes
Like

Posted 15 August 2012 - 05:42 PM

If you wish to use C# for your tools development (which I recommend), I would suggest you use SlimDX for your 3D API.

http://SlimDX.org

It a nice clean wrapper around DirectX and what I use for my own tools.

#9 CDProp   Members   -  Reputation: 1032

Like
0Likes
Like

Posted 15 August 2012 - 05:58 PM

I loooove SlimDX, but for this particular set of tools I want to link to my game engine, which is written in C++.

#10 Flimflam   Members   -  Reputation: 657

Like
2Likes
Like

Posted 15 August 2012 - 07:17 PM

Hmmmm, this sounds promising. So how does this work? I write a C++\CLI wrapper library that links to the native C++ library, and then write a C# WinForms app that references the C++\CLI wrapper?


Yes, this is essentially what you do.

#11 ColinDuquesnoy   Members   -  Reputation: 1142

Like
1Likes
Like

Posted 16 August 2012 - 03:24 AM

You could also use swig( http://www.swig.org/) to expose your API to C# or Python and then use Winforms or PyQt to write your tool.

#12 MichaBen   Members   -  Reputation: 481

Like
1Likes
Like

Posted 16 August 2012 - 05:49 AM

Out of these three, only Qt seems modern and friendly enough to use. However, it's the only one that I have no experience with.

From my experience with Qt, it's fairly easy to get used to.

What is the deal with the SDK? I installed it, and it's gargantuan (more than a gig), has it's own SDK.

The biggest part of this SDK seems to be the debug version of the libraries, which because Qt is so extensive are rather large as well.

I don't want to use their IDE.

Is there is a reason why you don't want to use it? The QtCreator IDE is pretty advanced, in certain aspects even superior to visual studio. You can setup multiple compilers with the IDE, you if you select the same compiler you used for your engine you probably can link to the libraries compiled there, and just write the GUI code in it.

#13 nfactorial   Members   -  Reputation: 731

Like
1Likes
Like

Posted 16 August 2012 - 11:35 AM

I loooove SlimDX, but for this particular set of tools I want to link to my game engine, which is written in C++.


Ack, sorry, I misunderstood then. Embedding your engine and such is all a decision you must make ofcourse.

I actually don't embed my C++ engine, as it introduced a lot of pollution between the tools and the code. Which was just my experience with that I was trying to achieve.

I would propose, as an alternative (ie. it's upto you ofcourse, I'm just "putting it out there"), writing a simple network connection between your tools and a running game. It provides you with everything an embedded solution does but with a more defined border between tools code and game, it also allows remote debugging and so on and can just be compiled out in a release/master build if desired. Whether that fits what you're after or not, is entirely dependant on what you're wanting out of it all ofcourse.

n!

#14 jwezorek   Crossbones+   -  Reputation: 1949

Like
1Likes
Like

Posted 16 August 2012 - 12:05 PM

Another C++ based application framework that is lighter weight than Qt but with a more modern design than wxWidgets (imho) is Juce.

#15 CDProp   Members   -  Reputation: 1032

Like
0Likes
Like

Posted 16 August 2012 - 12:48 PM

Whoa, there are so many options out there that I wasn't even aware of. I think the idea of the network interface between the game and the tools is particularly creative. I will also look into Swig and Juce, and give Qt another look. I don't mind using Qt Creator, I guess, and I know that there are some Visual Studio plugins for it. I was just a bit taken aback by the scope of it, because it was quite a bit larger than what I needed (although I son't doubt that developers of more-complex GUI apps find it extremely helpful).

#16 MichaBen   Members   -  Reputation: 481

Like
2Likes
Like

Posted 17 August 2012 - 03:02 AM

Qt is made up of several individual modules, when you install the SDK it will install them all, but you don't have to use them all. The QtCore and QtGui libraries are enough for simple GUI applications, all other modules are optional, if you don't use them you don't have to link to them and you will not have a dependency on that dll either. Other modules include multimedia library (audio and video), svg rendering, networking, webkit (for embedding html), scripting, sql, opengl, openvg and xml. You probably won't touch them for a simple GUI application.

#17 archqt   Members   -  Reputation: 103

Like
0Likes
Like

Posted 18 August 2012 - 08:31 AM

Hi,
i have used wxWidgets for years and it is a nice framework. But Qt is easier to use and far more powerfull than wxWidgets. You will create your software quicker and in a more nice way. I recommend you to use QtCreator and to create all interface with it.
See some tutorial (even on Youtube) to know how to use QtCreator. You will see that it is quicker than wxWidgets.
If you want to use wxWigdgets use wxFormBuilder to construct your interface but...less nice than QtCreator.
See you

#18 archqt   Members   -  Reputation: 103

Like
0Likes
Like

Posted 19 August 2012 - 06:10 AM

Another C++ based application framework that is lighter weight than Qt but with a more modern design than wxWidgets (imho) is Juce.


Yes but it exists only in GPL and Commercial licence. Qt exists in GPL or LGPL licence.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS