Skip to content

Graphics

Claude edited this page Oct 27, 2026 · 11 revisions

Blitz3DBlitzPlusBlitzBasic

Graphics

Command Syntax

Graphics width:Int32, height:Int32, depth:Int32=0, mode:Int32=0

Parameters

Parameter Type Default Description
width Int32 required Width of the picture in pixels.
height Int32 required Height of the picture in pixels.
depth Int32 0 Color depth in bits: 0, 16, 24 or 32. Defaults to 0, which lets the system choose.
mode Int32 0 0 opens a window, 1 uses full screen (a borderless window over the display, see Fullscreen), 2 opens a window and 3 opens a window that the user can resize. 4 opens a window without a border: no title bar and no frame. Mode 4 is a BlitzLLVM extension that original Blitz does not have. Defaults to 0.

Description

Opens the graphics window and has to be called before any drawing command. Calling it again closes the window and opens a new one, and then all images and textures are gone, so load them again. It also puts the colors and the current buffer back to their defaults.

Differences

  • The color depth is accepted but ignored: the picture always has at least 8 bits each of red, green and blue (with 8 bits of alpha where it is used), because palette and 16 bit rendering are not supported. GraphicsDepth says 32 whatever you ask for.
  • Full screen (mode 1) does not change the video mode of the display: the picture is shown at the largest size that fits with its aspect ratio kept, and the rest is black. See Fullscreen.
  • In a resizable window (mode 3) the picture is scaled to the size of the window, and the mouse position is converted to picture pixels.
  • The modes 6 and 7 of Blitz3D, which pause the program while the window is in the background, act like 2 and 3. The program keeps running.
  • In a window without a border (mode 4) the color depth is not used either, and the window has the size you ask for and cannot be resized by the user.
  • A width or height below 1 stops the program with an error message.

Examples

Graphics 320, 240, 32, 2
SetBuffer BackBuffer()
Cls
Text 160, 100, "Graphics 320, 240, 32, 2", 1, 1
Text 160, 120, "Width " + GraphicsWidth() + ", Height " + GraphicsHeight(), 1, 1
Flip
WaitKey

Media

Graphics

Related Commands

EndGraphics, GraphicsDepth, GraphicsFormat, GraphicsHeight, GraphicsLost, GraphicsWidth

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally