opengl

package
v0.0.0-...-73aabcd Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: BSD-3-Clause Imports: 20 Imported by: 1

Documentation

Overview

Package opengl implements the core.RenderSystem interface by wrapping the OpenGL API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Framebuffer

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

Framebuffer implements the core.Framebuffer interface

func (*Framebuffer) ColorAttachment

func (f *Framebuffer) ColorAttachment(index int) core.Texture

ColorAttachment implements the core.RenderTarger interface

func (*Framebuffer) ColorAttachments

func (f *Framebuffer) ColorAttachments() map[int]core.Texture

ColorAttachments implements the core.RenderTarger interface

func (*Framebuffer) DepthAttachment

func (f *Framebuffer) DepthAttachment() core.Texture

DepthAttachment implements the core.RenderTarger interface

func (*Framebuffer) SetColorAttachment

func (f *Framebuffer) SetColorAttachment(index int, attachment core.Texture)

SetColorAttachment implements the core.RenderTarger interface

func (*Framebuffer) SetDepthAttachment

func (f *Framebuffer) SetDepthAttachment(attachment core.Texture)

SetDepthAttachment implements the core.RenderTarger interface

type IMGUIMesh

type IMGUIMesh struct {
	*Mesh
}

IMGUIMesh implements the core.IMGUIMesh interface

type Mesh

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

Mesh implements the core.Mesh interface

func (*Mesh) Bounds

func (m *Mesh) Bounds() *core.AABB

Bounds implements the core.Mesh interface

func (*Mesh) Draw

func (m *Mesh) Draw()

Draw implements the core.Mesh interface

func (*Mesh) DrawInstanced

func (m *Mesh) DrawInstanced(instanceCount int, instanceData unsafe.Pointer)

DrawInstanced implements the core.Mesh interface

func (*Mesh) Gt

func (m *Mesh) Gt(other core.Mesh) bool

Gt implements the core.Mesh interface

func (*Mesh) Lt

func (m *Mesh) Lt(other core.Mesh) bool

Lt implements the core.Mesh interface

func (*Mesh) Name

func (m *Mesh) Name() string

Name implements the core.Mesh interface

func (*Mesh) SetIndices

func (m *Mesh) SetIndices(indices []uint16)

SetIndices implements the core.Mesh interface

func (*Mesh) SetName

func (m *Mesh) SetName(name string)

SetName implements the core.Mesh interface

func (*Mesh) SetNormals

func (m *Mesh) SetNormals(normals []float32)

SetNormals implements the core.Mesh interface

func (*Mesh) SetPositions

func (m *Mesh) SetPositions(positions []float32)

SetPositions implements the core.Mesh interface

func (*Mesh) SetPrimitiveType

func (m *Mesh) SetPrimitiveType(t core.PrimitiveType)

SetPrimitiveType implements the core.Mesh interface

func (*Mesh) SetTextureCoordinates

func (m *Mesh) SetTextureCoordinates(texcoords []float32)

SetTextureCoordinates implements the core.Mesh interface

type Program

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

Program is an OpenGL program

func (*Program) Name

func (p *Program) Name() string

Name implements the core.Program interface

type RenderSystem

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

RenderSystem implements the core.RenderSystem interface

func New

func New() *RenderSystem

New returns a new RenderSystem

func (*RenderSystem) CanBatch

func (r *RenderSystem) CanBatch(a *core.Descriptors, b *core.Descriptors) bool

CanBatch determines whether or not two states can be batched

func (*RenderSystem) Dispatch

func (r *RenderSystem) Dispatch(cmd core.RenderCommand)

Dispatch implements the core.RenderSystem interface

func (*RenderSystem) NewFramebuffer

func (r *RenderSystem) NewFramebuffer() core.Framebuffer

NewFramebuffer implements the core.RenderSystem interface

func (*RenderSystem) NewMesh

func (r *RenderSystem) NewMesh() core.Mesh

NewMesh implements the core.RenderSystem interface

func (*RenderSystem) NewProgram

func (r *RenderSystem) NewProgram(name string, data []byte) core.Program

NewProgram implements the core.RenderSystem interface.

func (*RenderSystem) NewTexture

func (rs *RenderSystem) NewTexture(d core.TextureDescriptor, data []byte) core.Texture

NewTexture implements the core.RenderSystem interface

func (*RenderSystem) NewTextureFromImageData

func (rs *RenderSystem) NewTextureFromImageData(data []byte, descriptor core.TextureDescriptor) core.Texture

NewTextureFromImageData implements the core.RenderSystem interface

func (*RenderSystem) NewUniform

func (r *RenderSystem) NewUniform() core.Uniform

NewUniform implements the core.RenderSystem interface

func (*RenderSystem) NewUniformBuffer

func (r *RenderSystem) NewUniformBuffer() core.UniformBuffer

NewUniformBuffer implements the core.RenderSystem interface

func (*RenderSystem) PostMakeWindow

func (r *RenderSystem) PostMakeWindow(cfg core.WindowConfig, w *glfw.Window)

PostMakeWindow implements the core.RenderSystem interface by queueing this call so that it gets executed inside the locked thread.

func (*RenderSystem) PreMakeWindow

func (r *RenderSystem) PreMakeWindow()

PreMakeWindow is called before the actual glfw window creation to allow the rendersystem to provide its hints (API, versions, etc)

func (*RenderSystem) ProgramExtension

func (r *RenderSystem) ProgramExtension() string

ProgramExtension implements the core.RenderSystem interface.

func (*RenderSystem) RenderLog

func (r *RenderSystem) RenderLog() string

RenderLog implements the core.RenderSystem interface

type Texture

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

Texture is an OpenGL texture container

func (*Texture) Descriptor

func (t *Texture) Descriptor() core.TextureDescriptor

Descriptor returns the descriptor used to create this texture. Note that overriding filter and wrapMode will _not_ change the original descriptor used.

func (*Texture) Gt

func (t *Texture) Gt(other core.Texture) bool

Gt implements the core.Texture interface

func (*Texture) Handle

func (t *Texture) Handle() unsafe.Pointer

Handle implements the core.Texture interface

func (*Texture) Lt

func (t *Texture) Lt(other core.Texture) bool

Lt implements the core.Texture interface

func (*Texture) SetFilter

func (t *Texture) SetFilter(f core.TextureFilter)

SetFilter sets this texture filtering mode

func (*Texture) SetWrapMode

func (t *Texture) SetWrapMode(wm core.TextureWrapMode)

SetWrapMode sets this texture's wrap mode

type Uniform

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

Uniform implements the core.Uniform interface

func (*Uniform) Copy

func (u *Uniform) Copy() core.Uniform

Copy returns a copy of the uniform.

func (*Uniform) Set

func (u *Uniform) Set(value interface{})

Set implements the core.Uniform interface

func (*Uniform) Value

func (u *Uniform) Value() interface{}

Value implements the core.Uniform interface

type UniformBuffer

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

UniformBuffer implements the core.UniformBuffer interface

func (*UniformBuffer) Gt

func (ub *UniformBuffer) Gt(other core.UniformBuffer) bool

Gt implements the core.UniformBuffer interface

func (*UniformBuffer) Lt

func (ub *UniformBuffer) Lt(other core.UniformBuffer) bool

Lt implements the core.UniformBuffer interface

func (*UniformBuffer) Set

func (ub *UniformBuffer) Set(data unsafe.Pointer, dataLen int)

Set implements the core.UniformBuffer interface

Jump to

Keyboard shortcuts

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