gli

package
v0.0.0-...-eb6d389 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2016 License: MIT, MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(d Driver)

Types

type AttributeLocation

type AttributeLocation struct {
	Name     string
	Location uint32
}

type BaseType

type BaseType uint32
const (
	BaseTypeFloat BaseType = iota + 1
	BaseTypeInt
	BaseTypeUnsignedInt
	BaseTypeBool
)

func (BaseType) String

func (i BaseType) String() string

type BufferDef

type BufferDef struct {
	Name       string
	Usage      BufferUsage
	Attributes []ProgramResource
}

type BufferTarget

type BufferTarget uint32
const (
	BufferTargetArray BufferTarget = iota + 1
	BufferTargetCopyRead
	BufferTargetCopyWrite
	BufferTargetElementArray
	BufferTargetPixelPack
	BufferTargetPixelUnpack
	BufferTargetTexture
	BufferTargetTransformFeedback
	BufferTargetUniform
)

func (BufferTarget) String

func (i BufferTarget) String() string

type BufferUsage

type BufferUsage uint32
const (
	BufferUsageStreamDraw BufferUsage = iota + 1
	BufferUsageStreamRead
	BufferUsageStreamCopy
	BufferUsageStaticDraw
	BufferUsageStaticRead
	BufferUsageStaticCopy
	BufferUsageDynamicDraw
	BufferUsageDynamicRead
	BufferUsageDynamicCopy
)

func (BufferUsage) String

func (i BufferUsage) String() string

type Context

type Context struct{}

func New

func New() (*Context, error)

func (*Context) Driver

func (ctx *Context) Driver() Driver

type DataType

type DataType struct {
	Base    BaseType
	Sampler SamplerType
	Cols    byte
	Matrix  bool
	Size    uint
}

func (DataType) GoString

func (dt DataType) GoString() string

func (DataType) IsValid

func (dt DataType) IsValid() error

func (DataType) Location

func (dt DataType) Location() uint

type Driver

type Driver interface {
	Name() string
	Init() error
	ShaderCreate(typ ShaderType, sources ...string) (ShaderId, error)
	ShaderDelete(id ShaderId)
	ProgramCreate(locations []AttributeLocation, shaders ...ShaderId) (ProgramId, error)
	ProgramDelete(id ProgramId)
	ProgramAttributes(id ProgramId) ([]ProgramResource, error)
}

type ProgramCollection

type ProgramCollection interface {
	Program(name string) (ProgramDef, error)
}

type ProgramDef

type ProgramDef struct {
	Name      string
	Group     string
	Locations []AttributeLocation
	Buffers   []BufferDef
	Shaders   []ShaderDef
}

type ProgramId

type ProgramId uint32

type ProgramResource

type ProgramResource struct {
	Resource ResourceType
	Name     string
	Type     DataType
	Index    uint
}

func (ProgramResource) GoString

func (pr ProgramResource) GoString() string

type ResourceType

type ResourceType uint32
const (
	ResourceTypeUniform ResourceType = iota + 1
	ResourceTypeAttribute
)

func (ResourceType) String

func (i ResourceType) String() string

type SamplerType

type SamplerType uint32
const (
	SamplerType1d SamplerType = iota + 1
	SamplerType2d
	SamplerType3d
	SamplerTypeCude
	SamplerType2dRect
	SamplerType1dArray
	SamplerType2dArray
	SamplerTypeCubeArray
	SamplerTypeBuffer
	SamplerType2dMS
	SamplerType2dMSArray

	SamplerType1dShadow
	SamplerType2dShadow
	SamplerTypeCubeShadow
	SamplerType2dRectShadow
	SamplerType1dArrayShadow
	SamplerType2dArrayShadow
	SamplerTypeCubeArrayShadow
)

func (SamplerType) String

func (i SamplerType) String() string

type ShaderDef

type ShaderDef struct {
	Type   ShaderType
	Source []string
}

type ShaderId

type ShaderId uint32

type ShaderType

type ShaderType uint32
const (
	ShaderTypeVertex ShaderType = iota + 1
	ShaderTypeGeometry
	ShaderTypeFragment
)

func (ShaderType) String

func (i ShaderType) String() string

Jump to

Keyboard shortcuts

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