Class Direct3dRMDevice
public class Direct3dRMDevice implements IDirect3dRMDevice
{
// Methods
public void addUpdateCallback(IDeviceUpdateCallback fn,
IUnknown args);
public void deleteUpdateCallback(IDeviceUpdateCallback fn,
IUnknown args);
public int getBufferCount();
public int getColorModel();
public Direct3dRMWinDevice getd3drmWinDevice();
public Direct3dDevice getDirect3DDevice();
public int getDither();
public int getHeight();
public int getQuality();
public int getShades();
public int getTextureQuality();
public int getTrianglesDrawn();
public Direct3dRMViewportArray getViewports();
public int getWidth();
public int getWireframeOptions();
public void init(int width, int height);
public void setBufferCount(int count);
public void setDither(int dith);
public void setQuality(int q);
public void setShades(int s);
public void setTextureQuality(int d);
public void update();
}
Applications use the methods of the Direct3dRMDevice class to interact with the output device.
The Direct3dRMDevice class inherits the following methods from the Direct3dRMObject class:
- addDestroyCallback
- deleteDestroyCallback
- duplicate
- getAppData
- getClassName
- getName
- setAppData
- setName
The Direct3dRMDevice object is obtained by calling the createDevice method.
public void addUpdateCallback(IDeviceUpdateCallback fn, IUnknown args);
Adds a callback function that alerts the application when a change occurs to the device. The system calls this callback function whenever the application calls the update method.
Return Value:
No return value.
Parameter | Description |
fn
| The callback interface that contains an application-defined callback function.
|
args
| Private data to be passed to the update callback function.
|
See Also: deleteUpdateCallback, update
public void deleteUpdateCallback(IDeviceUpdateCallback fn, IUnknown args);
Removes an update callback function that was added by calling the addUpdateCallback method.
Return Value:
No return value.
Parameter | Description |
fn
| The callback interface that contains an application-defined callback function.
|
args
| Private data that was passed to the update callback function.
|
See Also: addUpdateCallback, update
public int getBufferCount();
Retrieves the value set in a call to the setBufferCount method.
Return Value:
Returns the number of buffersone for single-buffering, two for double-buffering, and so on.
public int getColorModel();
Retrieves the color model of a device.
Return Value:
Returns a value of D3DCOLOR_ type that describes the Direct3D color model (RGB or monochrome).
public Direct3dRMWinDevice getd3drmWinDevice();
Retrieves the Microsoft® Windows® device associated with this Retained-Mode device.
Return Value:
Returns the Direct3dRMWinDevice object if successful; otherwise, returns null.
public Direct3dDevice getDirect3DDevice();
Retrieves an Immediate-Mode device.
Return Value:
Returns the Direct3dDevice object if successful; otherwise, null.
public int getDither();
Retrieves the dither flag for the device.
Return Value:
Returns true if the dither flag is set; otherwise, returns false.
See Also: setDither
public int getHeight();
Retrieves the height, in pixels, of a device. This method is a convenience function.
Return Value:
Returns the height.
public int getQuality();
Retrieves the rendering quality for the device.
Return Value:
Returns one or more values of the render quality type.
See Also: setQuality
public int getShades();
Retrieves the number of shades in a ramp of colors used for shading.
Return Value:
Returns the number of shades.
See Also: setShades
public int getTextureQuality();
Retrieves the current texture quality parameter for the device. Texture quality is relevant only for an RGB device.
Return Value:
Returns a value of texture quality type.
See Also: setTextureQuality
public int getTrianglesDrawn();
Retrieves the number of triangles drawn to a device since its creation. This method is a convenience function.
Return Value:
Returns the number of triangles.
Remarks:
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.
public Direct3dRMViewportArray getViewports();
Constructs a Direct3dRMViewportArray object that represents the viewports currently constructed from the device.
Return Value:
Returns the Direct3dRMViewportArray object if successful; otherwise, returns null.
public int getWidth();
Retrieves the width, in pixels, of a device. This method is a convenience function.
Return Value:
Returns the width.
public int getWireframeOptions();
Retrieves the wireframe options of a given device.
Return Value:
Returns a combination of values of D3DRMWIREFRAME_ type.
public void init(int width, int height);
Not implemented on the Windows platform.
public void setBufferCount(int count);
Sets the number of buffers currently being used by the application.
Return Value:
No return value.
Parameter | Description |
count
| Specifies the number of buffers one for single-buffering, two for double-buffering, and so on. The default value is 1, which is correct only for single-buffered window operation.
|
Remarks:
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.
See Also: getBufferCount
public void setDither(int dith);
Sets the dither flag for the device.
Return Value:
No return value.
Parameter | Description |
dith
| The new dithering mode for the device; the value can be true or false.
|
Remarks:
By default, a device's dither flag is initially set to true.
See Also: getDither
public void setQuality(int q);
Sets the rendering quality of a device
Return Value:
No return value.
Parameter | Description |
q
| One or more values of the render quality type.
|
Remarks:
The rendering quality is the maximum quality at which rendering can take place on the rendering surface of that device. Each mesh can have its own quality, but the maximum quality available for a mesh is that of the device. Different devices can have different qualities. For example, previewing devices usually have a lower quality, while devices used for final viewing usually have a higher quality.
By default, a device's rendering quality is initially set to D3DRMRENDER_FLAT.
See Also: getQuality
public void setShades(int s);
Sets the number of shades in a ramp of colors used for shading.
Return Value:
No return value.
Parameter | Description |
s
| The new number of shades. This parameter must be a power of 2.
|
Remarks:
By default, a device's number of shades is initially set to 32.
See Also: getShades
public void setTextureQuality(int d);
Sets the texture quality for the device.
Return Value:
No return value.
Parameter | Description |
d
| One value of the texture quality type.
|
Remarks:
By default, a device's texture quality is initially set to D3DRMTEXTURE_NEAREST.
See Also: getTextureQuality
public void update();
Copies the image that has been rendered to the display and provides a heartbeat function to the device driver.
Return Value:
No return value.
Remarks:
Each call to this method causes the system to call an application-defined callback function. To add a callback function, use the addUpdateCallback method.
See Also: addUpdateCallback, com.ms.directX.Direct3dRMViewport.forceUpdate