b2dGraphics

Category: 2D Overlay

Syntax:

b2dGraphics:Int(resWidth:Int, resHeight:Int, graphicsMode:Int)


Parameters

Returns

Int



Summary

Creates the window and initialises the Vulkan rendering pipeline. This is the entry point for every graphical program - it opens the window that the other b2d* functions draw into. (It was called b3dGraphics3D in earlier versions.)

Takes resWidth (horizontal resolution), resHeight (vertical resolution), graphicsMode (0=fullscreen+vsync, 1=windowed+vsync, 2=fullscreen+no vsync, 3=windowed+no vsync, 4=hidden canvas-only). Any unrecognised mode is treated as 0.

Returns TRUE (1) on success, FALSE (0) on failure.

resWidth and resHeight are the program's coordinate space, not necessarily the size of the surface. In a fullscreen mode the window is the size of the monitor, and the requested resolution is scaled to fit inside it and centred - one scale factor for both axes, so the aspect ratio is preserved and any leftover space becomes black bars. Drawing is always in 0..resWidth by 0..resHeight regardless. When the monitor and the requested resolution match, the fit is the whole screen at scale 1 and nothing changes.

To fill a screen exactly with no bars, ask for its own resolution - see sysGetMonitorWidth and sysGetMonitorHeight.

View detailed documentation online



Example

;No example implemented yet


BambooBasic © 2026 Michael Denathorn