Skip to content

SetGraphicsRefreshRate

Narta Xaymar Dirks edited this page Nov 25, 2026 · 1 revision

SetGraphicsRefreshRate

SetGraphicsRefreshRate:Void rate:Float32
Parameter Mode Type Default Description
rate In Float32 required The most frames per second, up to 100000. 0 is no limit, which is also the start value. Anything else is a runtime error.

Description

Sets the most frames per second that Flip lets the program show. This is a BlitzLLVM extension. It replaces the fragile loop of CreateTimer and WaitTimer: the wait is kept by deadlines that follow the last frame, so one slow frame does not push every later frame back and a 60 Hz limit stays at 60 frames per second.

Examples

Graphics3D 640, 480, 32, 2
SetBuffer BackBuffer()
SetGraphicsRefreshRate 120 ; no more than 120 frames per second
While Not KeyHit(1)
	RenderWorld
	Flip 1 ; waits for the display and keeps the limit
Wend

Flip 0 is never limited. Flip 1 waits for the display and keeps the limit. Flip 2 never makes the program wait: the program renders as fast as it can, and a frame that is flipped sooner than the limit allows is drawn but not shown, so the display gets the newest frame at most as often as the limit.

Related Commands

CountRefreshRates BlitzLLVM, DisplayModeRefreshRate BlitzLLVM, DisplayRefreshRate BlitzLLVM, EndGraphics BlitzBasic, GetGraphicsRefreshRate, RefreshRateAt BlitzLLVM, SetGamma BlitzBasic, SetGfxDriver BlitzBasic

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally