opengl

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VertexShader       ShaderType
	FragmentShader     ShaderType
	ArrayBuffer        BufferType
	ElementArrayBuffer BufferType
	DynamicDraw        BufferUsage
	StaticDraw         BufferUsage
	Triangles          Mode
	Lines              Mode
	Short              DataType
	Float              DataType
)

Functions

func Init added in v1.5.0

func Init(runOnMainThread func(func() error) error)

Types

type Buffer added in v1.5.0

type Buffer uint32

type BufferType

type BufferType int

type BufferUsage added in v1.5.0

type BufferUsage int

type CompositeMode added in v1.5.0

type CompositeMode int
const (
	CompositeModeSourceOver CompositeMode = iota // This value must be 0 (= initial value)
	CompositeModeClear
	CompositeModeCopy
	CompositeModeDestination
	CompositeModeDestinationOver
	CompositeModeSourceIn
	CompositeModeDestinationIn
	CompositeModeSourceOut
	CompositeModeDestinationOut
	CompositeModeSourceAtop
	CompositeModeDestinationAtop
	CompositeModeXor
	CompositeModeLighter
	CompositeModeUnknown
)

type Context

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

func GetContext added in v1.5.0

func GetContext() *Context

func (*Context) BindElementArrayBuffer added in v1.5.0

func (c *Context) BindElementArrayBuffer(b Buffer)

func (*Context) BindScreenFramebuffer added in v1.5.0

func (c *Context) BindScreenFramebuffer()

func (*Context) BindTexture

func (c *Context) BindTexture(t Texture)

func (*Context) BlendFunc added in v1.5.0

func (c *Context) BlendFunc(mode CompositeMode)

func (*Context) BufferSubData

func (c *Context) BufferSubData(bufferType BufferType, data []float32)

func (*Context) DeleteBuffer added in v1.5.0

func (c *Context) DeleteBuffer(b Buffer)

func (*Context) DeleteFramebuffer

func (c *Context) DeleteFramebuffer(f Framebuffer)

func (*Context) DeleteProgram added in v1.5.0

func (c *Context) DeleteProgram(p Program)

func (*Context) DeleteShader

func (c *Context) DeleteShader(s Shader)

func (*Context) DeleteTexture

func (c *Context) DeleteTexture(t Texture)

func (*Context) DisableVertexAttribArray

func (c *Context) DisableVertexAttribArray(p Program, location string)

func (*Context) DrawElements

func (c *Context) DrawElements(mode Mode, len int, offsetInBytes int)

func (*Context) EnableVertexAttribArray

func (c *Context) EnableVertexAttribArray(p Program, location string)

func (*Context) FillFramebuffer

func (c *Context) FillFramebuffer(r, g, b, a float32) error

func (*Context) Flush

func (c *Context) Flush()

func (*Context) FramebufferPixels

func (c *Context) FramebufferPixels(f Framebuffer, width, height int) ([]uint8, error)

func (*Context) IsTexture added in v1.5.0

func (c *Context) IsTexture(t Texture) bool

func (*Context) NewArrayBuffer added in v1.6.0

func (c *Context) NewArrayBuffer(size int) Buffer

func (*Context) NewElementArrayBuffer added in v1.6.0

func (c *Context) NewElementArrayBuffer(indices []uint16) Buffer

func (*Context) NewFramebuffer

func (c *Context) NewFramebuffer(texture Texture) (Framebuffer, error)

func (*Context) NewProgram

func (c *Context) NewProgram(shaders []Shader) (Program, error)

func (*Context) NewShader

func (c *Context) NewShader(shaderType ShaderType, source string) (Shader, error)

func (*Context) NewTexture

func (c *Context) NewTexture(width, height int, pixels []uint8) (Texture, error)

func (*Context) Reset added in v1.5.0

func (c *Context) Reset() error

func (*Context) ResetViewportSize added in v1.5.0

func (c *Context) ResetViewportSize()

func (*Context) ScreenFramebuffer added in v1.5.0

func (c *Context) ScreenFramebuffer() Framebuffer

func (*Context) SetViewport

func (c *Context) SetViewport(f Framebuffer, width, height int)

func (*Context) TexSubImage2D added in v1.5.0

func (c *Context) TexSubImage2D(p []uint8, width, height int)

func (*Context) UniformFloats

func (c *Context) UniformFloats(p Program, location string, v []float32)

func (*Context) UniformInt

func (c *Context) UniformInt(p Program, location string, v int)

func (*Context) UseProgram

func (c *Context) UseProgram(p Program)

func (*Context) VertexAttribPointer

func (c *Context) VertexAttribPointer(p Program, location string, size int, dataType DataType, stride int, offset int)

type DataType added in v1.5.0

type DataType int

func (DataType) SizeInBytes added in v1.5.0

func (d DataType) SizeInBytes() int

type Framebuffer

type Framebuffer uint32

type Mode added in v1.5.0

type Mode int

type Program

type Program uint32

type Shader

type Shader uint32

type ShaderType

type ShaderType int

type Texture

type Texture uint32

Jump to

Keyboard shortcuts

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