Documentation ¶
Overview ¶
Package opengl implements the core.RenderSystem interface by wrapping the OpenGL API
Index ¶
- type Framebuffer
- func (f *Framebuffer) ColorAttachment(index int) core.Texture
- func (f *Framebuffer) ColorAttachments() map[int]core.Texture
- func (f *Framebuffer) DepthAttachment() core.Texture
- func (f *Framebuffer) SetColorAttachment(index int, attachment core.Texture)
- func (f *Framebuffer) SetDepthAttachment(attachment core.Texture)
- type IMGUIMesh
- type Mesh
- func (m *Mesh) Bounds() *core.AABB
- func (m *Mesh) Draw()
- func (m *Mesh) DrawInstanced(instanceCount int, instanceData unsafe.Pointer)
- func (m *Mesh) Gt(other core.Mesh) bool
- func (m *Mesh) Lt(other core.Mesh) bool
- func (m *Mesh) Name() string
- func (m *Mesh) SetIndices(indices []uint16)
- func (m *Mesh) SetName(name string)
- func (m *Mesh) SetNormals(normals []float32)
- func (m *Mesh) SetPositions(positions []float32)
- func (m *Mesh) SetPrimitiveType(t core.PrimitiveType)
- func (m *Mesh) SetTextureCoordinates(texcoords []float32)
- type Program
- type RenderSystem
- func (r *RenderSystem) CanBatch(a *core.Descriptors, b *core.Descriptors) bool
- func (r *RenderSystem) Dispatch(cmd core.RenderCommand)
- func (r *RenderSystem) NewFramebuffer() core.Framebuffer
- func (r *RenderSystem) NewMesh() core.Mesh
- func (r *RenderSystem) NewProgram(name string, data []byte) core.Program
- func (rs *RenderSystem) NewTexture(d core.TextureDescriptor, data []byte) core.Texture
- func (rs *RenderSystem) NewTextureFromImageData(data []byte, descriptor core.TextureDescriptor) core.Texture
- func (r *RenderSystem) NewUniform() core.Uniform
- func (r *RenderSystem) NewUniformBuffer() core.UniformBuffer
- func (r *RenderSystem) PostMakeWindow(cfg core.WindowConfig, w *glfw.Window)
- func (r *RenderSystem) PreMakeWindow()
- func (r *RenderSystem) ProgramExtension() string
- func (r *RenderSystem) RenderLog() string
- type Texture
- type Uniform
- type UniformBuffer
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 Mesh ¶
type Mesh struct {
// contains filtered or unexported fields
}
Mesh implements the core.Mesh interface
func (*Mesh) DrawInstanced ¶
DrawInstanced implements the core.Mesh interface
func (*Mesh) SetIndices ¶
SetIndices implements the core.Mesh interface
func (*Mesh) SetNormals ¶
SetNormals implements the core.Mesh interface
func (*Mesh) SetPositions ¶
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 ¶
SetTextureCoordinates implements the core.Mesh interface
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
Program is an OpenGL program
type RenderSystem ¶
type RenderSystem struct {
// contains filtered or unexported fields
}
RenderSystem implements the core.RenderSystem interface
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) 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
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