Applications use the methods of the IDirect3DRMDevice interface to interact with the output device. This section is a reference to the methods of this interface. For a conceptual overview, see IDirect3DRMDevice, IDirect3DRMDevice2, and IDirect3DRMDeviceArray Interfaces.
The methods of the IDirect3DRMDevice interface can be organized into the following groups:
| Buffer counts | GetBufferCount |
| SetBufferCount | |
| Color models | GetColorModel |
| Dithering | GetDither |
| SetDither | |
| Initialization | Init |
| InitFromClipper | |
| InitFromD3D | |
| Miscellaneous | GetDirect3DDevice |
| GetHeight | |
| GetTrianglesDrawn | |
| GetViewports | |
| GetWidth | |
| GetWireframeOptions | |
| Update | |
| Notifications | AddUpdateCallback |
| DeleteUpdateCallback | |
| Rendering quality | GetQuality |
| SetQuality | |
| Shading | GetShades |
| SetShades | |
| Texture quality | GetTextureQuality |
| SetTextureQuality | |
The IDirect3DRMDevice interface, like all Component Object Model (COM) interfaces, inherits the IUnknown interface methods. The IUnknown interface supports the following three methods:
| AddRef |
| QueryInterface |
| Release |
In addition, the IDirect3DRMDevice interface inherits the following methods from the IDirect3DRMObject interface:
| AddDestroyCallback |
| Clone |
| DeleteDestroyCallback |
| GetAppData |
| GetClassName |
| GetName |
| SetAppData |
| SetName |
The Direct3DRMDevice object is obtained by using the IDirect3DRM::CreateDevice method.
Adds a callback function that alerts the application when a change occurs to the device. The system uses this callback function whenever the application uses the IDirect3DRMDevice::Update method.
HRESULT AddUpdateCallback(
D3DRMUPDATECALLBACK d3drmUpdateProc,
LPVOID arg
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMDevice::DeleteUpdateCallback, IDirect3DRMDevice::Update, D3DRMUPDATECALLBACK
Removes an update callback function that was added by using the IDirect3DRMDevice::AddUpdateCallback method.
HRESULT DeleteUpdateCallback(
D3DRMUPDATECALLBACK d3drmUpdateProc,
LPVOID arg
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMDevice::AddUpdateCallback, IDirect3DRMDevice::Update, D3DRMUPDATECALLBACK
Retrieves the value set in a call to the IDirect3DRMDevice::SetBufferCount method.
DWORD GetBufferCount( );
Returns the number of buffersone for single-buffering, two for double-buffering, and so on.
Retrieves the color model of a device.
D3DCOLORMODEL GetColorModel( );
Returns a value from the D3DCOLORMODEL enumerated type that describes the Direct3D color model (RGB or monochrome).
Retrieves a pointer to an Immediate Mode device.
HRESULT GetDirect3DDevice(
LPDIRECT3DDEVICE * lplpD3DDevice
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the dither flag for the device.
BOOL GetDither( );
Returns TRUE if the dither flag is set, or FALSE otherwise.
Retrieves the height, in pixels, of a device. This method is a convenience function.
DWORD GetHeight( );
Returns the height.
Retrieves the rendering quality for the device.
D3DRMRENDERQUALITY GetQuality( );
Returns one or more of the members of the enumerated types represented by the D3DRMRENDERQUALITY type.
Retrieves the number of shades in a ramp of colors used for shading in the monochromatic (or ramp) color model.
DWORD GetShades( );
Returns the number of shades.
Retrieves the current texture quality parameter for the device. Texture quality is relevant only for an RGB device.
D3DRMTEXTUREQUALITY GetTextureQuality( );
Returns one of the members of the D3DRMTEXTUREQUALITY enumerated type.
IDirect3DRMDevice::SetTextureQuality
Retrieves the number of triangles drawn to a device since its creation. This method is a convenience function.
DWORD GetTrianglesDrawn( );
Returns the number of triangles.
The number of triangles includes those that were passed to the renderer but were not drawn because they were backfacing. The number does not include triangles that were rejected for lying outside of the viewing frustum.
Constructs a Direct3DRMViewportArray object that represents the viewports currently constructed from the device.
HRESULT GetViewports(
LPDIRECT3DRMVIEWPORTARRAY* lplpViewports
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Retrieves the width, in pixels, of a device. This method is a convenience function.
DWORD GetWidth( );
Returns the width.
Retrieves the wireframe options of a given device.
DWORD GetWireframeOptions( );
Returns a bitwise OR of the following values:
Not implemented on the Windows® platform.
HRESULT Init(
ULONG width,
ULONG height
);
Initializes a device from a specified DirectDrawClipper object.
HRESULT InitFromClipper(
LPDIRECTDRAWCLIPPER lpDDClipper,
LPGUID lpGUID,
int width,
int height
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Initializes a Retained Mode device from a specified Direct3D Immediate Mode object and Immediate Mode device.
HRESULT InitFromD3D(
LPDIRECT3D lpD3D,
LPDIRECT3DDEVICE lpD3DIMDev
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Sets the number of buffers currently being used by the application.
HRESULT SetBufferCount(
DWORD dwCount
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
An application that employs double-buffering or triple-buffering must use this method to inform the system of how many buffers it is using so that the system can calculate how much of the window to clear and update on each frame.
IDirect3DRMDevice::GetBufferCount
Sets the dither flag for the device.
HRESULT SetDither(
BOOL bDither
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Sets the rendering quality of a device.
HRESULT SetQuality (
D3DRMRENDERQUALITY rqQuality
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
The rendering quality is the maximum quality at which rendering can take place on the rendering surface of that device.
An object's quality has three components: shade mode (flat or Gouraud, Phong is not yet implemented and will default to Gouraud shading), lighting type (on or off), and fill mode (point, wireframe or solid).
You set the quality of a device with SetQuality. By default it is D3DRMRENDER_FLAT (flat shading, lights on, and solid fill).
You can set the quality of a Direct3DRMProgressiveMesh, Direct3DRMMeshBuilder, or Direct3DRMMeshBuilder2 object with their respective SetQuality methods. By default, the quality of these objects is D3DRMRENDER_GOURAUD (Gouraud shading, lights on, and solid fill).
Direct3D Retained Mode renders an object at the lowest quality setting based on the device and object's current setting for each individual component. For example, if the object's current quality setting is D3DRMRENDER_GOURAUD, and the device is D3DRMRENDER_FLAT then the object will be rendered with flat shading, solid fill and lights on.
If the object's current quality setting is D3DRMSHADE_GOURAUD|D3DRMLIGHT_OFF|D3DRMFILL_WIREFRAME and the device's quality setting is D3DRMSHADE_FLAT|D3DRMLIGHT_ON|D3DRMFILL_POINT, then the object will be rendered with flat shading, lights off and point fill mode.
These rules apply to Direct3DRMMeshBuilder objects, Direct3DRMMeshBuilder2 objects, and Direct3DRMProgressiveMesh objects. However, Direct3DRMMesh objects do not follow these rules. Mesh objects ignore the device's quality settings and use the group quality setting (which defaults to D3DRMRENDER_GOURAUD).
Sets the number of shades in a ramp of colors used for shading in the monochromatic (or ramp) model.
HRESULT SetShades(
DWORD ulShades
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Sets the texture quality for the device.
HRESULT SetTextureQuality(
D3DRMTEXTUREQUALITY tqTextureQuality
);
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
IDirect3DRMDevice::GetTextureQuality
Copies the image that has been rendered to the display. It also provides a heartbeat function to the device driver.
HRESULT Update( );
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible errors, see Direct3D Retained Mode Return Values.
Each call to this method causes the system to use an application-defined callback function, D3DRMUPDATECALLBACK. To add a callback function, use the IDirect3DRMDevice::AddUpdateCallback method.
IDirect3DRMDevice::AddUpdateCallback, D3DRMUPDATECALLBACK
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.