Skip to content

GraphicsLost

Narta Xaymar Dirks edited this page Oct 29, 2026 · 6 revisions
Blitz3D

GraphicsLost

GraphicsLost:Int32

Returns: 1 once after the graphics were lost and made again, then 0 until it happens again. Programs that never draw into images and textures have nothing to do when it is 1.

Description

Tells whether the graphics were lost, which happened to the original when another program took over the display. In BlitzLLVM the graphics are lost when the graphics driver crashes or the GPU is reset; they are made again on their own, and this tells the program that it happened, see Lost graphics device.

Examples

Graphics 640, 480, 0, 2
SetBuffer BackBuffer()
Local shield = CreateImage(32, 32)
DrawShield shield
While Not KeyHit(1)
	Cls
	DrawImage shield, 100, 100
	Flip
	If GraphicsLost() Then DrawShield shield ; Whatever was drawn into the image is gone, draw it again.
Wend

Function DrawShield(image)
	SetBuffer ImageBuffer(image)
	Color 40, 90, 200
	Oval 0, 0, 32, 32, 1
	SetBuffer BackBuffer()
End Function

Related Commands

EndGraphics, Graphics, GraphicsDepth, GraphicsFormat, GraphicsHeight, GraphicsPalette, GraphicsWidth

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally