Skip to content

Graphics3D

Narta Xaymar Dirks edited this page Nov 25, 2026 · 15 revisions

Graphics3D Blitz3D

Graphics3D:Void width:Int32, height:Int32, depth:Int32=0, mode:Int32=0, keep:Int32=0
Parameter Mode Type Default Description
width In Int32 required Width of the picture in pixels.
height In Int32 required Height of the picture in pixels.
depth In Int32 0 Color depth, which picks the format of the buffers, see Color depth. Defaults to 0.
mode In Int32 0 Window or full screen as in the table. Defaults to 0.
keep In Int32 0 True keeps the scene, textures, images and fonts for a cheap change of the resolution. Defaults to False, which frees them like the original. A BlitzLLVM extension.

Description

The same command as Graphics, under the name that 3D programs use. There is no 2D-only graphics mode, so the 3D commands work after either of them, and a program that opens its window with Graphics can use 3D commands as well. It has to be the first graphics command of a program: every drawing command fails until it ran. After it, the back buffer is the target of drawing and you draw one frame at a time with RenderWorld and Flip. Calling either of them again closes the window and opens a new one, and frees the scene and everything else the program made, unless keep is True, see Graphics.

Mode Behavior
0 Window. This is the default.
1 Full screen.
2 Window.
3 Window whose size can be changed by the user; the picture is scaled to fit.
4 Window without a border: no title bar and no frame. This is a BlitzLLVM extension that original Blitz does not have.

Differences

  • Unlike in Blitz3D, mode 0 always opens a window, and Graphics and Graphics3D are the same command. The 3D commands do not need Graphics3D in particular.
  • The depth does not pick a video mode, it picks the format of the buffers, see Color depth.
  • Full screen (mode 1) does not change the video mode of the display, see Full screen.
  • keep is a BlitzLLVM extension; the original always frees everything.
  • A window without a border (mode 4) has the size you ask for and cannot be resized by the user.

Examples

Graphics3D 640, 480, 0, 2
SetBuffer BackBuffer()
camera = CreateCamera()
cube = CreateCube()
PositionEntity cube, 0, 0, 5

While Not KeyHit(1)
	TurnEntity cube, 1, 2, 0
	RenderWorld
	Flip
Wend

Related Commands

CountGfxModes3D Blitz3D, GfxDriver3D Blitz3D, GfxDriverCaps3D Blitz3D, GfxMode3D Blitz3D, GfxMode3DExists Blitz3D, GfxMode3DHeight BlitzLLVM, GfxMode3DWidth BlitzLLVM, Windowed3D Blitz3D

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally