Skip to content

SetCameraBuffer

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

SetCameraBuffer

SetCameraBuffer:Void camera:Int32, buffer:Int32
Parameter Mode Type Default Description
camera In Int32 required Camera handle.
buffer In Int32 required The buffer to draw into, or 0 for the buffer of SetBuffer.

Description

Makes a camera always draw into one buffer, whatever SetBuffer says. RenderWorld then draws this camera into its own buffer and every other camera into the current buffer, in the usual EntityOrder. This is a BlitzLLVM extension.

The buffer can be BackBuffer(), FrontBuffer() or the TextureBuffer of a texture made with flag 4096 (render target). An image buffer is not allowed, as with RenderWorld. 0 makes the camera draw into the buffer of SetBuffer again.

CameraViewport is in the buffer the camera draws to, so the default viewport covers the whole texture. When the texture is freed, the camera goes back to the buffer of SetBuffer.

It is meant for things like a security monitor, a rear-view mirror or a minimap: one RenderWorld draws the main view and the texture that a screen in the world shows.

Examples

Graphics3D 320, 240, 0, 2
SetBuffer BackBuffer()
main = CreateCamera()
PositionEntity main, 0, 0, -5
screen = CreateCube()
monitor = CreateTexture(128, 128, 1 + 4096)
EntityTexture screen, monitor
spy = CreateCamera()
PositionEntity spy, 0, 5, -5
PointEntity spy, screen
SetCameraBuffer spy, TextureBuffer(monitor)
RenderWorld ; The main camera draws into the back buffer, the spy camera into the texture.
Flip

Related Commands

CameraClsColor, GetCameraBuffer, SetCameraClipPlane, SetCameraClipPlaneEnabled, SetCameraProjectionMatrix, SetCameraStencil, SetCameraStencilClear, SetCameraViewMatrix

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally