C++ Structures

The Microsoft® Direct3D® Retained Mode structures for C++ are:

D3DRMANIMATIONKEY

Defines the keys used by the IDirect3DRMAnimation2::AddKey, GetKeys, and ModifyKey methods.

Syntax

typedef struct _D3DRMANIMATIONKEY
{
    DWORD dwSize;
    DWORD dwKeyType;
    D3DVALUE dvTime;
    DWORD dwId ;
    union
    {
        D3DRMQUATERNION dqRotateKey;
        D3DVECTOR dvScaleKey;
        D3DVECTOR dvPositionKey;
    };
} D3DRMANIMATIONKEY;
typedef D3DRMANIMATIONKEY *LPD3DRMANIMATIONKEY;

Members

dwSize
Size of the animation.
dwKeyType
Type of key. One of the following values:
D3DRMANIMATION_ROTATEKEY = 0x01
D3DRMANIMATION_SCALEKEY = 0x02
D3DRMANIMATION_POSITIONKEY = 0x03
dvTime
Time value in arbitrary units and a member of the D3DVALUE type.
dwId
Key identifier.
dqRotateKey
Value of the D3DRMQUATERNION structure type defining the rotation.
dvScaleKey
Value of the D3DVECTOR structure type defining the scale.
dvPositionKey
Value of the D3DVECTOR structure type defining the position.

D3DRMBOX

Defines the bounding box retrieved by the IDirect3DRMMesh::GetBox and IDirect3DRMMeshBuilder3::GetBox methods.

Syntax

typedef struct _D3DRMBOX {
    D3DVECTOR min, max;
}D3DRMBOX;
typedef D3DRMBOX *LPD3DRMBOX;

Members

min and max
Values defining the bounds of the box. These values are D3DVECTOR structures.

See Also

D3DVECTOR, IDirect3DRMMesh::GetBox, IDirect3DRMMeshBuilder3::GetBox

D3DRMIMAGE

Describes an image that is attached to a texture by the IDirect3DRM3::CreateTexture method. IDirect3DRMTexture3::GetImage returns the address of this image.

Syntax

typedef struct _D3DRMIMAGE {
    int                width, height;
    int                aspectx, aspecty;
    int                depth;
    int                rgb;
    int                bytes_per_line;
    void              *buffer1;
    void              *buffer2;
    unsigned long      red_mask;
    unsigned long      green_mask;
    unsigned long      blue_mask;
    unsigned long      alpha_mask;
    int                palette_size;
    D3DRMPALETTEENTRY *palette;
}D3DRMIMAGE;
typedef D3DRMIMAGE, *LPD3DRMIMAGE;

Members

width and height
Width and height of the image, in pixels.
aspectx and aspecty
Aspect ratio for nonsquare pixels.
depth
Number of bits that specify each pixel.
rgb
A flag that indicates whether pixels are RGB values or palette indices. If this member is FALSE, pixels are indices into a palette. Otherwise, pixels encode RGB values.
bytes_per_line
Number of bytes of memory for a scan line. This value must be a multiple of four.
buffer1
Memory to render into (first buffer).
buffer2
Second rendering buffer for double buffering. Set this member to NULL for single buffering.
red_mask, green_mask, blue_mask, and alpha_mask
A mask for RGB pixels or pixel palette indices. If rgb is TRUE, these members are masks for the red, green, and blue parts of a pixel. Otherwise, they are masks for the significant bits of the red, green, and blue elements in the palette. For example, most Super VGA (SVGA) displays use 64 intensities of red, green, and blue, so the masks should all be set to 0xfc.
palette_size
Number of entries in the palette.
palette
A pointer to a D3DRMPALETTEENTRY structure describing the color palette to be used. This structure is only used if the D3DRMIMAGE rgb member is FALSE.

See Also

IDirect3DRM3::CreateTexture, IDirect3DRMTexture3::GetImage

D3DRMLOADMEMORY

Identifies a resource to be loaded when an application uses the IDirect3DRM3::Load method (or one of the other Load methods) and specifies D3DRMLOAD_FROMMEMORY.

Syntax

typedef struct _D3DRMLOADMEMORY {
    LPVOID lpMemory;
    DWORD  dSize;
} D3DRMLOADMEMORY, *LPD3DRMLOADMEMORY;

Members

lpMemory
Address of a block of memory to be loaded.
dSize
Size, in bytes, of the block of memory to be loaded.

See Also

IDirect3DRM3::Load, IDirect3DRMAnimationSet2::Load, IDirect3DRMFrame3::Load, IDirect3DRMMeshBuilder3::Load, D3DRMLOADOPTIONS, D3DRMLOADRESOURCE

D3DRMLOADRESOURCE

Identifies a resource to be loaded when an application uses the IDirect3DRM3::Load method (or one of the other Load methods) and specifies D3DRMLOAD_FROMRESOURCE.

Syntax

typedef struct _D3DRMLOADRESOURCE {
    HMODULE hModule;
    LPCTSTR lpName;
    LPCTSTR lpType;
} D3DRMLOADRESOURCE, *LPD3DRMLOADRESOURCE;

