sysGetPrimaryMonitor

Category: System

Syntax:

sysGetPrimaryMonitor:Int()



Returns

Int



Summary

Returns the number of the default monitor - the one a window opens on unless sysSetMonitor says otherwise.

Takes no parameters.

Returns the primary monitor number (zero-based). Can be called BEFORE b2dGraphics - a program choosing a monitor has no window yet.

Note: this answers "where will my window open", which can DISAGREE with what the desktop calls its primary monitor. Wayland has no protocol for a compositor to advertise a primary output, so the runtime cannot see that setting. A program that wants a specific screen should use sysSetMonitor rather than assuming.

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



Example
Print "Window will open on monitor " & ToString(sysGetPrimaryMonitor())

BambooBasic © 2026 Michael Denathorn