Features? Whidbey? Oh My!!

Well, as I’m sure most of you are already aware, the Whidbey beta has been out for a while now, and hopefully some of you have gotten a chance to play with it.  Assuming you have, what features are you seeing that you absolutely love?  What features do you now find ‘missing’ when looking at the Managed DirectX libraries?

In short, now would be the perfect time to suggest features on things you might like to see in a “Whidbey” specific version of Managed DirectX.

( And yes, I’m aware of the loader lock problem using the current MDX assemblies with Whidbey.. So ignore that one.. 😀 )

Edit: Comments seem to be broken.. I’m trying to fix it.. Let me know if it works..

My last post on render loops (hopefully)..

The most common topic on my blog returns again.  This time it will be brief as all I’m going to to do now is show you the render loop the June’05 SDK will be using.  A coworker in another group came up with this markedly simple, yet deceptively effective loop for that groups projects.  I liked it so much, i’m sharing it with everyone else. =)

The basic loop (slightly modified from his original version and the version in the new SDK for ease of reading):

public void MainLoop()
{
// Hook the application’s idle event
System.Windows.Forms.Application.Idle += new EventHandler(OnApplicationIdle);
System.Windows.Forms.Application.Run(myForm);
}

private void OnApplicationIdle(object sender, EventArgs e)
{
while (AppStillIdle)
{
// Render a frame during idle time (no messages are waiting)
UpdateEnvironment();
Render3DEnvironment();
}
}

private bool AppStillIdle
{
get
{
NativeMethods.Message msg;
return !NativeMethods.PeekMessage(out msg, IntPtr.Zero, 0, 0, 0);
}
}
And the declarations for those two native methods members:

[StructLayout(LayoutKind.Sequential)]
public struct Message
{
public IntPtr hWnd;
public WindowMessage msg;
public IntPtr wParam;
public IntPtr lParam;
public uint time;
public System.Drawing.Point p;
}

[System.Security.SuppressUnmanagedCodeSecurity] // We won’t use this maliciously
[DllImport(“User32.dll”, CharSet=CharSet.Auto)]
public static extern bool PeekMessage(out Message msg, IntPtr hWnd, uint messageFilterMin, uint messageFilterMax, uint flags);
——

Simple, elegant, effective.  No extra allocations, no extra collections, it just works..  The Idle event fires when there’s no messages in the queue, and then the handler keeps looping continuously until a message does appear, in which case it stops..  Once all the messages are handled, the idle event is fired again, and the process starts over.

Win a prize ($50,000) for writing Managed DX apps..

Since I’m feeling quite lazy, I’m just going to copy the basic post from the Zbuffer site..

So you think you are a good Managed DirectX programmer eh ? Well if you have some SQL skills (or a friend who does) then you could be ready to enter the Connected Systems Developer Competition. There are 15 categories to enter and number 10 is:

  • Best use of Managed DirectX, Visual Studio 2005 and SQL Server Express

I know it seems strange to put DirectX and SQL server together, but the competition *is* all about connected systems. Closing date is September 15th 2005 so you have plenty of time. Lots of other prizes too – check out the official rules

VB.NET and MDX chat scheduled for next week..

Taken from the Chat Announcements blog:

DirectX 9.0 Direct3D Graphics with Visual Basic .NET
Tuesday, April 26, 2005 from 1:00 – 2:00 P.M. Pacific Time (Additional Time Zones)
Hosts: Tom Miller and Adam Gallant. More to come…

Do you have questions about how to best use Visual Basic .NET to program DirectX 9.0 graphics? Are you unsure when to use a particular Direct3D feature? Join members of the Visual Basic and Windows Graphics & Gaming Technologies teams and discuss how to leverage the power of DirectX 9.0 from Visual Basic .NET.

You can view this announcement on Microsoft’s main chat page, or add a reminder to your Outlook Calendar.

April 2005 SDK Released..

Managed specific changes:

  • All of the D3DX updates mentioned below are implemented in MDX
  • Better support in the control panel for MDX including switching retail/debug on a per-dll basis
  • MDX installed by default by redist setup (no more /InstallManagedDX flag which was removed)
  • The Sample Utility Toolkit Framework no longer creates ‘native win32’ windows, and instead uses WinForms again with the ‘infamous’ DoEvents renderloop (look for that to be addressed soon)

And here’s the release notes and downloads, etc:

 

The DirectX 9.0 SDK enables developers to build outstanding games and graphics applications by taking full advantage of DirectX technologies built into Microsoft Windows. Updated every two months, the DirectX SDK provides additional C/C++ and Managed libraries, samples, tools and documentation over and above the Microsoft Platform SDK.

