Skip to content

WritePixel64

Narta Xaymar Dirks edited this page Oct 28, 2026 · 3 revisions
BlitzLLVM

WritePixel64 〔BlitzLLVM〕

WritePixel64:Void x:Int32, y:Int32, buffer:Int32=0, red:Float16, green:Float16, blue:Float16, alpha:Float16
Parameter Mode Type Default Description
x In Int32 required Horizontal position of the pixel.
y In Int32 required Vertical position of the pixel.
buffer In Int32 0 The buffer to write to. Pass 0 for the current buffer.
red In Float16 required The red of the color, as a Float16.
green In Float16 required The green of the color, as a Float16.
blue In Float16 required The blue of the color, as a Float16.
alpha In Float16 required The alpha of the color, as a Float16.

Description

〔BlitzLLVM〕 This command does not exist in the original Blitz products. BlitzLLVM adds it.

Sets a pixel of a buffer to a color given as a Long. The color has 16 bits for each of alpha, red, green and blue from the top ($AAAARRRRGGGGBBBB), whatever the buffer is made of, so nothing is lost in a buffer that Graphics3D made with the depth 64, see Color depth. A buffer with 8 bits per channel gives each of them times 257 ($FF is $FFFF), and one with 10 bits fills the lower bits from the upper ones. This is a BlitzLLVM extension: the originals have no buffers with more than 8 bits per channel. The alpha of a buffer that has none is ignored. Writes the color of a pixel from four half precision floats (Float16). A buffer made with the depth 64 stores them as they are, even above 1; the other depths clamp them to 0 to 1 and round them. This is a BlitzLLVM extension.

Differences

  • A position outside of the buffer is ignored. A buffer without alpha stores 1 for the alpha. See Color depth.

Examples

Graphics3D 320, 240, 64, 2
SetBuffer BackBuffer()
Cls
For i = 0 To 255
	WritePixel64 32 + i, 120, 0, i / 255.0, (255 - i) / 255.0, 0.5, 1.0
Next
Flip
WaitKey

Related Commands

ReadPixel64 〔BlitzLLVM〕, WritePixel, WritePixelFast, WritePixelFast64 〔BlitzLLVM〕

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally