Archive for February, 2010

Using Expression Blend to spiffy up the interface

Saturday, February 27th, 2010

So I was referred to Microsofts Expression Blend 3 by my friend who works with silverlight. Expression Blend is a nice editor like tool used to design fancy shmancy gui’s in WPF and Silverlight.

The learning curve for it is slightly high (for the non designer, developer type like myself that at the moment is still new to WPF), but given a couple weeks and with my backend in need of a more robust frontend, i think the time invested will have a nice payoff. The problem is i need to take some time to learn the thing. anyways, here is a picture of the interface.

Expression Blend Interface

Expression Blend Interface

Excited for Nvidia’s Parallel Nsight

Thursday, February 18th, 2010

I just watched the following video and I have to say this is what i have been waiting for! I hope the OpenGL support is as good as the D3D support.

OpenGL Engine in a WPF hosted Window.

Monday, February 8th, 2010

Wpf OpenGL

I have been working on my editor as of late in hopes of being able to use it to make my simple demo I have been talking about. I found a lot of doubt on the internet about the ability to interop OpenGL with the WPF rendering stack.

Well, we got it to work and it is very similar to the setup I had used to get it working in WinForms. Here is how we did it. First of all, you need a 3D Engine with the ability to take an HWND and use that for rendering. A complete tutorial on how to do this can be found in a gamedev article here.

Once you get this far, its only a matter of creating some xaml.

        <Window x:Class="GravEdit.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="GravEdit" Height="800" Width="800">
    <WindowsFormsHost x:Name="OpenGlPanel"/>        
    </Window>

And your C# for this xaml would look something like:

public partial class MainWindow : Window
        {
            private GravWrap gravWrap = new GravWrap(); //an instance of the engine
            ILua LuaPortal;
 
        public MainWindow()
            {
                InitializeComponent();
                System.Windows.Forms.Panel panel = new System.Windows.Forms.Panel();
                this.OpenGlPanel.Child = panel; //add the winform panel as a child to the winformhost
                IntPtr LuaState = this.gravWrap.Initialize(panel.Handle.ToInt32()); //pass the panels hwnd.

We created a Panel within the WinformsHost and that was it.

Cheers!