For more information about developing Games for Windows titles or with DirectX in general, see the Microsoft DirectX Developer Center or e-mail directx@microsoft.com.

What’s New in the April 2005 Update

This release includes changes to D3DX library, graphics samples, tools, and documentation updates. Updated developer runtimes and the DirectX Redistributable (DirectX 9.0c) are also included. The following features have changed for this release; for a complete list of updates, please refer to the “What’s New in DirectX 9.0 SDK Update (April 2005)” page in the SDK documentation.

D3DX Updates

  • UVAtlas API – These new API’s automatically generate a unique UV texture mapping for an arbitrary mesh, maximizing texture space usage and minimizing texture undersampling (stretch).
  • Reduced effects memory footprint – A new flag (D3DXFX_NOT_CLONEABLE) has been added to allow users to specify that an effect will never need to be cloned by the effect system. Using this flag can notably reduce the memory footprint for an effect.
  • The precomputed radiance transfer (PRT) system has been enhanced with fast raytracing methods have been added for direct computation of ray/mesh intersections against a simulation scene.

Documentation Updates

  • Setup documentation – The DXSetup documentation has been updated to explain the redist naming scheme and how you can customize the redist to reduce your installation size.

DXUT Updates

  • Callback functions now pass a void* pUserContext that allows the callback functions to receive context from the application.
  • The framework’s GUI is now separate and optional from the core framework.
  • The framework now allows applications to reject device changes via LPDXUTCALLBACKMODIFYDEVICESETTINGS which returns a bool.
  • Passing 0 as the width and height to DXUTCreateDevice now creates a backbuffer of the same size as the client window.
  • DXUTGetExitCode now returns 11 if the last device was a D3DDEVTYPE_REF device type.

Technical Article Updates

  • The DirectX developer Frequenty Asked Questions (FAQs) page has been added to the documentation.
  • A new technical article about the Windows XP Media Center Edition 2005 has been added.

PIX Tool Updates

  • You can now open full-stream capture PIXRun files, and render frames from them within PIX, the same way you can with single-frame capture PIXRun files.
  • You can save rendered frames to an image file from within PIX.
  • You can adjust the scaling of the Y-axis of the event timeline to see data graphed more clearly.

DirectX Component Status

  • Microsoft DirectPlay is deprecated, and Microsoft strongly recommends against using it to develop new applications. Game developers should instead use enhanced core Microsoft Windows networking technologies.
  • Microsoft DirectInput, Microsoft DirectMusic, Microsoft DirectShow, and Microsoft DirectSound will maintain their current status until new technology in these areas is made available.
  • Use of Microsoft DirectDraw is no longer recommended. With the release of DirectX 9.0, all two-dimensional (2-D) functionality is contained within Microsoft Direct3D and its associated helper functions in D3DX. However, the DirectDraw documentation is still available and can be viewed at the MSDN Library Archive at DirectDraw.

 

 


April 2005 Update Downloads

 

Please see the DirectX 9.0 SDK Readme for late-breaking information about this release.

 

DirectX 9.0 SDK Update – (April 2005)
The SDK April 2005 Update download contains the tools needed to build cutting-edge, media-rich, interactive applications. It includes run-times, headers and libraries, samples, documentation, utilities, and support for C++, and Managed Code development. 

This download also contains debug versions of the Microsoft DirectSound DLLs. (March 30, 2005)

 

DirectX 9.0 SDK Update – (April 2005) Symbol Files
The Symbol Files download contains all of the symbol files for the DirectX 9.0c release for Windows 98, Windows Me, Windows 2000, and Windows XP. The Windows XP Service Pack 2 symbol files are located in the Platform SDK. (March 30, 2005)

 

DirectX 9.0c Redistributable for Software Developers – Multilingual with Updated DirectX for Managed Code – (April 2005)
This download contains the end-user redistributable that developers may include with their product. The redistributable license agreement covers the terms under which developers may use the Redistributable. This update includes the DirectX 9.0c runtime (unchanged), an updated DirectX for Managed Code and D3DX for April 2005. (March 30, 2005)

 

DirectX 9.0c EULA
This download contains the localized runtime End-User License Agreements. (February 9, 2005)

The Renderloop.. Re-re-re-revisited.

My coworker Rick has taken the time to write out his thoughts on the infamous render loop.  Naturally, he needed to do this for his upcoming book, but it’s something we here have been talking about for a long time and I simply haven’t had the time to look at very indepth..

He’s bounced some ideas off of me periodically for the last few weeks, and I think the solution he came up with looks pretty solid.. I haven’t played with it much (ok, not at all), but will do so soon..