Time to decide on a UI Framework (SharpDX)

Started by
5 comments, last by cephalo 9 years ago

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?

Advertisement

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.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

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?

What I mean is something like this

Screen contains a list of items and items contain a list of behaviours that define what an item would do, so its more of a composition of several behaviours that build an on screen element.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

So, that would be for an UI what ECS is for game objects, do I get that right?

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.

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.

This topic is closed to new replies.

Advertisement