executor

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	One              = BlendFactor(gl.ONE)
	Zero             = BlendFactor(gl.ZERO)
	SrcAlpha         = BlendFactor(gl.SRC_ALPHA)
	DstAlpha         = BlendFactor(gl.DST_ALPHA)
	OneMinusSrcAlpha = BlendFactor(gl.ONE_MINUS_SRC_ALPHA)
	OneMinusDstAlpha = BlendFactor(gl.ONE_MINUS_DST_ALPHA)
)
View Source
const CallQueueCap = 16

Variables

This section is empty.

Functions

func BlendFunc

func BlendFunc(src, dst BlendFactor)

func Bounds

func Bounds(x, y, w, h int)

func Clear

func Clear(r, g, b, a float32)

func Init

func Init()

Types

type Attr

type Attr struct {
	Name string
	Type AttrType
}

type AttrFormat

type AttrFormat []Attr

func (AttrFormat) Size

func (af AttrFormat) Size() int

type AttrType

type AttrType int
const (
	Int AttrType = iota
	Float
	Vec2
	Vec3
	Vec4
	Mat2
	Mat23
	Mat24
	Mat3
	Mat32
	Mat34
	Mat4
	Mat42
	Mat43
)

func (AttrType) Size

func (at AttrType) Size() int

type BeginEnder

type BeginEnder interface {
	Begin()
	End()
}

type BlendFactor

type BlendFactor int

type Frame

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

func NewFrame

func NewFrame(width, height int, smooth bool) *Frame

func (*Frame) Begin

func (f *Frame) Begin()

func (*Frame) Blit

func (f *Frame) Blit(dst *Frame, sx0, sy0, sx1, sy1, dx0, dy0, dx1, dy1 int)

func (*Frame) End

func (f *Frame) End()

func (*Frame) ID

func (f *Frame) ID() uint32

func (*Frame) Texture

func (f *Frame) Texture() *Texture

type MainThread

type MainThread struct {
	// contains filtered or unexported fields
}
var Thread *MainThread

func NewMainThread

func NewMainThread() *MainThread

func (*MainThread) Call

func (m *MainThread) Call(f func())

func (*MainThread) CallErr

func (m *MainThread) CallErr(f func() error) error

func (*MainThread) CallVal

func (m *MainThread) CallVal(f func() interface{}) interface{}

func (*MainThread) Post

func (m *MainThread) Post(f func())

func (*MainThread) Run

func (m *MainThread) Run(run func())

type Shader

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

func NewShader

func NewShader(vertexFmt, uniformFmt AttrFormat, vertexShader, fragmentShader string) (*Shader, error)

func (*Shader) Begin

func (s *Shader) Begin()

func (*Shader) End

func (s *Shader) End()

func (*Shader) ID

func (s *Shader) ID() uint32

func (*Shader) SetUniformAttr

func (s *Shader) SetUniformAttr(uniform int, value interface{}) (bool, error)

func (*Shader) UniformFormat

func (s *Shader) UniformFormat() AttrFormat

func (*Shader) VertexFormat

func (s *Shader) VertexFormat() AttrFormat

type Texture

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

func NewTexture

func NewTexture(width, height int, smooth bool, pixels []uint8) *Texture

func (*Texture) Begin

func (t *Texture) Begin()

func (*Texture) End

func (t *Texture) End()

func (*Texture) Height

func (t *Texture) Height() int

func (*Texture) ID

func (t *Texture) ID() uint32

func (*Texture) Pixels

func (t *Texture) Pixels(x, y, w, h int) []uint8

func (*Texture) SetPixels

func (t *Texture) SetPixels(x, y, w, h int, pixels []uint8)

func (*Texture) SetSmooth

func (t *Texture) SetSmooth(smooth bool)

func (*Texture) Smooth

func (t *Texture) Smooth() bool

func (*Texture) Width

func (t *Texture) Width() int

type VertexSlice

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

func MakeVertexSlice

func MakeVertexSlice(shader *Shader, len, cap int) *VertexSlice

func (*VertexSlice) Begin

func (vs *VertexSlice) Begin()

func (*VertexSlice) Cap

func (vs *VertexSlice) Cap() int

func (*VertexSlice) Draw

func (vs *VertexSlice) Draw()

func (*VertexSlice) End

func (vs *VertexSlice) End()

func (*VertexSlice) Len

func (vs *VertexSlice) Len() int

func (*VertexSlice) SetLen

func (vs *VertexSlice) SetLen(len int)

func (*VertexSlice) SetVertexData

func (vs *VertexSlice) SetVertexData(data []float32)

func (*VertexSlice) Slice

func (vs *VertexSlice) Slice(i, j int) *VertexSlice

func (*VertexSlice) Stride

func (vs *VertexSlice) Stride() int

func (*VertexSlice) VertexData

func (vs *VertexSlice) VertexData() []float32

func (*VertexSlice) VertexFormat

func (vs *VertexSlice) VertexFormat() AttrFormat

Jump to

Keyboard shortcuts

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