• Advertisement
Sign in to follow this  

[.net] GUI in managed DirectX

This topic is 4644 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm doing some research for information about building a GUI in Managed DirectX for my game but I don't have much experience on this subject (and therefore it automaticly gets more fun :P). I've checked the tutorial in the articles section but that wasn't really what I was looking for. Now to my question; Is there anyone here who has experience of building an event-driven GUI that want to share some information with me? Best regards / Patrik Svensson, Sweden P.S: Yes, I've already checked the DXUtility-GUI class that comes with DirectX but that wasn't very useful. D.S.

Share this post


Link to post
Share on other sites
Advertisement
In the SDK there is an example of GUI functions, These are built into the sampleframework that comes with the SDK. Also there is some information in Toms second book on creating your own using the sample framework.

Share this post


Link to post
Share on other sites
As i said above I've already checked the SDK-GUI Classes out.
I just wanted opinions and a discussion about it.

Toms second book? Can you be a little more specific?

Best regards / Patrik

Share this post


Link to post
Share on other sites
I've built my GUI system using MDX in C# and it's come together really smoothly. If you have specific questions, you can PM me and I'll give you any help I can provide :)

Share this post


Link to post
Share on other sites
Check out Crazy Eddie's GUI ported to C#. You can grab it from CVS here:

:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ceguisharp

It is currently the best GUI system in managed code that I've seen for a game.

Share this post


Link to post
Share on other sites
Tom Millers Second book, Beginning 3d game programming.

It goes through creating 2 complete games in 3D using the sample framework from the SDK. It also takes you through building the UI for the game including Textboxes and dialog boxes (These are built from scratch using standard mdx code).

Also a user on www.ircomm.net called 'bonk' is working on a GUI system, you might be able to get in touch with him. He has a screen shot in the gallery of his work. You can also catch 'bonk' on the irc channel #manageddx on efnet.

Share this post


Link to post
Share on other sites
Quote:
Original post by Saruman
Check out Crazy Eddie's GUI ported to C#. You can grab it from CVS here:

:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ceguisharp

It is currently the best GUI system in managed code that I've seen for a game.

Are we meant to just stick that into our brower's address bar??

Share this post


Link to post
Share on other sites
Quote:
Original post by DrGUI
Quote:
Original post by Saruman
Check out Crazy Eddie's GUI ported to C#. You can grab it from CVS here:

:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ceguisharp

It is currently the best GUI system in managed code that I've seen for a game.

Are we meant to just stick that into our brower's address bar??


No. You will need to get a CVS client. Here are a couple:
wincvs
TortoiseCVS

Personally I dispise CVS and so I would warn you to learn a little about it before you spatter your drive with a doodoo of cryptically named and permissioned files.

Share this post


Link to post
Share on other sites
GUI's aren't actually to hard to create, especially if your looking at creating a windows style one. They way I've always handled it is to create a secondary "camera" that has an orthographic projection. Then each window is rendered with 2 quads - one for the title bar and one for the actual window. Gadgets are parented onto the window using the scene graph and stuff - it really just fits in with every thing else.
Now, the solution I present may well not be the best (I don't know) but it works for me, maintains a super low fill rate so..yea :P

If you have other questions, feel free to ask away :)

Share this post


Link to post
Share on other sites
Why do people always use orthographic projections rather than transformed geometry?

Share this post


Link to post
Share on other sites
Quote:
Original post by DrGUI
Quote:
Original post by turnpast
Quote:
Original post by DrGUI
Quote:
Original post by Saruman
Check out Crazy Eddie's GUI ported to C#. You can grab it from CVS here:

:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ceguisharp

It is currently the best GUI system in managed code that I've seen for a game.

Are we meant to just stick that into our brower's address bar??


No. You will need to get a CVS client. Here are a couple:
wincvs
TortoiseCVS

Personally I dispise CVS and so I would warn you to learn a little about it before you spatter your drive with a doodoo of cryptically named and permissioned files.

Could someone just email it to me at $%^&mayna001@rbwm.org%$%^ please?


No, that's not the way forums work.


Quote:
Why do people always use orthographic projections rather than transformed geometry?


Well, why not? It's just a different matrix, your not doing anything different.

Share this post


Link to post
Share on other sites
Quote:
Original post by acid2
Well, why not? It's just a different matrix, your not doing anything different.

Well, you have the overhead on setting the matrix to DirectX (which recalculates internal concats I think) or to your shaders. Also there would be an extra matrix multiply in your vertex shader.
The above may have little effect, but the main point is that I believe it to be much easier; the only con is that you have to change its vertices when the viewport size changes.
I could be wrong, of course, but it works!

Share this post


Link to post
Share on other sites
Quote:
Original post by DrGUI
Why do people always use orthographic projections rather than transformed geometry?


I imagine that the primary reason is flexability. Using an ortho you can still use the view matrix to pan and zoom. You can also use both 3d and 2d objects together and even apply lighting (yes I know you can do this with transformed verts too). That said, there is no reason that you could not use both together. My expierence has lead me to believe that transformed verts are not easy -- sure easy to put something on the screen fast, but rather tricky to manage correctly in a useful way.

Frustrationg trying to get ahold of sources sometimes isn't it? You can browse the source three for the above project here. Don't know if it will help much though.

Share this post


Link to post
Share on other sites
Quote:
Original post by DrGUI
Quote:
Original post by acid2
Well, why not? It's just a different matrix, your not doing anything different.

Well, you have the overhead on setting the matrix to DirectX (which recalculates internal concats I think) or to your shaders. Also there would be an extra matrix multiply in your vertex shader.
The above may have little effect, but the main point is that I believe it to be much easier; the only con is that you have to change its vertices when the viewport size changes.
I could be wrong, of course, but it works!


Yea, your wrong ^_^ An orthographic matrix is a projection matrix. All you do is set a orthographic matrix in said of a perspective matrix, and thats it. No extra matrix is passed to the shader - its just a projection matrix, except orthographic not perspective.

Share this post


Link to post
Share on other sites
Edit: I understand now...

[Edited by - Krisc on March 30, 2005 5:49:53 PM]

Share this post


Link to post
Share on other sites
Ok, I have got my application running and the button shows up but when I hover over it with my mouse nothing happens...odd...I am going to show you the code via a link because it is quite large...

frmMain.cs

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Please tell me is there any link to gui makes from vb.net
i really need that for my paper.
please

Share this post


Link to post
Share on other sites
Quote:
Original post by Krisc
Ok, I have got my application running and the button shows up but when I hover over it with my mouse nothing happens...odd...I am going to show you the code via a link because it is quite large...

frmMain.cs


Link doesn't work for me.

I've done A LOT of GUI programming with MDX / C# so hopefully i can be of some help.

The base gui is fairly simple to implement but there are some controls you can design that can be quite tricky (Combo box, data grid). I'll write a monster tutorial on it one day, once i've got DB-data-bound controls done and drag 'n drop coding in.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement