Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RasterBuffer ¶
type RasterBuffer struct { ClearDepth float32 ClearColor RGBA PixelColor RGBA // contains filtered or unexported fields }
RasterBuffer provides a memory mapped RGBA and Z buffer This buffer must be blitted to another buffer, for example, PNG or display buffer (like SDL).
func NewRasterBuffer ¶
func NewRasterBuffer(width, height int) *RasterBuffer
NewRasterBuffer creates a display buffer
func (*RasterBuffer) ClearZs ¶
func (rb *RasterBuffer) ClearZs()
ClearZs sets the z buffer to ClearDepth
func (*RasterBuffer) SetPixel ¶
func (rb *RasterBuffer) SetPixel(x, y int, z float32) int
SetPixel sets a pixel and rejects based on a Z buffer. Returns: -1 = pixel is beyond screen 0 = pixel was farther away and ignored 1 = pixel is closer and was entered into framebuffer and zbuffer 2 = pixel is exact/(on top) and was ignored
func (*RasterBuffer) SetPixelColor ¶
func (rb *RasterBuffer) SetPixelColor(x, y int, z float32, color RGBA) int
SetPixelColor set the current pixel color and sets the pixel using SetPixel()
Click to show internal directories.
Click to hide internal directories.