Documentation
¶
Index ¶
- Variables
- func CheckForGLError() bool
- func FramebufferSizeCallback(w *glfw.Window, width int, height int)
- func InitCamera(pos mgl32.Vec3, up mgl32.Vec3)
- func InitFontManager()
- func InitGraphicalManager() error
- func InitObjectManager()
- func InitShaderManager()
- func InitTextRenderer() error
- func InitTextureManager()
- func LoadFont(fontPath string) error
- func LoadModel(dir, file string) error
- func MouseCallback(window *glfw.Window, xposi float64, yposi float64)
- func NewAtlas(path string) error
- func ScrollWheelCallback(window *glfw.Window, xOffset float64, yoffset float64)
- type CameraDirection
- type CameraT
- type Character
- type CharactersT
- type Color
- type FontManager
- type GlfwContext
- type GraphicalmanagerT
- type IRenderable
- type LoadedTexture
- type ObjectManagerT
- type Renderable
- type RenderableOptions
- type TextRendererT
- type Texture
- type TextureManager_t
- type Transform
- type Triangle
- type Vertex
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SQUAREVertices = []float32{ -1, -1, 0, 0, 1, 1, -1, 0, 1, 1, -1, 1, 0, 0, 0, 1, 1, 0, 1, 0, } SQUAREIndices = []uint32{ 0, 1, 2, 1, 2, 3, } CUBEVertices = []float32{}/* 180 elements not displayed */ PYRAMIDVertices = []float32{ -1, -1, -1, 1, 1, 1, -1, -1, 0, 1, 0, 1, 0, 0.5, 0, -1, -1, -1, 0, 1, -1, -1, 1, 1, 1, 0, 1, 0, 0.5, 0, 1, -1, -1, 1, 1, 1, -1, 1, 0.5, 1, 0, 1, 0, 0.5, 0, -1, -1, 1, 0, 1, 1, -1, 1, 1, 1, 0, 1, 0, 0.5, 0, -1, -1, -1, 0, 0, -1, -1, 1, 0, 1, 1, -1, -1, 1, 0, -1, -1, 1, 0, 1, 1, -1, -1, 1, 0, 1, -1, 1, 1, 1, } )
View Source
var ShaderManager t_ShaderManager
Functions ¶
func CheckForGLError ¶
func CheckForGLError() bool
func FramebufferSizeCallback ¶
FramebufferSizeCallback Called when resizing window
func InitFontManager ¶
func InitFontManager()
func InitGraphicalManager ¶
func InitGraphicalManager() error
func InitObjectManager ¶
func InitObjectManager()
func InitShaderManager ¶
func InitShaderManager()
func InitTextRenderer ¶
func InitTextRenderer() error
func InitTextureManager ¶
func InitTextureManager()
Types ¶
type CameraDirection ¶
type CameraDirection int
const ( CameraForward CameraDirection = iota CameraBackward CameraLeft CameraRight CameraUp CameraDown )
type CameraT ¶
type CameraT struct {
Pos mgl32.Vec3
Front mgl32.Vec3
Up mgl32.Vec3
Right mgl32.Vec3
WorldUp mgl32.Vec3
MoveSpeed float32
Yaw float32
Pitch float32
Zoom float32
ProjectionMatrix mgl32.Mat4
ViewMatrix mgl32.Mat4
// contains filtered or unexported fields
}
var Camera CameraT
func (*CameraT) MoveCamera ¶
func (c *CameraT) MoveCamera(direction CameraDirection, deltaTime float32)
func (*CameraT) UpdateScreen ¶
type CharactersT ¶
type FontManager ¶
type FontManager struct {
Characters map[string]CharactersT
// contains filtered or unexported fields
}
var FontMgr FontManager
type GlfwContext ¶
type GlfwContext struct {
Window *glfw.Window
Programs []uint32
Vao []uint32
// contains filtered or unexported fields
}
func (*GlfwContext) Destroy ¶
func (g *GlfwContext) Destroy()
func (*GlfwContext) Init ¶
func (g *GlfwContext) Init() error
type GraphicalmanagerT ¶
type GraphicalmanagerT struct {
*GlfwContext
// contains filtered or unexported fields
}
var GraphicalManager *GraphicalmanagerT
func (*GraphicalmanagerT) AddObjectRenderer ¶
func (ctx *GraphicalmanagerT) AddObjectRenderer(object IRenderable)
func (*GraphicalmanagerT) DrawBackground ¶
func (ctx *GraphicalmanagerT) DrawBackground()
func (*GraphicalmanagerT) RemoveObjectRenderer ¶
func (ctx *GraphicalmanagerT) RemoveObjectRenderer(object IRenderable)
type IRenderable ¶
type IRenderable interface {
Draw() error
}
type LoadedTexture ¶
type LoadedTexture struct {
Texture
// contains filtered or unexported fields
}
func (*LoadedTexture) LoadImg ¶
func (l *LoadedTexture) LoadImg() error
func (*LoadedTexture) UnloadImg ¶
func (l *LoadedTexture) UnloadImg()
type ObjectManagerT ¶
type ObjectManagerT struct {
Objects []*Renderable
}
var ObjectManager ObjectManagerT
func (*ObjectManagerT) PushObject ¶
func (o *ObjectManagerT) PushObject(object *Renderable)
type Renderable ¶
type Renderable struct {
Transform
// contains filtered or unexported fields
}
func NewCube ¶
func NewCube(transform Transform, texturePath string) *Renderable
func NewPyramid ¶
func NewPyramid(transform Transform, texturePath string) *Renderable
func NewRenderable ¶
func NewRenderable(options RenderableOptions) Renderable
func (*Renderable) Draw ¶
func (r *Renderable) Draw() error
func (*Renderable) Render ¶
func (r *Renderable) Render(shouldRender bool)
type RenderableOptions ¶
type TextureManager_t ¶
type TextureManager_t struct {
// contains filtered or unexported fields
}
var TextureManager *TextureManager_t
func (*TextureManager_t) GetTexture ¶
func (t *TextureManager_t) GetTexture(path string) (*LoadedTexture, error)
func (*TextureManager_t) UnloadTexture ¶
func (t *TextureManager_t) UnloadTexture(img *image.Image)
func (*TextureManager_t) UnloadTextureByPath ¶
func (t *TextureManager_t) UnloadTextureByPath(imgPath string)
type Transform ¶
func NewTransform ¶
Click to show internal directories.
Click to hide internal directories.