Skip to main content
GameDev.net gamedev.net
🔒 Locked

[.net] MDX UI subsystem.

Started by Antony52 Apr 13, 2005 at 11:07 AM 18 replies 3.4k views
Original Post
Antony52
Antony52
I know that MDX has a UI subsystem but apart from the almost non existent tutorials, apart from the Custom UI one, are there any other tutorials out there how to use it?
Krisc
Krisc
I am looking for the same thing. Specifically ones that show how to break the UI away from the framework.

edit & update: I have gotten a button to be able to show, on how to actually get it to hover I have no clue. Here is the project for others to see and try and get to working. If you do get how to get it working please help! I am very interested in getting it to work!!!!

edit 2: There is another problem when the user quits it has a problem with disposing objects and I cannot figure out why. error: "An unhandled exception of type 'System.NullReferenceException' occurred in microsoft.directx.direct3dx.dll"

lol, sorry edit 3: The fix for the null exception is to add this:
protected override void Dispose(bool disposing){	m_frame.Dispose();	m_d3d.D3D_Device.Dispose();	base.Dispose (disposing);}


^_^! Thanks,
John Sedlak

[Edited by - Krisc on April 13, 2005 7:49:36 PM]
Krisc
Krisc
I went to a good source and spoke about the problem and so I'll post the conversation here...of course, masked identity for general purposes. Maybe someone can help us shed some light on everything because I am still confused. :
Me to him:
Hi, my name is John Sedlak and I was just reading through this thread at GameDev and was wondering if you could help me with a little problem I have been having. I downloaded the April 2005 release of the DirectX SDK and I am having a little trouble stripping the GUI from the Framework code. I am able to get a button to display but hovering over the button results in no change of appearance and Clicking on it does not fire off the Click EventHandler. I have attached my project as is if you would like to take a look at the code. I would really like help in solving this problem as I have searched and searched to no avail of finding any resource on how to go about using the GUI without the Framework.

---

Him Back:
Put a breakpoint in your OnMsgProc(). Its not being called. That's why :)

Look at DXUT's SetWndProcCallback function and follow the path of how this is event is eventually called and put this kind of stuff in your app.


---

Me back to him:
I tried following through and I am not sure as to why it is not being called. I realized I left out the line: “m_frame.SetCallbackInterface(this);” but it seemed to accomplish nothing. I am so boggled…sorry if I am pestering you but it is all a little confusing right now.


---

And then him back to me:
I'm sorry I can't go deep on into this with you but I can tell you want to search for. btw, I found turning off outlining when doing file searches helps. Search for these terms in dxmut.cs and you'll see the code you'll need write:
SetWndProcCallback
WndProcFunction
WindowsProcedure <- you'll find this one also in dxmutdata.cs
Antony52
Antony52
I think that by reading the customUI example in the .chm file in the dx sdk I might come up with something. But the documentation on the DXUI is scarce to say the least if non existent. I will look more into it and post here. Thanks for all the help.
ernow
ernow
I remember a kind of promise I read in a MS blog that in the next/a future DirectX SDK the UI components will be changed so they can be used (more easily) seperately from the SDK samples.

Cheers
jollyjeffers
jollyjeffers
Quote:
Original post by ernow
I remember a kind of promise I read in a MS blog that in the next/a future DirectX SDK the UI components will be changed so they can be used (more easily) seperately from the SDK samples.

Cheers

I believe this has been done with the latest (April) release. I don't have the luxury of checking it out myself as I have to stay with the Dec04 release for now [smile]

Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
Krisc
Krisc
Yes, an important thing to note when trying to strip the GUI from the framework is that it must be done with the April 2005 release of DirectX.
Antony52
Antony52
Nevertheless it is strange that Microsoft hasnt included a documentation about this. In the documentation where did you find the Microsoft.Samples.DirectX.UtilityToolkit namespace?
Antony52
Antony52
I want to build my tool as I said which will allow to drag and drop these UI elements on a pane which will afterwards be rendered and I was looking for a toolkit which I could implement. Until now there is the DX UI toolkit and the Purple# 3d engine (www.bunnz.com) UI toolkit. Which one you think would be best?
Antony52
Antony52
Hmm, lost you there..."nvm"? Anyway I will keep trying to figure DX UI out.
Krisc
Krisc
I had posted something, a question, but I figured it out.

As for the idea of simply drag and drop I suppose you could technically write a UserControl that implemented the gui element however how tough that would be is another question.

The DirectX Sample team lead wants to write a bunch of information about all of the stuff in the samples however is a little busy at the moment to do that. I am trying to setup a site that caters to the Managed DirectX community but I cannot do anything before I get resources of my own together. I know how to use the gui now but I am using it tied into the framework.

anyways...If you want to contact me privately I suppose I can give you some helpful emails if you have any specific questions. Might want to check out Tom Miller's Blog for starters. Rick Hoskinson's Blog might be a little helpful in terms of the game loop and how to handle the DoEvents problem.
Antony52
Antony52
As I said earlier I cant find the "Microsoft.Samples.DirectX.UtilityToolkit" namespace which would be of valuable assistance. Either I am not looking where I should or it is not yet documented.
Krisc
Krisc
Ah, yes, completely sorry am I about skipping over that problem!

If you look in the samples directory and go through all the subfolders, look for files such as dxmutgui.cs and dxmut.cs and dxmutdata.cs copy these and the UI folder into your working folder, the UI goes in you solution directory, and then add them to the project. I kept them in a common folder so it looks all nice and tidy in the IDE. (The show up in a subfolder, labeled Common) that way. You can then use the namespace in your project.

hope this helps,
John
Antony52
Antony52
Hmm, I found out about those. Sorry, I meant a .chm file of some sort not the individual files but anyway thanks. Ok I had a look into the UI implementation of the Purple# engine. It looks good and it works quite well. I know I know it is not DX UI but the programming is simple and you could have a UI up and running in no time. The site is www.bunnz.com . By the way I visited the blog of Tom Miller and I emailed him with our predicament lets hope for a reply.
Hans-olo
Hans-olo
I am working on the same project. Stripping the GUI out of the Microsoft.Sample.Framework so I can easily add it to my own code. I got to the same proble were you can display a button but it doen not react to the mouse over or on clicks. I added this code to my main form to make it work.


Protected Overloads Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Dim noFurtherProcessing As Boolean
noFurtherProcessing = hud.MessageProc(m.HWnd, m.Msg, m.WParam, m.LParam)

MyBase.WndProc(m)
End Sub

DrGUI
DrGUI
Probs better to abstract input really so you can say like GUI.MouseClick(x,y,buttons...). That would allow you to use DirectInput or some other control like a joystick if you so wished.

I'll need to pull out the GUI sometime, thanks for the useful thread guys.
remigius
remigius
Quote:
Probs better to abstract input really so you can say like GUI.MouseClick(x,y,buttons...). That would allow you to use DirectInput or some other control like a joystick if you so wished.


I'd say you're right that this kind of abstraction might be the way to go, but it depends on what you want to do with it. The OnMsgProc approach is very flexible and allows your GUI to respond to just about all user input (except the joystick though, AFAIK) by implementing a single method.

Anyway, check out c-unit's excellent tutorials, which include a small series on creating a complete GUI subsystem (tutorials 22-26, near the bottom of the page).
Rob Loach
Rob Loach
Axiom (now held at RealmForge) implemented a C# port of Crazy Eddie's GUI (CeGuiSharp). Last I heard, someone had made a Managed DirectX renderer for it, but didn't add it into the CVS. I'm not entirely sure whether or not the SourceForge version of it is the latest.
Rob Loach [Website] [Projects] [

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.