The Microsoft® Direct3D® Retained Mode functions are:
Retrieves the alpha component of a color.
D3DVALUE D3DRMColorGetAlpha(
D3DCOLOR d3drmc
);
Returns the alpha value if successful, or zero otherwise.
D3DRMColorGetBlue, D3DRMColorGetGreen, D3DRMColorGetRed
Retrieves the blue component of a color.
D3DVALUE D3DRMColorGetBlue(
D3DCOLOR d3drmc
);
Returns the blue value if successful, or zero otherwise.
D3DRMColorGetAlpha, D3DRMColorGetGreen, D3DRMColorGetRed
Retrieves the green component of a color.
D3DVALUE D3DRMColorGetGreen(
D3DCOLOR d3drmc
);
Returns the green value if successful, or zero otherwise.
D3DRMColorGetAlpha, D3DRMColorGetBlue, D3DRMColorGetRed
Retrieves the red component of a color.
D3DVALUE D3DRMColorGetRed(
D3DCOLOR d3drmc
);
Returns the red value if successful, or zero otherwise.
D3DRMColorGetAlpha, D3DRMColorGetBlue, D3DRMColorGetGreen
Creates an instance of a Direct3DRM object.
HRESULT Direct3DRMCreate(
LPDIRECT3DRM FAR * lplpD3DRM
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Creates an RGB color from supplied red, green, and blue components.
D3DCOLOR D3DRMCreateColorRGB(
D3DVALUE red,
D3DVALUE green,
D3DVALUE blue
);
Returns the new RGB value if successful, or zero otherwise.
Creates an RGBA color from supplied red, green, blue, and alpha components.
D3DCOLOR D3DRMCreateColorRGBA(
D3DVALUE red,
D3DVALUE green,
D3DVALUE blue,
D3DVALUE alpha
);
Returns the new RGBA value if successful, or zero otherwise.
Frees memory. This function is application-defined.
typedef VOID (*D3DRMFREEFUNCTION)(LPVOID lpArg); typedef D3DRMFREEFUNCTION *LPD3DRMFREEFUNCTION;
No return value.
Applications might define their own memory-freeing function if the standard C run-time routines do not meet their requirements.
Allocates memory. This function is application-defined.
typedef LPVOID (*D3DRMMALLOCFUNCTION)(DWORD dwSize); typedef D3DRMMALLOCFUNCTION *LPD3DRMMALLOCFUNCTION;
Returns the address of the allocated memory if successful, or zero otherwise.
Applications might define their own memory-allocation function if the standard C run-time routines do not meet their requirements.
Calculates the matrix for the rotation that a unit quaternion represents.
void D3DRMMatrixFromQuaternion (
D3DRMMATRIX4D mat,
LPD3DRMQUATERNION lpquat
);
No return value.
Retrieves a unit quaternion that represents a rotation of a specified number of radians around the given axis.
LPD3DRMQUATERNION D3DRMQuaternionFromRotation(
LPD3DRMQUATERNION lpquat,
LPD3DVECTOR lpv,
D3DVALUE theta
);
Returns the address of the unit quaternion that was passed as the first parameter if successful, or zero otherwise.
Calculates the product of two quaternion structures.
LPD3DRMQUATERNION D3DRMQuaternionMultiply(
LPD3DRMQUATERNION lpq,
LPD3DRMQUATERNION lpa,
LPD3DRMQUATERNION lpb
);
Returns the address of the quaternion that was passed as the first parameter if successful, or zero otherwise.
Interpolates between two quaternion structures, using spherical linear interpolation.
LPD3DRMQUATERNION D3DRMQuaternionSlerp(
LPD3DRMQUATERNION lpq,
LPD3DRMQUATERNION lpa,
LPD3DRMQUATERNION lpb,
D3DVALUE alpha
);
Returns the address of the quaternion that was passed as the first parameter if successful, or zero otherwise.
Reallocates memory. This function is application-defined.
typedef LPVOID (*D3DRMREALLOCFUNCTION)(LPVOID lpArg,
DWORD dwSize);
typedef D3DRMREALLOCFUNCTION *LPD3DRMREALLOCFUNCTION;
Returns an address of the reallocated memory if successful, or zero otherwise.
Applications may define their own memory-reallocation function if the standard C run-time routines do not meet their requirements.
Adds two vectors.
LPD3DVECTOR D3DRMVectorAdd(
LPD3DVECTOR lpd,
LPD3DVECTOR lps1,
LPD3DVECTOR lps2
);
Returns the address of the vector that was passed as the first parameter if successful, or zero otherwise.
Calculates the cross product of the two vector arguments.
LPD3DVECTOR D3DRMVectorCrossProduct(
LPD3DVECTOR lpd,
LPD3DVECTOR lps1,
LPD3DVECTOR lps2
);
Returns the address of the vector that was passed as the first parameter if successful, or zero otherwise.
Returns the vector dot product.
D3DVALUE D3DRMVectorDotProduct(
LPD3DVECTOR lps1,
LPD3DVECTOR lps2
);
Returns the result of the dot product if successful, or zero otherwise.
Returns the length of a vector according to the following formula:
D3DVALUE D3DRMVectorModulus(
LPD3DVECTOR lpv
);
Returns the length of the D3DVECTOR structure if successful, or zero otherwise.
Scales a vector so that its modulus is 1.
LPD3DVECTOR D3DRMVectorNormalize(
LPD3DVECTOR lpv
);
Returns the address of the vector that was passed as the first parameter if successful, or zero if an error occurs. An example of an error is if a zero vector were passed.
Returns a random unit vector.
LPD3DVECTOR D3DRMVectorRandom(
LPD3DVECTOR lpd
);
Returns the address of the vector that was passed as the first parameter if successful, or zero otherwise.
Reflects a ray about a given normal.
LPD3DVECTOR D3DRMVectorReflect(
LPD3DVECTOR lpd,
LPD3DVECTOR lpRay,
LPD3DVECTOR lpNorm
);
Returns the address of the vector that was passed as the first parameter if successful, or zero otherwise.
Rotates a vector around a given axis. Returns a normalized vector if successful.
LPD3DVECTOR D3DRMVectorRotate(
LPD3DVECTOR lpr,
LPD3DVECTOR lpv,
LPD3DVECTOR lpaxis,
D3DVALUE theta
);
Returns the address of the vector that was passed as the first parameter if successful, or zero otherwise. This vector is normalized.
Scales a vector uniformly in all three axes.
LPD3DVECTOR D3DRMVectorScale(
LPD3DVECTOR lpd,
LPD3DVECTOR lps,
D3DVALUE factor
);
Returns the address of the vector that was passed as the first parameter if successful, or zero otherwise.
Subtracts two vectors.
LPD3DVECTOR D3DRMVectorSubtract(
LPD3DVECTOR lpd,
LPD3DVECTOR lps1,
LPD3DVECTOR lps2
);
Returns the address of the vector that was passed as the first parameter if successful, or zero otherwise.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.