sysQuitRequested

Category: System

Syntax:

sysQuitRequested:Int()



Returns

Int



Summary

Returns TRUE (1) once the user has asked the program to close - the window's close button, or the window manager closing it.

Takes no parameters.

Returns TRUE (1) if a quit has been requested, FALSE (0) otherwise.

This exists because the Linux edition lets a program exit gracefully: the main loop ends, and code after it runs normally before b2dEnd. Without this call a program has no way to notice the close button. Poll it in the main loop, after sysUpdateEvents.

Linux edition only - this function has no Windows counterpart, so it is not in the online documentation.



Example
b2dGraphics(640, 480, 1)
While sysQuitRequested() = 0
	sysUpdateEvents()
	b2dCls()
	; ... draw here ...
	b2dFlip()
Wend
b2dEnd()

BambooBasic © 2026 Michael Denathorn