Further Reading for Visual Basic Programmers

This section contains information about the following topics related to the Microsoft® Direct3D® Retained Mode Reference for Microsoft Visual Basic®.

Color keying
A color key is typically a single uncommon color that the artist does not use for anything but transparency, but it can also be a specified range of colors. Using the DirectDrawSurface4.SetColorKey method, you can set the color key for a surface. After the color key is set, subsequent calls to DirectDrawSurface3.BltFast take advantage of that color key, ignoring the pixels that match it. This type of color key is known as a source color key. Because the source color key prevents "transparent" pixels from being written to the destination, the original background pixels are preserved in these places, making it look like a sprite is a nonrectangular object passing over the background. You can also use a color key that effects the destination surface (a destination color key).

A destination color key is a color on a surface that is used for pixels that a sprite can overwrite. Again, the artist chooses an arbitrary color that is not used elsewhere in the image, reserving it as a portion of the image where you are able to blit. When you blit a sprite to the destination surface with a destination color key specified, the sprite's pixels will only be blitted to pixels on the destination that are using the destination color key. Because the normal destination pixels are preserved, it looks like the sprite passes behind the image on the destination surface. For more information, see Transparent Blitting and Color Keys in the "Surfaces" topic in the "DirectDraw Essentials" section of the DirectX Foundation SDK.

CONST_D3DCOLORMODEL
Enumerated type that describes the color model implemented by the device.

Syntax

Enum CONST_D3DCOLORMODEL 
  D3DCOLOR_MONO = 1
  D3DCOLOR_RGB  = 2
End Enum
D3DCOLOR_MONO
A value from the CONST_D3DCOLORMODEL enumerated type that tells the system to use a monochromatic model (or ramp model). In this model, the blue component of a vertex color is used to define the brightness of a lit vertex.
D3DCOLOR_RGB
A value from the CONST_D3DCOLORMODEL enumerated type that tells the system to use a full RGB model.
D3DCOLORVALUE
A type that describes color values. The r, g, b, and a values specify the red, green, blue, and alpha components of a color. These values generally range from 0.0 to 1.0, with 0.0 specifying black.

Syntax

Type D3DCOLORVALUE
  r As Single
  g As Single
  b As Single
  a As Single
End Type
D3DMATRIX
A type that describes a matrix.

Syntax

Type D3DMATRIX
  rc11 As Single, rc12 As Single, rc13 As Single, rc14 As Single
  rc21 As Single, rc22 As Single, rc23 As Single, rc24 As Single
  rc31 As Single, rc32 As Single, rc33 As Single, rc34 As Single
  rc41 As Single, rc42 As Single, rc43 As Single, rc44 As Single
End Type
D3DPRIMCAPS
A type that defines the capabilities for each primitive type. See the the DirectX Foundation SDK for more information.
D3DRECT
A type that is a rectangle definition.

Syntax

Type D3DRECT
  x1 As Long
  x2 As Long
  y1 As Long
  y2 As Long
End Type
D3DTRIANGLE
The type that describes the base type for all triangles. The triangle is the main rendering primitive.
D3DVECTOR
The type that defines a vector for many Microsoft® Direct3D® and Direct3D Retained Mode methods and types.

Syntax

Type D3DVECTOR
  x As Single
  y As Single
  z As Single
End Type
DirectDrawCreate
A function that creates an instance of a DirectDraw object.
DirectDrawCreateClipper
A function that creates an instance of a DirectDrawClipper object not associated with a DirectDraw object.
Direct3D3
Applications use the methods of the Direct3D3 interface to create Direct3D objects and to set up the environment.
Direct3D3.GetDevicesEnum
This method retrieves all enumerated Direct3D device drivers installed on the system.
DirectDrawClipper
Applications use the methods of the DirectDrawClipper interface to manage clip lists.
DirectDrawClipper.SetHWnd
This method sets the window handle that will obtain the clipping information.
Interpolators
Interpolators provide a way to store actions and apply them to objects with automatic calculation of in-between values. For example, you can set a scene's background color to red at time zero and green at time 10, and the interpolator will automatically tint successive scenes to blend from red to green. With an interpolator, you can blend colors, move objects smoothly between positions, morph meshes, and perform many other transformations.

In the Direct3D Retained Mode implementation, interpolators are a generalization of the Direct3DRMAnimation2 interface that increases the kinds of object parameters you can animate. While the Direct3DRMAnimation2 interface allows animation of an object's position, size and orientation, the interpolator interfaces further enable animation of colors, meshes, textures, and materials.

Interpolator keys
The actions stored by the interpolator are called keys. A key is a stored procedure call and has an index associated with it. The interpolator automatically calculates between the key values. Keys are stored in the interpolator by calling one of the supported interface methods that can be interpolated. The method and the parameter values passed to it make up the key. Every key stored inside an interpolator has an index value. When the key is recorded, it is stamped with the current interpolator index value. The key's index value never changes once this value is set.
Interpolator Types
Objects can be attached to interpolators of an associated type; for example, a Direct3DRMMesh object can be attached to a Direct3DRMMeshInterpolator object. The interpolator types are:

Other interpolators can also be attached to an interpolator. When you change the index of an interpolator, it sets the indices of any attached interpolators to the same value.

Note that for Direct3DRMMeshInterpolator, you add a SetVertices key to a Direct3DRMMeshInterpolator object by calling SetVertices on the Direct3DRMMeshInterpolator object's Direct3DRMMesh interface. The group index used with SetVertices must correspond to a valid group index in the Direct3DRMMesh object or objects that the interpolator is applied to.

Interpolator index values
The interpolator covers a span of index values. This index span is dictated by the following rules:
  • The start of the span is the minimum of all key index values and the current index.
  • The end of the span is the maximum of all key index values and the current index.

For information on interpolation options, see the CONST_D3DRMINTERPOLATIONFLAGS enumerated type.

Mipmaps
A mipmap is a sequence of textures, each of which is a progressively lower resolution, prefiltered representation of the same image. Each prefiltered image, or level, in the mipmap is a power of two smaller than the previous level. A high-resolution level is used for objects that are close to the viewer. Lower-resolution levels are used as the object moves farther away. Mipmapping is a computationally low-cost way of improving the quality of rendered textures. For more information, see Mipmaps in the "Textures" topic in the "Direct3D Immediate-Mode Essentials" section of the DirectX Foundation SDK.
Texture map formats
A wide range of texture pixel formats are supported by the Microsoft DirectX® hardware-emulation layer. The table in Texture Map Formats in the "Pixel Format Masks" topic in the DirectX Foundation DirectDraw Reference shows these formats.

Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.