Platform SDK: DirectX

Step 2: Declare Module Level Variables

[C++]

This section pertains only to application development in Visual Basic. See DirectDraw C/C++ Tutorials.

[Visual Basic]

The first step of coding DirectX application written in Visual Basic is to create an instance of the DirectX7 class. This object contains the methods necessary to create the starting objects of all the DirectX components including DirectDraw, DirectSound, Direct3D Immediate Mode, Direct3D Retained Mode, DirectInput, DirectPlay, and DirectMusic. Information on Direct3D Retained Mode can be found in the Appendix node of this documentation.

The DirectX7 class is the top level class of the DxVBLib type library and an object of this class is created with the statement:

Dim objDX As New DirectX7

Additional module level variables declarations found in the Tutorial 1 blitting sample are for a DirectDraw object, DirectDrawSurface objects, DirectDrawClipper object, DirectDraw surface description types, and a Boolean variable used to hold initialization information.

Next: Step 3: Initialize Variables