Skip to content

Graphics3D

Narta Xaymar Dirks edited this page Oct 29, 2026 · 12 revisions
Blitz3D

Graphics3D

Graphics3D:Void width:Int32, height:Int32, depth:Int32=0, mode: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: 8 for a palette of 256 colors (see GraphicsPalette), 12 for R4G4B4A4, 15 for A1R5G5B5, 16 for R5G6B5, 24 for R8G8B8X8, 30 for R10G10B10A2, 32 for R8G8B8A8 and 64 for R16G16B16A16 (half precision floats, never integers). 0 gives 32. Defaults to 0.
mode In Int32 0 Window or full screen as in the table. Defaults to 0.

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.

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: 8 is a palette of 256 colors, 12 is R4G4B4A4, 15 is A1R5G5B5, 16 is R5G6B5, 24 is R8G8B8X8, 30 is R10G10B10A2, 32 is R8G8B8A8 and 64 is R16G16B16A16 with half precision floats. 0 and any other number give 32 (with a warning for the others), and a format that the graphics card can't draw to gives the next smaller one. Pixels are read and written as 8 bits per channel whatever the depth is. See Color depth.
  • 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.
  • 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, GfxDriver3D, GfxDriverCaps3D, GfxMode3D, GfxMode3DExists, GfxMode3DHeight 〔BlitzLLVM〕, GfxMode3DWidth 〔BlitzLLVM〕, Windowed3D

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally