opengl

package
v0.0.0-...-e95280a Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2021 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alpha

type Alpha interface {
	Value() float32
	Variable() string
}

Alpha returns the alpha

type Camera

type Camera interface {
	ID() *uuid.UUID
	Index() uint
	Projection() CameraProjection
	LookAt() CameraLookAt
	Render(
		delta time.Duration,
		pos Position,
		orientation Orientation,
		activeScene Scene,
		program uint32,
	) error
}

Camera represents a camera

type CameraBuilder

type CameraBuilder interface {
	Create() CameraBuilder
	WithCamera(cam cameras.Camera) CameraBuilder
	Now() (Camera, error)
}

CameraBuilder represents the camera builder

type CameraLookAt

type CameraLookAt interface {
	Variable() string
	Eye() mgl32.Vec3
	Center() mgl32.Vec3
	Up() mgl32.Vec3
}

CameraLookAt represents the direction where the camera looks at

type CameraProjection

type CameraProjection interface {
	Variable() string
	FieldOfView() float32
	AspectRation() float32
	Near() float32
	Far() float32
}

CameraProjection represents the camera projection

type Geometry

type Geometry interface {
	ID() *uuid.UUID
	Program() uint32
	VAO() uint32
	VertexAmount() int32
	VertexType() VertexType
	Shader() VertexShader
	Prepare() error
	Render() error
}

Geometry represents a geometry

type GeometryBuilder

type GeometryBuilder interface {
	Create() GeometryBuilder
	WithProgram(prog uint32) GeometryBuilder
	WithGeometry(geo geometries.Geometry) GeometryBuilder
	Now() (Geometry, error)
}

GeometryBuilder represents a geometry builder

type Hud

type Hud interface {
	ID() *uuid.UUID
	Program() uint32
	HasNodes() bool
	Nodes() []HudNode
	HasMaterial() bool
	Material() Material
	Render(
		delta time.Duration,
		activeScene Scene,
	) error
}

Hud represents a head-up display

type HudBuilder

type HudBuilder interface {
	Create() HudBuilder
	WithHud(hud huds.Hud) HudBuilder
	Now() (Hud, error)
}

HudBuilder represents a hud builder

type HudDisplay

type HudDisplay interface {
	ID() *uuid.UUID
	Index() uint
	Viewport() viewports.Viewport
	Camera() Camera
	HasMaterial() bool
	Material() Material
}

HudDisplay represents a hud display

type HudDisplayBuilder

type HudDisplayBuilder interface {
	Create() HudDisplayBuilder
	WithDisplay(display displays.Display) HudDisplayBuilder
	Now() (HudDisplay, error)
}

HudDisplayBuilder represents a hud display builder

type HudNode

type HudNode interface {
	ID() *uuid.UUID
	Position() HudPosition
	Orientation() Orientation
	HasContent() bool
	Content() HudNodeContent
	HasChildren() bool
	Children() []HudNode
	Render(
		delta time.Duration,
		activeScene Scene,
	) error
}

HudNode represents a hud node

type HudNodeBuilder

type HudNodeBuilder interface {
	Create() HudNodeBuilder
	WithNode(node hud_nodes.Node) HudNodeBuilder
	Now() (HudNode, error)
}

HudNodeBuilder represents a hud node builder

type HudNodeContent

type HudNodeContent interface {
	IsModel() bool
	Model() Model
	IsDisplay() bool
	Display() HudDisplay
}

HudNodeContent represents the hud node content

type HudPosition

type HudPosition interface {
	Vector() mgl32.Vec2
	Variable() string
	Add(pos HudPosition) HudPosition
}

HudPosition represents a hud position

type Layer

type Layer interface {
	ID() *uuid.UUID
	Index() uint
	Alpha() Alpha
	Texture() Texture
	Render(
		delta time.Duration,
		pos Position,
		orientation Orientation,
		activeScene Scene,
		program uint32,
	) error
}

Layer represents a layer

type LayerBuilder

type LayerBuilder interface {
	Create() LayerBuilder
	WithLayer(layer layers.Layer) LayerBuilder
	Now() (Layer, error)
}

LayerBuilder represents a layer builder

type Material

type Material interface {
	ID() *uuid.UUID
	Alpha() Alpha
	Viewport() viewports.Viewport
	Layers() []Layer
	Render(
		delta time.Duration,
		pos Position,
		orientation Orientation,
		activeScene Scene,
		program uint32,
	) error
}

Material represents a material

type MaterialBuilder

type MaterialBuilder interface {
	Create() MaterialBuilder
	WithMaterial(mat materials.Material) MaterialBuilder
	Now() (Material, error)
}

MaterialBuilder represents a material builder

type Model

type Model interface {
	ID() *uuid.UUID
	Program() uint32
	Geometry() Geometry
	Material() Material
	Render(
		delta time.Duration,
		activeCamera WorldCamera,
		activeScene Scene,
	) error
}

Model represents a model

type ModelBuilder

type ModelBuilder interface {
	Create() ModelBuilder
	WithModel(model models.Model) ModelBuilder
	Now() (Model, error)
}

ModelBuilder represents a model builder

type Node

type Node interface {
	ID() *uuid.UUID
	Position() Position
	Orientation() Orientation
	HasContent() bool
	Content() NodeContent
	HasChildren() bool
	Children() []Node
	Render(
		delta time.Duration,
		activeCamera WorldCamera,
		activeScene Scene,
	) error
}

Node represents a node

type NodeBuilder

type NodeBuilder interface {
	Create() NodeBuilder
	WithNode(node nodes.Node) NodeBuilder
	Now() (Node, error)
}

NodeBuilder represents a node builder

type NodeContent

type NodeContent interface {
	IsModel() bool
	Model() Model
	IsCamera() bool
	Camera() Camera
}

NodeContent represents the node content

type Orientation

type Orientation interface {
	Angle() float32
	Direction() mgl32.Vec3
	Variable() string
	Add(orientation Orientation) Orientation
}

Orientation represents an orientation

type Position

type Position interface {
	Vector() mgl32.Vec3
	Variable() string
	Add(pos Position) Position
}

Position represents a 3d position

type ProgramBuilder

type ProgramBuilder interface {
	Create() ProgramBuilder
	WithTextureShader(texShader texture_shaders.Shader) ProgramBuilder
	WithVertexShader(verShader vertex_shaders.Shader) ProgramBuilder
	WithFragmentShader(fragShader fragment_shader.Shader) ProgramBuilder
	Now() (uint32, error)
}

ProgramBuilder represents a program builder

type Scene

type Scene interface {
	ID() *uuid.UUID
	Index() uint
	Hud() Hud
	Nodes() []Node
	Render(
		delta time.Duration,
		activeCameraID *uuid.UUID,
	) error
}

Scene represents a scene

type SceneBuilder

type SceneBuilder interface {
	Create() SceneBuilder
	WithScene(scene scenes.Scene) SceneBuilder
	Now() (Scene, error)
}

SceneBuilder represents a scene builder

type Texture

type Texture interface {
	ID() *uuid.UUID
	Dimension() ints.Vec2
	Variable() string
	IsResource() bool
	Resource() uint32
	IsCamera() bool
	Camera() Camera
	IsShader() bool
	Shader() TextureShader
	Render(
		delta time.Duration,
		pos Position,
		orientation Orientation,
		activeScene Scene,
		program uint32,
	) error
}

Texture represents a texture

type TextureBuilder

type TextureBuilder interface {
	Create() TextureBuilder
	WithTexture(tex textures.Texture) TextureBuilder
	Now() (Texture, error)
}

TextureBuilder represents a texture builder

type TextureShader

type TextureShader interface {
	ID() *uuid.UUID
	Program() uint32
	IsDynamic() bool
	Render(
		delta time.Duration,
		pos Position,
		orientation Orientation,
		program uint32,
	) error
}

TextureShader represents a texture shader

type VertexShader

type VertexShader interface {
	ID() *uuid.UUID
	Variables() VertexShaderVariables
}

VertexShader represents a vertex shader

type VertexShaderVariables

type VertexShaderVariables interface {
	TextureCoordinates() string
	VertexCoordinates() string
}

VertexShaderVariables represents vertex shader variables

type VertexType

type VertexType interface {
	IsTriangle() bool
}

VertexType represents vertex type

type World

type World interface {
	ID() *uuid.UUID
	WindowApplication() windows.Application
	Logic() WorldLogicFn
	CurrentSceneIndex() uint
	Scenes() []Scene
	Execute() error
}

World represents a world index

type WorldBuilder

type WorldBuilder interface {
	Create() WorldBuilder
	WithWindow(win domain_window.Window) WorldBuilder
	WithWorld(world worlds.World) WorldBuilder
	WithLogic(fn WorldLogicFn) WorldBuilder
	Now() (World, error)
}

WorldBuilder represents a world builder

type WorldCamera

type WorldCamera interface {
	Camera() Camera
	Position() Position
	Orientation() Orientation
	Update(pos Position, orientation Orientation) WorldCamera
	Slide(pos HudPosition, orientation Orientation) WorldCamera
}

WorldCamera represents a camera in a 3d world

type WorldCameraBuilder

type WorldCameraBuilder interface {
	Create() WorldCameraBuilder
	WithNode(node Node) WorldCameraBuilder
	Now() (WorldCamera, error)
}

WorldCameraBuilder represents a world camera builder

type WorldLogicFn

type WorldLogicFn func(world World) error

WorldLogicFn represents the world logic func

Jump to

Keyboard shortcuts

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