Initializing DXUT

The first step to using DXUT is to initialize it. This can be done simply with the DXUTInit function:

HRESULT DXUTInit (
	BOOL bParseCommandLine     = TRUE,
	BOOL bHandleDefaultHotkeys = TRUE,
	BOOL bShowMsgBoxOnError    = TRUE
);

You will typically make this call to DXUTInit near the beginning of your application's WinMain function. If DXUTInit is not called by the application, it will be called automatically by the framework using the default parameters.

If the first parameter, bParseCommandLine, is TRUE, the framework will respond to command-line arguments. For example, run the BasicHLSL Sample executable with the following command-line arguments:

BasicHLSL.exe -windowed -width:600 -height:600

The framework will attempt to comply with these window settings. For a complete list of supported command-line arguments, see DXUTInit.

The second parameter, bHandleDefaultHotkeys, instructs the framework to respond to some predefined keystrokes, such as ALT+ENTER. Again, for a complete list see DXUTInit. If this parameter is FALSE, the application is free to respond to these keystrokes as desired.

The last parameter, bShowMsgBoxOnError, controls the display of message boxes when the framework detects an error. Set it to FALSE to run automated testing or professional applications that require complete control over the user experience.