Members

hModule
Handle of the module containing the resource to be loaded. If this member is NULL, the resource must be attached to the executable file or dynamic-link library (DLL) that uses the resource.

lpName
Name of the resource to be loaded. For example, if the resource is a mesh, this member should specify the name of the mesh file.
lpType
User-defined type identifying the resource.

Remarks

If the high-order word of the lpName or lpType member is zero, the low-order word specifies the integer identifier of the name or type of the given resource. Otherwise, those parameters are long pointers to null-terminated strings. If the first character of the string is a number sign (#), the remaining characters represent a decimal number that specifies the integer identifier of the resource's name or type. For example, the string "#258" represents the integer identifier 258. An application should reduce the amount of memory required for the resources by referring to them by integer identifier instead of by name.

When an application uses a Load method and specifies D3DRMLOAD_FROMRESOURCE, it does not need to find or unlock any resources; the system handles this automatically.

See Also

IDirect3DRM3::Load, IDirect3DRMAnimationSet2::Load, IDirect3DRMFrame3::Load, IDirect3DRMMeshBuilder3::Load, D3DRMLOADMEMORY, D3DRMLOADOPTIONS

D3DRMMATERIALOVERRIDE

Describes the overrides for IDirect3DRMFrame3::SetMaterialOverride and IDirect3DRMFrame3::GetMaterialOverride methods.

Syntax

typedef struct _D3DRMMATERIALOVERRIDE
{
    DWORD         dwSize;     
    DWORD         dwFlags;    
    D3DCOLORVALUE dcDiffuse;  
    D3DCOLORVALUE dcAmbient;  
    D3DCOLORVALUE dcEmissive; 
    D3DCOLORVALUE dcSpecular; 
    D3DVALUE      dvPower;
    LPUNKNOWN     lpD3DRMTex;
} D3DRMMATERIALOVERRIDE, *LPD3DRMMATERIALOVERRIDE;

Members

dwSize
Size of this structure, in bytes.
dwFlags
Logical combination of flags, indicating which fields in this structure are valid. Possible values include the following:
D3DRMMATERIALOVERRIDE_DIFFUSE_ALPHAONLY
D3DRMMATERIALOVERRIDE_DIFFUSE_RGBONLY
D3DRMMATERIALOVERRIDE_DIFFUSE
D3DRMMATERIALOVERRIDE_AMBIENT
D3DRMMATERIALOVERRIDE_EMISSIVE
D3DRMMATERIALOVERRIDE_SPECULAR
D3DRMMATERIALOVERRIDE_POWER
D3DRMMATERIALOVERRIDE_TEXTURE
D3DRMMATERIALOVERRIDE_ALL
dcDiffuse
Diffuse RGBA color setting of type D3DCOLORVALUE.
dcAmbient
Ambient RGB color setting of type D3DCOLORVALUE.
dcEmissive
Emissive RGB color setting of type D3DCOLORVALUE.
dcSpecular
Specular RGB color setting of type D3DCOLORVALUE.
dvPower
Power setting of type D3DVALUE.
lpD3DRMTex
Pointer to the texture interface.

D3DRMPALETTEENTRY

Describes the color palette used in a D3DRMIMAGE structure. This structure is used only if the rgb member of the D3DRMIMAGE structure is FALSE. (If it is TRUE, RGB values are used.)

Syntax

typedef struct _D3DRMPALETTEENTRY {
    unsigned char red;
    unsigned char green;
    unsigned char blue;
    unsigned char flags;
}D3DRMPALETTEENTRY;
typedef D3DRMPALETTEENTRY, *LPD3DRMPALETTEENTRY;

Members

red, green, and blue
Values defining the primary color components that define the palette. These values can range from 0 through 255.
flags
Value defining how the palette is used by the renderer. This value is one of the members of the D3DRMPALETTEFLAGS enumerated type.

See Also

D3DRMIMAGE, D3DRMPALETTEFLAGS

D3DRMPICKDESC

Contains the pick position and face and group identifiers of the objects retrieved by the IDirect3DRMPickedArray::GetPick method.

Syntax

typedef struct _D3DRMPICKDESC {
    ULONG       ulFaceIdx;
    LONG        lGroupIdx;
    D3DVECTOR   vPosition;
} D3DRMPICKDESC, *LPD3DRMPICKDESC;

Members

ulFaceIdx
Face index of the retrieved object.
lGroupIdx
Group index of the retrieved object.
vPosition
Value describing the position of the retrieved object. This value is a D3DVECTOR structure.

See Also

D3DVECTOR, IDirect3DRMPickedArray::GetPick

D3DRMPICKDESC2

Contains the face and group identifiers, pick position, horizontal and vertical texture coordinates for the vertex, vertex normal, and color of the objects retrieved by the IDirect3DRMPicked2Array::GetPick method.

Syntax

typedef struct _D3DRMPICKDESC2
{
    ULONG	ulFaceIdx;
    LONG	lGroupIdx;
    D3DVECTOR	dvPosition;
    D3DVALUE	tu;
    D3DVALUE	tv;
    D3DVECTOR	dvNormal;
    D3DCOLOR	dcColor;

} D3DRMPICKDESC2, *LPD3DRMPICKDESC2;

Members

ulFaceIdx
Face index of the retrieved object.
lGroupIdx
Group index of the retrieved object.
vPosition
Value describing the position of the retrieved object. This value is a D3DVECTOR structure.
tu and tv
Horizontal and vertical texture coordinates, respectively, for the vertex.
dvNormal
Normal vector for the vertex.
dcColor
Vertex color.

D3DRMPMESHLOADSTATUS

Contains the loading status of a progressive mesh loaded with the IDirect3DRMProgressiveMesh::Load method. This structure can be retrieved with the IDirect3DRMProgressiveMesh::GetLoadStatus method.

Syntax

typedef struct _D3DRMPMESHLOADSTATUS {
    DWORD dwSize;		
    DWORD dwPMeshSize;	
    DWORD dwBaseMeshSize;	
    DWORD dwBytesLoaded;	
    DWORD dwVerticesLoaded;	
    DWORD dwFacesLoaded;	
    DWORD dwFlags;
} D3DRMPMESHLOADSTATUS;
typedef D3DRMPMESHLOADSTATUS *LPD3DRMPMESHLOADSTATUS;

Members

dwSize
Size of the structure.
dwPMeshSize
Size of the total progressive mesh in bytes.
dwBaseMeshSize
Size of the base mesh in bytes.
dwBytesLoaded
Number of total bytes loaded.
dwVerticesLoaded
Number of vertices loaded.
dwFacesLoaded
Number of faces loaded.
dwFlags
Flags that indicate the status of the progressive mesh loading. Can be one of the following values:

D3DRMPMESHSTATUS_VALID — The progressive mesh object contains valid data.
D3DRMPMESHSTATUS_INTERRUPTED — The download was interrupted either because the application used IDirect3DRMProgressiveMesh::Abort or because the connection was lost.
D3DRMPMESHSTATUS_BASEMESHCOMPLETE — The base mesh has been downloaded.
D3DRMPMESHSTATUS_COMPLETE — All data has been downloaded.
D3DRMPMESHSTATUS_RENDERABLE — It is now possible to render the mesh.

See Also

IDirect3DRMProgressiveMesh::GetLoadStatus, IDirect3DRMProgressiveMesh::Load

D3DRMQUATERNION

Describes the rotation used by the IDirect3DRMAnimation2::AddRotateKey method, and the quaternion used in IDirect3DRMFrame3::SetQuaternion. It is also used in several of the Direct3D mathematical functions.

Syntax

typedef struct _D3DRMQUATERNION {
    D3DVALUE   s;
    D3DVECTOR  v;
}D3DRMQUATERNION;
typedef D3DRMQUATERNION, *LPD3DRMQUATERNION;

See Also

IDirect3DRMAnimation2::AddRotateKey, IDirect3DRMFrame3::SetQuaternion, D3DRMQuaternionFromRotation, D3DRMQuaternionMultiply, D3DRMQuaternionSlerp, D3DRMMatrixFromQuaternion

D3DRMRAY

Defines the direction and starting position of the ray in IDirect3DRMFrame3::RayPick.

Syntax

typedef struct _D3DRMRAY
{   D3DVECTOR dvDir;
    D3DVECTOR dvPos;
} D3DRMRAY, *LPD3DRMRAY;

Members

dvDir
Direction of the ray used in a ray pick.
dvPos
Starting position of the ray used in a ray pick.

D3DRMVECTOR4D

Describes the screen coordinates used as the destination of a transformation by the IDirect3DRMViewport2::Transform and IDirect3DRMViewport2::TransformVectors methods and as the source of a transformation by the IDirect3DRMViewport2::InverseTransform and IDirect3DRMViewport2::InverseTransformVectors methods.

Syntax

typedef struct _D3DRMVECTOR4D {
    D3DVALUE x;
    D3DVALUE y;
    D3DVALUE z;
    D3DVALUE w;
}D3DRMVECTOR4D;
typedef D3DRMVECTOR4D, *LPD3DRMVECTOR4D;

Members

x, y, z, and w
Values of the D3DVALUE type describing homogeneous values. These values define the result of the transformation.

See Also

IDirect3DRMViewport2::Transform, IDirect3DRMViewport2::TransformVectors, IDirect3DRMViewport2::InverseTransform, IDirect3DRMViewport2::InverseTransformVectors

D3DRMVERTEX

Describes a vertex in a Direct3DRMMesh object.

Syntax

typedef struct _D3DRMVERTEX{
    D3DVECTOR position;
    D3DVECTOR normal;
    D3DVALUE  tu, tv;
    D3DCOLOR  color;
} D3DRMVERTEX;

Members

position
Position of the vertex.
normal
Normal vector for the vertex.
tu and tv
Horizontal and vertical texture coordinates, respectively, for the vertex.
color
Vertex color.

See Also

IDirect3DRMMesh::GetVertices, IDirect3DRMMesh::SetVertices


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