Sign in to follow this  
cephalo

Time to decide on a UI Framework (SharpDX)

Recommended Posts

Ok, after a couple of years I've finished with my graphics engine! It has everything I need to make a game prototype now. The only thing left is to decide how I want to present various game data. The games I like to play (and also presumably make) are fairly complex strategy games, so I will need to present possible sortable lists, tables and dialogs etc. over the top of and along side of my main graphics screen.

 

I think I've already made a decision, but I wanted some other opinions on the subject because for me this is uncharted territory.

 

All of my UI experience to date comes from WIndows Forms. That is what I am comfortable with even though it performs miserably for something like games. However, XAML seems to have some promise even though I have no experience with it. Microsoft seems to be pushing that with the new WinRT stuff, but I'm not ready to force a Windows 8+ platform. I am still using Windows 7 and will probably end up skipping 8 altogether. That leaves me with mixing SharpDX with WPF I think if I want to get familiar with XAML. My research is heading that direction.

 

What do you think? Is that just a big waste of time or is it feasible?

Share this post


Link to post
Share on other sites

Xaml is no good for games the only good thing about xaml is its data bindings. As soon as you go down the path of fixed objects for your UI eg.: text boxt, button, etc. you have locked yourself into implementing every object.

 

An aspect or component based approach is a lot easier to deal with, where an item has behaviours attached to it. The benefit of this is that rendering is completely seperate from the objects themselves, anything can become a button as soon as you give it the selecatable behaviour.

Share this post


Link to post
Share on other sites

When you say 'aspect or component based approach' rather than fixed objects. What do you mean by that?

 

Let's say I'm making a conquer the world game and I want to show the user a sortable list of cities they control with some relevant info for the status of each city, kind of like a spreadsheet. How would I do that? 

Share this post


Link to post
Share on other sites

So I messed around with XAML last night, and it took me about ten minutes to throw together all the things I would need for a functional game UI. I friggen love it! Now I just need to put my dx rendertarget in there without killing my framerate too bad. I'm currently rendering to a SharpDX RenderForm, so hopefully WPF won't be a big step backwards from Windows Forms. I found this library https://sharpdxwpf.codeplex.com/ that will hopefully help out in that regard. I guess that it shares the dx11 render target with a dx9 one that WPF can use.

 

We'll see how it goes.

 

EDIT: Not going well. I tried to update SharpDX.WPF and it's samples to the latest SharpDX version and I broke it! It worked initially, but when I updated the nuget package the sample app no longer draws anything. The render target clears to the right color, but no geometry is drawn. Dang. I was hoping I wouldn't have to understand the whole library but I guess I will.

Edited by cephalo

Share this post


Link to post
Share on other sites

Ok, I finally got my scene to render with WPF using the SharpDX.WPF library, and the results are not usable. It might work if your 3D scene is very simple, but you aren't using a swap chain, and the result when your framerate is too slow is that you get a random splattering of screens is various stages of completion.

 

It looks like mixing DirectX with XAML is a Windows 8+ only thing.

 

I don't know what to do.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this