Class Direct3dViewport
public class Direct3dViewport implements IDirect3dViewport
{
// Methods
public void addLight(Direct3dLight light);
public void clear(int count, D3dRect rec, int flags);
public void deleteLight(Direct3dLight light);
public void getBackground(int[] hdl, int[] stat);
public DirectDrawSurface getBackgroundDepth(int[] status);
public void getViewport(D3dViewportDesc vp);
public Direct3dLight nextLight(Direct3dLight l1, int flags);
public void setBackground(int hdl);
public void setBackgroundDepth(IDirectDrawSurface surface);
public void setViewport(D3dViewportDesc vp);
}
Applications use the methods of the Direct3dViewport class to retrieve and set the properties of viewports.
Note This class does not provide an initialize method. Use the Direct3d.createViewport() method to create and initialize Direct3dViewport objects.
public void addLight(Direct3dLight light);
Adds a Direct3dLight light object to the viewport.
Return Value:
No return value.
public void clear(int count, D3dRect rec, int flags);
Clears the viewport or a set of rectangles in the viewport to the current background material.
Return Value:
No return value.
Parameter | Description |
count
| The number of rectangles pointed to by rec.
|
rec
| A D3dRect object.
|
flags
| One or more values of D3DCLEAR_ type, indicating what to clear: the rendering target, the z-buffer, or both.
|
public void deleteLight(Direct3dLight light);
Deletes a Direct3dLight light object from the viewport.
Return Value:
No return value.
public void getBackground(int[] hdl, int[] stat);
Retrieves the handle of a material that represents the current viewport background.
Return Value:
No return value.
Parameter | Description |
hdl
| The array variable that receives the handle of the material being used as the background.
|
stat
| The array variable that receives a value, indicating whether a background is associated with the viewport. If this value is FALSE, a background is not associated with the viewport.
|
See Also: setBackground
public DirectDrawSurface getBackgroundDepth(int[] status);
Retrieves a DirectDraw surface that represents the current background-depth field associated with the viewport.
Return Value:
Returns the DirectDrawSurface object if successful; otherwise, returns null.
Parameter | Description |
status
| The array variable that receives the value FALSE if a background depth is not associated with the viewport.
|
See Also: setBackgroundDepth
public void getViewport(D3dViewportDesc vp);
Retrieves the viewport registers.
Return Value:
No return value.
Parameter | Description |
vp
| A D3dViewportDesc object that receives values for the viewport.
|
See Also: setViewport
public Direct3dLight nextLight(Direct3dLight l1, int flags);
Retrieves a light from a Direct3dViewport, according to the specified flags.
Return Value:
Returns the requested Direct3dLight object.
Parameter | Description |
l1
| This may be null if the flags constant is either D3DNEXT_HEAD or D3DNEXT_TAIL.
|
flags
| This may be one of the following values:
- D3DNEXT_HEAD
- D3DNEXT_TAIL
- D3DNEXT_NEXT
|
public void setBackground(int hdl);
Sets the background associated with the viewport.
Return Value:
No return value.
Parameter | Description |
hdl
| The material handle that will be used as the background.
|
See Also: getBackground
public void setBackgroundDepth(IDirectDrawSurface surface);
Sets the viewport background depth field.
Return Value:
No return value.
Parameter | Description |
surface
| The DirectDrawSurface object representing the background depth.
|
Remarks:
The z-buffer is filled with the specified depth field when the clear method is called and the D3DCLEAR_ZBUFFER flag is specified. The bit depth must be 16 bits.
See Also: getBackgroundDepth
public void setViewport(D3dViewportDesc vp);
Sets the viewport registers.
Return Value:
No return value.
Parameter | Description |
vp
| A D3dViewportDesc object that contains the new viewport.
|
See Also: getViewport