framebuffer

package
v0.32.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package framebuffer provides a convenient way of working with OpenGL framebuffers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flip added in v0.32.0

type Flip struct {
	// contains filtered or unexported fields
}

Flip provides a two paged framebuffer

func NewFlip added in v0.32.0

func NewFlip(clearOnRender bool) *Flip

NewFlip is the preferred method of initialisation of the Flip type

func (*Flip) Clear added in v0.32.0

func (fb *Flip) Clear()

func (*Flip) Destroy added in v0.32.0

func (fb *Flip) Destroy()

Destroy should be called when the Flip is no longer required

func (*Flip) Dimensions added in v0.32.0

func (fb *Flip) Dimensions() (width int32, height int32)

Dimensions returns the width and height of the frame buffer used in the Flip

func (*Flip) Process added in v0.32.0

func (fb *Flip) Process(draw func()) uint32

Process the Flip using the suppied draw function. The draw function should typically invoke a GLSL shader. The texture ID of the shader will be returned by the Process function. This is ID is the same as the ID returned by the Texture() function

func (*Flip) Setup added in v0.32.0

func (fb *Flip) Setup(width int32, height int32) bool

Setup Flip for specified dimensions

Returns true if any previous texture data has been lost. This can happen when the dimensions have changed. By definition, the first call to Setup() will always return false.

If the supplied width or height are less than zero the function will return false with no explanation.

func (*Flip) Texture added in v0.32.0

func (fb *Flip) Texture() uint32

Texture returns the texture ID of the last Flip texture to be processed. Using this ID can be an effective way of chaining shaders

type Single added in v0.32.0

type Single struct {
	// contains filtered or unexported fields
}

Single provides a single framebuffer

func NewSingle added in v0.32.0

func NewSingle(clearOnRender bool) *Single

NewFlip is the preferred method of initialisation of the Single type

func (*Single) Clear added in v0.32.0

func (fb *Single) Clear()

func (*Single) Destroy added in v0.32.0

func (fb *Single) Destroy()

Destroy should be called when the Single is no longer required

func (*Single) Dimensions added in v0.32.0

func (fb *Single) Dimensions() (width int32, height int32)

Dimensions returns the width and height of the frame buffer used in the Single

func (*Single) Process added in v0.32.0

func (fb *Single) Process(draw func()) uint32

Process the Single using the suppied draw function. The draw function should typically invoke a GLSL shader. The texture ID of the shader will be returned by the Process function. This is ID is the same as the ID returned by the Texture() function.

func (*Single) Setup added in v0.32.0

func (fb *Single) Setup(width int32, height int32) bool

Setup Single for specified dimensions

Returns true if any previous texture data has been lost. This can happen when the dimensions have changed. By definition, the first call to Setup() will always return false.

If the supplied width or height are less than zero the function will return false with no explanation.

func (*Single) Texture added in v0.32.0

func (fb *Single) Texture() uint32

Texture returns the texture ID used by the single framebuffer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL