buffer

package
v0.0.0-...-491ee29 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StaticDraw  = DrawMode(gl.STATIC_DRAW)
	DynamicDraw = DrawMode(gl.DYNAMIC_DRAW)
	StreamDraw  = DrawMode(gl.STREAM_DRAW)
	StaticRead  = DrawMode(gl.STATIC_READ)
	DynamicRead = DrawMode(gl.DYNAMIC_READ)
	StreamRead  = DrawMode(gl.STREAM_READ)
	StaticCopy  = DrawMode(gl.STATIC_COPY)
	DynamicCopy = DrawMode(gl.DYNAMIC_COPY)
	StreamCopy  = DrawMode(gl.STREAM_COPY)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DrawMode

type DrawMode uint32

type Framebuffer

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

Framebuffer is a fixed resolution texture that you can draw on.

func NewFrame

func NewFrame(width, height int, smooth, depth bool) *Framebuffer

NewFrame creates a new fully transparent Framebuffer with given dimensions in pixels.

func NewFrameDepth

func NewFrameDepth(width, height int, smooth bool) *Framebuffer

func NewFrameF

func NewFrameF(width, height int) *Framebuffer

func NewFrameLayer

func NewFrameLayer(texture texture.Texture, layer int) *Framebuffer

func NewFrameMultisample

func NewFrameMultisample(width, height int, samples int) *Framebuffer

func NewFrameMultisampleScreen

func NewFrameMultisampleScreen(width, height int, depth bool, samples int) *Framebuffer

func (*Framebuffer) Bind

func (f *Framebuffer) Bind()

Bind binds the Framebuffer. All draw operations will target this Framebuffer until Unbind is called.

func (*Framebuffer) ClearColor

func (f *Framebuffer) ClearColor(r, g, b, a float32)

func (*Framebuffer) ClearColorI

func (f *Framebuffer) ClearColorI(index int, r, g, b, a float32)

func (*Framebuffer) ClearColorIM

func (f *Framebuffer) ClearColorIM(index int, color color2.Color)

func (*Framebuffer) ClearColorM

func (f *Framebuffer) ClearColorM(color color2.Color)

func (*Framebuffer) ClearDepth

func (f *Framebuffer) ClearDepth()

func (*Framebuffer) ClearDepthV

func (f *Framebuffer) ClearDepthV(v float32)

func (*Framebuffer) Dispose

func (f *Framebuffer) Dispose()

func (*Framebuffer) GetHeight

func (f *Framebuffer) GetHeight() int

func (*Framebuffer) GetID

func (f *Framebuffer) GetID() uint32

GetID returns the OpenGL framebuffer ID of this Framebuffer.

func (*Framebuffer) GetWidth

func (f *Framebuffer) GetWidth() int

func (*Framebuffer) Texture

func (f *Framebuffer) Texture() texture.Texture

Texture returns the Framebuffer's underlying Texture that the Framebuffer draws on.

func (*Framebuffer) Unbind

func (f *Framebuffer) Unbind()

Unbind unbinds the Framebuffer. All draw operations will go to whatever was bound before this Framebuffer.

type IndexBufferObject

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

func NewIndexBufferObject

func NewIndexBufferObject(maxIndices int) *IndexBufferObject

func NewIndexBufferObjectInt

func NewIndexBufferObjectInt(maxIndices int) *IndexBufferObject

func (*IndexBufferObject) Bind

func (ibo *IndexBufferObject) Bind()

func (*IndexBufferObject) Capacity

func (ibo *IndexBufferObject) Capacity() int

func (*IndexBufferObject) Dispose

func (ibo *IndexBufferObject) Dispose()

func (*IndexBufferObject) Draw

func (ibo *IndexBufferObject) Draw()

func (*IndexBufferObject) DrawInstanced

func (ibo *IndexBufferObject) DrawInstanced(baseInstance, instanceCount int)

func (*IndexBufferObject) DrawPart

func (ibo *IndexBufferObject) DrawPart(offset, length int)

func (*IndexBufferObject) DrawPartInstanced

func (ibo *IndexBufferObject) DrawPartInstanced(offset, length, baseInstance, instanceCount int)

func (*IndexBufferObject) SetData

func (ibo *IndexBufferObject) SetData(offset int, data []uint16)

reflect.TypeOf(s).Elem().Size()

func (*IndexBufferObject) SetDataI

func (ibo *IndexBufferObject) SetDataI(offset int, data []uint32)

func (*IndexBufferObject) Unbind

func (ibo *IndexBufferObject) Unbind()

type MemoryChunk

type MemoryChunk struct {
	Offset int
	Data   []float32
}

type PersistentBufferObject

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

func NewPersistentBufferObject

func NewPersistentBufferObject(maxFloats int) *PersistentBufferObject

func (*PersistentBufferObject) Bind

func (vbo *PersistentBufferObject) Bind()

func (*PersistentBufferObject) Capacity

func (vbo *PersistentBufferObject) Capacity() int

func (*PersistentBufferObject) Dispose

func (vbo *PersistentBufferObject) Dispose()

func (*PersistentBufferObject) GetID

func (vbo *PersistentBufferObject) GetID() uint32

func (*PersistentBufferObject) Map

func (vbo *PersistentBufferObject) Map(size int) MemoryChunk

func (*PersistentBufferObject) Resize

func (vbo *PersistentBufferObject) Resize(newCapacity int)

func (*PersistentBufferObject) SetData

func (vbo *PersistentBufferObject) SetData(offset int, data []float32)

func (*PersistentBufferObject) Unbind

func (vbo *PersistentBufferObject) Unbind()

func (*PersistentBufferObject) Unmap

func (vbo *PersistentBufferObject) Unmap(offset, size int)

type StreamingBuffer

type StreamingBuffer interface {
	Capacity() int
	Bind()
	Unbind()
	Resize(newCapacity int)
	SetData(offset int, data []float32)
	Map(size int) MemoryChunk
	Unmap(offset int, size int)
	Dispose()
	GetID() uint32
}

type VertexArrayObject

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

func NewVertexArrayObject

func NewVertexArrayObject() *VertexArrayObject

func (*VertexArrayObject) AddMappedVBO

func (vao *VertexArrayObject) AddMappedVBO(name string, maxVertices int, divisor int, format attribute.Format)

func (*VertexArrayObject) AddPersistentVBO

func (vao *VertexArrayObject) AddPersistentVBO(name string, maxVertices int, divisor int, format attribute.Format)

func (*VertexArrayObject) AddVBO

func (vao *VertexArrayObject) AddVBO(name string, maxVertices int, divisor int, format attribute.Format)

func (*VertexArrayObject) Attach

func (vao *VertexArrayObject) Attach(s *shader.RShader)

func (*VertexArrayObject) AttachIBO

func (vao *VertexArrayObject) AttachIBO(ibo *IndexBufferObject)

func (*VertexArrayObject) Bind

func (vao *VertexArrayObject) Bind()

func (*VertexArrayObject) Dispose

func (vao *VertexArrayObject) Dispose()

func (*VertexArrayObject) Draw

func (vao *VertexArrayObject) Draw()

func (*VertexArrayObject) DrawInstanced

func (vao *VertexArrayObject) DrawInstanced(baseInstance, instanceCount int)

func (*VertexArrayObject) DrawPart

func (vao *VertexArrayObject) DrawPart(offset, length int)

func (*VertexArrayObject) DrawPartInstanced

func (vao *VertexArrayObject) DrawPartInstanced(offset, length, baseInstance, instanceCount int)

func (*VertexArrayObject) GetVBO

func (vao *VertexArrayObject) GetVBO(name string) StreamingBuffer

func (*VertexArrayObject) GetVBOFormat

func (vao *VertexArrayObject) GetVBOFormat(name string) attribute.Format

func (*VertexArrayObject) MapVBO

func (vao *VertexArrayObject) MapVBO(name string, size int) MemoryChunk

func (*VertexArrayObject) Resize

func (vao *VertexArrayObject) Resize(name string, maxVertices int)

func (*VertexArrayObject) SetData

func (vao *VertexArrayObject) SetData(name string, offset int, data []float32)

func (*VertexArrayObject) Unbind

func (vao *VertexArrayObject) Unbind()

func (*VertexArrayObject) UnmapVBO

func (vao *VertexArrayObject) UnmapVBO(name string, offset int, size int)

type VertexBufferObject

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

func NewVertexBufferObject

func NewVertexBufferObject(maxFloats int, mapped bool, mode DrawMode) *VertexBufferObject

func (*VertexBufferObject) Bind

func (vbo *VertexBufferObject) Bind()

func (*VertexBufferObject) Capacity

func (vbo *VertexBufferObject) Capacity() int

func (*VertexBufferObject) Dispose

func (vbo *VertexBufferObject) Dispose()

func (*VertexBufferObject) GetID

func (vbo *VertexBufferObject) GetID() uint32

func (*VertexBufferObject) Map

func (vbo *VertexBufferObject) Map(size int) MemoryChunk

func (*VertexBufferObject) Resize

func (vbo *VertexBufferObject) Resize(newCapacity int)

func (*VertexBufferObject) SetData

func (vbo *VertexBufferObject) SetData(offset int, data []float32)

func (*VertexBufferObject) Unbind

func (vbo *VertexBufferObject) Unbind()

func (*VertexBufferObject) Unmap

func (vbo *VertexBufferObject) Unmap(offset, size int)

Jump to

Keyboard shortcuts

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