• entries
375
1136
• views
298205

# Yes, I should probably be working

139 views

Basic structure of the harness is in place. After a couple of false starts - including an attempt to write the whole thing in C++/CLI - I've settled on a three-component structure:
• Render module DLL, written in C++ - consists of a class derived from RenderingModule, and a factory function to instantiate the class

• Marshalling DLL, written in C++/CLI - wraps the native RenderModule in a managed interface, dealing with all DLL handling and data marshalling

• UI app, written in C#. Provides the frontend.

Mishtair Hoxley was suggesting that I look into DirectShow for recording the AVIs - I think there's a DirectX.AudioVideoPlayback namespace under .NET that may contain what I want, but if not, I'll either find an alternative way to build the AVI or write another C++/CLI DLL to handle it all. Or maybe build the functionality into the existing one.

C++/CLI really is a horrible language. The fact that you can mix managed and unmanaged code freely is convenient, but that seems to be pretty much its only redeeming quality. I'll be quite happy to keep the marshalling DLL as thin as possible and write all the serious GUI stuff in C#.

One interesting side-effect of the way I've written the RenderModule interface is that there's actually nothing D3D10-specific in the harness itself - the module is just expected to return a pointer to an array of RGB values. The RenderModule can generate those values however it wants - D3D10, D3D9, software rasterizer, random number generator. As such I'll probably test it all using a D3D9 module, allowing me to stick to what I already know, and allowing me to do all dev and testing under XP.

C++/CLI is an abomination, but it is definitely an improvement over the "Managed Extensions for C++" of .NET 1.0/1.1. You should see some of the IL that thing used to spit out.

Sounds like you're making good progress. Does your code also force a fixed frame-rate so you can fake a 20-30hz movie out of the reference rasterizer?

If you can plug it into more generalised forms of output it could be a neat all-round harness for recording videos. I doubt it'd be straight-forward, but I wonder if you could hook it upto the DXUT framework and capture the SDK samples [oh]

Jack

The render modules are stateless, so 'framerate' isn't really an issue - I'm not passing delta times, I'm passing absolute times. So a fixed framerate is just a question of:
GetFrameAtTime(0.0f);
GetFrameAtTime(0.1f);
GetFrameAtTime(0.2f);
GetFrameAtTime(0.3f);
/* ... etc ... */


and presto, I've got 10FPS. When doing the AVI recording I expect there will be some kind of header value that I can use to specify the playback framerate.

Sounds good to me!

## Create an account

Register a new account