GraphicsLost()

Parameters

None.

Description

Returns true if graphics mode is lost otherwise false.

Blitz3D still can't survive desktop resolution-mode changes in windowed mode. However, the new GraphicsLost() command can be used to detect this. The only thing you'll be able to do after GraphicsLost() returns True is EndGraphics() (and then perhaps reload everything back in if you can be arsed). Or, as I'd be inclined to do, just exit.

DirectX surfaces can be lost because the display mode was changed or because another application received exclusive access to the video card and freed all of the surface memory currently allocated on the card.

See also: BufferDirty.

Example

; GraphicsLost

Graphics 640,480,0,2
SetBuffer BackBuffer()

While Not KeyDown(1)
If GraphicsLost() Then RuntimeError "DirectX Error: please restart game"
Cls

Text 0,0,"GraphicsLost="+(GraphicsLost())

Flip
Wend
End

Index

Click here to view the latest version of this page online