Package com.ms.com.directX |
![]() Previous |
![]() Microsoft Packages |
![]() Index |
![]() Next |
Applications use the methods of the d3drmDevice class to interact with the output device.
public class d3drmDevice implements Id3drmDevice { public void InternalSetObject(IUnknown lpdd); public IUnknown InternalGetObject(); public d3drmDevice Clone(); public void AddDestroyCallback(Id3drmCallback fn, IUnknown Arg); public void DeleteDestroyCallback(Id3drmCallback fn, IUnknown args); public void SetAppData(int data); public int GetAppData(); public void SetName(String name); public String GetName(); public String GetClassName(); public d3drmWinDevice Getd3drmWinDevice(); public void Init(int width, int height); public void InitFromD3D(d3d d3d, d3dDevice dev); public void InitFromClipper(ddClipper ddClipper, GuidData g, int width, int height); public void Update(); public void AddUpdateCallback(IDeviceUpdateCallback fn, IUnknown args); public void DeleteUpdateCallback(IDeviceUpdateCallback fn, IUnknown args); public void SetBufferCount(int count); public int GetBufferCount(); public void SetDither(int dith); public void SetShades(int s); public void SetQuality(int q); public void SetTextureQuality(int d); public d3drmViewportArray GetViewports(); public int GetDither(); public int GetShades(); public int GetHeight(); public int GetWidth(); public int GetTextureQuality(); public int GetTrianglesDrawn(); public int GetWireframeOptions(); public int GetQuality(); public int GetColorModel(); public d3dDevice GetDirect3DDevice(); }
The methods can be organized into the following groups:
Buffer counts | GetBufferCount |
SetBufferCount | |
Color models | GetColorModel |
Dithering | GetDither |
SetDither | |
Initialization | Init |
InitFromClipper | |
InitFromD3D | |
Miscellaneous | Getd3drmWinDevice |
GetDirect3DDevice | |
GetHeight | |
GetTrianglesDrawn | |
GetViewports | |
GetWidth | |
GetWireframeOptions | |
Update | |
Notifications | AddUpdateCallback |
DeleteUpdateCallback | |
Rendering quality | GetQuality |
SetQuality | |
Shading | GetShades |
SetShades | |
Texture quality | GetTextureQuality |
SetTextureQuality |
In addition, the d3drmDevice class inherits the following methods from the d3drmObject class:
AddDestroyCallback |
Clone |
DeleteDestroyCallback |
GetAppData |
GetClassName |
GetName |
SetAppData |
SetName |
The d3drmDevice 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 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 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 buffers—one 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 d3dDevice GetDirect3DDevice();Retrieves an Immediate-Mode device.
Return Value:
Returns the d3dDevice object if successful; null otherwise.
public int GetDither();Retrieves the dither flag for the device.
Return Value:
Returns TRUE if the dither flag is set, or FALSE otherwise.
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 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 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 one value of texture quality type.
See Also: SetTextureQuality
public d3drmViewportArray GetViewports();Constructs a d3drmViewportArray object that represents the viewports currently constructed from the device.
Return Value:
Returns the d3drmViewportArray object if successful; null otherwise.
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 InitFromClipper(ddClipper ddClipper, GuidData g, int width, int height);Initializes a device from a specified DirectDrawClipper object.
Return Value:
No return value.
Parameter Description ddClipper The ddClipper object to use as an initializer. g The globally unique identifier (GUID) used as the interface identifier. width and height Width and height of the device.
public void InitFromD3D(d3d d3d, d3dDevice dev);Initializes a Retained-Mode device from a specified Direct3D Immediate-Mode object and Immediate-Mode device.
Return Value:
No return value.
Parameter Description d3d The Direct3D Immediate-Mode (d3d) object to use to initialize the Retained-Mode device. dev The Immediate-Mode device (d3dDevice) to use to initialize the Retained-Mode device.
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 bDither New dithering mode for the device. 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 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. It also 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
public d3drmWinDevice Getd3drmWinDevice();Retrieves the Windows device associated with this Retained-Mode device.
Return Value:
Returns the d3drmWinDevice object if successful; null otherwise.