gli

package
v0.0.0-...-f4ac04f Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2017 License: MIT Imports: 11 Imported by: 33

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixImage

func FixImage(img image.Image) *image.RGBA

func IsShaderVersionSupported

func IsShaderVersionSupported(requested string) bool

func LoadImage

func LoadImage(file string) (*image.RGBA, error)

func ShaderVersion

func ShaderVersion() string

func Version

func Version() string

func Viewport

func Viewport(v image.Rectangle)

Types

type Attrib

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

func (Attrib) Location

func (attrib Attrib) Location() uint32

func (Attrib) Name

func (attrib Attrib) Name() string

func (Attrib) Valid

func (attrib Attrib) Valid() bool

type Buffer

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

func NewBuffer

func NewBuffer(idata interface{}, opts ...BufferOption) (*Buffer, error)

func (*Buffer) Delete

func (buffer *Buffer) Delete()

func (*Buffer) Id

func (buffer *Buffer) Id() uint32

func (*Buffer) Len

func (buffer *Buffer) Len() int

func (*Buffer) Update

func (buffer *Buffer) Update(offset int, idata interface{})

func (*Buffer) Upload

func (buffer *Buffer) Upload(idata interface{})

func (*Buffer) Use

func (buffer *Buffer) Use()

type BufferAccessFrequencyEnum

type BufferAccessFrequencyEnum int
const (
	STATIC BufferAccessFrequencyEnum = iota
	STREAM
	DYNAMIC
)

type BufferAccessNatureEnum

type BufferAccessNatureEnum int
const (
	DRAW BufferAccessNatureEnum = iota * 8
	READ
	COPY
)

type BufferOption

type BufferOption func(opt *bufferOption)

func BufferAccessFrequency

func BufferAccessFrequency(e BufferAccessFrequencyEnum) BufferOption

func BufferAccessNature

func BufferAccessNature(e BufferAccessNatureEnum) BufferOption

func BufferElementArray

func BufferElementArray() BufferOption

type Clear

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

func NewClear

func NewClear(opts ...ClearOption) (*Clear, error)

func (*Clear) Clear

func (clear *Clear) Clear()

type ClearOption

type ClearOption func(*clearOption)

func ClearColor

func ClearColor(r, g, b, a float32) ClearOption

func ClearDepth

func ClearDepth() ClearOption

func ClearStencil

func ClearStencil() ClearOption

type Draw

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

func NewDraw

func NewDraw(mode DrawMode, program *Program, vao *VAO, opts ...DrawOption) (*Draw, error)

func (*Draw) Draw

func (draw *Draw) Draw(offset, count int)

type DrawMode

type DrawMode uint32
const (
	POINTS         DrawMode = gl.POINTS
	LINE_STRIP     DrawMode = gl.LINE_STRIP
	LINE_LOOP      DrawMode = gl.LINE_LOOP
	LINES          DrawMode = gl.LINES
	TRIANGLE_STRIP DrawMode = gl.TRIANGLE_STRIP
	TRIANGLE_FAN   DrawMode = gl.TRIANGLE_FAN
	TRIANGLES      DrawMode = gl.TRIANGLES
	PATCHES        DrawMode = gl.PATCHES
)

type DrawOption

type DrawOption func(*drawOption)

func DrawIndex

func DrawIndex(index *Buffer) DrawOption

func DrawTexture

func DrawTexture(texture *Texture, unit int) DrawOption

type Extensions

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

func GetExtensions

func GetExtensions() *Extensions

func (*Extensions) GL_ARB_geometry_shader4

func (extensions *Extensions) GL_ARB_geometry_shader4() bool

func (*Extensions) Has

func (extensions *Extensions) Has(ext string) bool

type GeometryInputType

type GeometryInputType uint32
const (
	GEOM_IN_POINTS              GeometryInputType = gl.POINTS
	GEOM_IN_LINES               GeometryInputType = gl.LINES
	GEOM_IN_LINES_ADJACENCY     GeometryInputType = gl.LINES_ADJACENCY_ARB
	GEOM_IN_TRIANGLES           GeometryInputType = gl.TRIANGLES
	GEOM_IN_TRIANGLES_ADJACENCY GeometryInputType = gl.TRIANGLES_ADJACENCY_ARB
)

type GeometryOutputType

type GeometryOutputType uint32
const (
	GEOM_OUT_POINTS         GeometryOutputType = gl.POINTS
	GEOM_OUT_LINE_STRIP     GeometryOutputType = gl.LINE_STRIP
	GEOM_OUT_TRIANGLE_STRIP GeometryOutputType = gl.TRIANGLE_STRIP
)

type Program

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

func NewProgram

func NewProgram(vertexSource, fragmentSource string, opts ...ProgramOption) (_ *Program, rerr error)

func (*Program) Attrib

func (program *Program) Attrib(attrname string) Attrib

func (*Program) Delete

func (program *Program) Delete()

func (*Program) Id

func (program *Program) Id() uint32

func (*Program) Uniform

func (program *Program) Uniform(uniformname string) Uniform

func (*Program) Use

func (program *Program) Use()

type ProgramOption

type ProgramOption func(opt *programOption)

func ProgramArbGeometryShader4

func ProgramArbGeometryShader4(source string, inType GeometryInputType, outType GeometryOutputType, numOutputVertices int) ProgramOption

type Texture

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

func NewTexture

func NewTexture(img *image.RGBA, opts ...TextureOption) (*Texture, error)

func (*Texture) Delete

func (texture *Texture) Delete()

func (*Texture) Id

func (texture *Texture) Id() uint32

func (*Texture) Size

func (texture *Texture) Size() image.Point

func (*Texture) Use

func (texture *Texture) Use(unit int)

type TextureFilterEnum

type TextureFilterEnum uint32
const (
	NEAREST TextureFilterEnum = gl.NEAREST
	LINEAR  TextureFilterEnum = gl.LINEAR
)

type TextureOption

type TextureOption func(opt *textureOption)

func TextureFilter

func TextureFilter(min, mag TextureFilterEnum) TextureOption

func TextureWrap

func TextureWrap(wrap_s, wrap_t TextureWrapEnum) TextureOption

type TextureWrapEnum

type TextureWrapEnum uint32
const (
	CLAMP_TO_EDGE   TextureWrapEnum = gl.CLAMP_TO_EDGE
	REPEAT          TextureWrapEnum = gl.REPEAT
	MIRRORED_REPEAT TextureWrapEnum = gl.MIRRORED_REPEAT
)

type Uniform

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

func (Uniform) Location

func (uniform Uniform) Location() int32

func (Uniform) Name

func (uniform Uniform) Name() string

func (Uniform) SetFloat

func (uniform Uniform) SetFloat(data ...float32)

func (Uniform) SetInt

func (uniform Uniform) SetInt(data ...int32)

func (Uniform) SetSampler

func (uniform Uniform) SetSampler(data ...int32)

func (Uniform) Valid

func (uniform Uniform) Valid() bool

type VAO

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

func NewVAO

func NewVAO() (*VAO, error)

func (*VAO) Delete

func (vao *VAO) Delete()

func (*VAO) Enable

func (vao *VAO) Enable(elements int, buffer *Buffer, attrib Attrib, opts ...VAOOption)

func (*VAO) Id

func (vao *VAO) Id() uint32

func (*VAO) Use

func (vao *VAO) Use()

type VAOOption

type VAOOption func(opt *vaoOption)

func VAONormalize

func VAONormalize() VAOOption

func VAOOffset

func VAOOffset(offset int) VAOOption

func VAOStride

func VAOStride(stride int) VAOOption

Jump to

Keyboard shortcuts

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