dxCameraClsMode(camera,cls_color,z_buffer)

Parameters

camera - camera handle
dxCls_dxColor - true to clear the dxColor buffer, false not to
dxCls_zbuffer - true to clear the z-buffer, false not to

Description

Sets camera clear mode.

Example

; dxCameraClsMode Example
; ---------------------

dxGraphics3D 640,480
dxSetBuffer dxBackBuffer()

camera=dxCreateCamera()
dxPositionEntity camera,0,1,-10

light=dxCreateLight()
dxRotateEntity light,90,0,0

plane=dxCreatePlane()
ground_tex=dxLoadTexture("media/MossyGround.bmp")
dxEntityTexture plane,ground_tex

cube=dxCreateCube()
dxPositionEntity cube,0,1,0

; Load 2D background image
background=LoadImage("media/sky.bmp")

; Use red ink dxColor so we can see dxText on top of black or light blue background
dxColor 255,0,0

While Not dxKeyDown(1)

If dxKeyDown(205)=True Then dxTurnEntity camera,0,-1,0
If dxKeyDown(203)=True Then dxTurnEntity camera,0,1,0
If dxKeyDown(208)=True Then dxMoveEntity camera,0,0,-0.05
If dxKeyDown(200)=True Then dxMoveEntity camera,0,0,0.05

; Toggle dxCls_dxColor value between 0 and 1 when spacebar is pressed
If dxKeyHit(57)=True Then dxCls_dxColor=1-dxCls_dxColor

; Set the camera clear mode, using the dxCls_dxColor value
dxCameraClsMode camera,dxCls_dxColor,1

; Draw a 2D background. When dxCls_dxColor is set to 0, the 2D graphics will show behind the 3D graphics.
TileBlock background,0,0

dxRenderWorld

dxText 0,0,"Use cursor keys to move about"
dxText 0,20,"Press space bar to enable/disable colour clearing"
dxText 0,40,"dxCameraClsMode camera,"+dxCls_dxColor+","+1

dxFlip

Wend

End

Index