Framework.Initialize Method

Language:

Initializes the sample framework.

Definition

Visual Basic Public Sub Initialize( _
    ByVal isParsingCommandLine As Boolean, _
    ByVal handleDefaultKeys As Boolean, _
    ByVal showMessageBoxOnError As Boolean _
)
C# public void Initialize(
    bool isParsingCommandLine,
    bool handleDefaultKeys,
    bool showMessageBoxOnError
);
C++ public:
void Initialize(
    bool isParsingCommandLine,
    bool handleDefaultKeys,
    bool showMessageBoxOnError
);
JScript public function Initialize(
    isParsingCommandLine : boolean,
    handleDefaultKeys : boolean,
    showMessageBoxOnError : boolean
);

Parameters

isParsingCommandLine System.Boolean
Set to true if the sample framework checks for command-line arguments; otherwise, false.
handleDefaultKeys System.Boolean
Set to true if the sample framework automatically responds to certain keyboard input; otherwise, false.
showMessageBoxOnError System.Boolean
Set to true if the sample framework displays a message box if there is an error condition; otherwise, false.

Remarks

Command-line arguments take precedence over options set by the application when a Microsoft Direct3D device is first created, but they are ignored afterward to allow the user to interactively change the settings.

The following table contains descriptions of possible command-line arguments when executing a sample framework application.
Command-line ArgumentDescription
-adapter:#Forces the application to use this adapter ordinal. Fails if the adapter ordinal does not exist.
-fullscreenStarts in full-screen mode.
-windowedStarts in windowed mode.
-startx:#For windowed mode, sets the x-coordinate of the window position to the value of #.
-starty:#For windowed mode, sets the y-coordinate of the window position to the value of #.
-height:#Sets the window height to the value of #. For full-screen mode, the sample framework picks the closest possible supported mode.
-width:#Sets the window width to the value of #. For full-screen mode, the sample framework picks the closest possible supported mode.
-forcehalForces the application to use a hardware abstraction layer (HAL) device type. Fails if a HAL device does not exist.
-forcehwvpForces the application to use hardware vertex processing. Fails if the device does not support this mode.
-forcepurehwvpForces the application to use pure hardware vertex processing. Fails if the device does not support this mode.
-forcerefForces the application to use a reference device type. Fails if a reference device does not exist.
-forceswvpForces the application to use software vertex processing.
-constantframetimeUses a constant frame time.
-noerrormsgboxesPrevents the display of message boxes generated by the framework, allowing the application to be run without user interaction.
-quitafterframe:#Forces the application to quit after frame #.

The following table lists the keyboard input that is handled by default when the handleDefaultKeys property is set to true.
Keyboard InputDescription
ALT+ENTERToggles between full-screen and windowed modes.
ESCExits the application.
F2Prompts the user to select a new rendering device or display mode.
F3Toggles between HAL and reference devices.
F8Toggles between wireframe and rendered views.
PAUSEPauses the application.


Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center