gui

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2019 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Max added in v0.8.0

func Max(x, y int) int

func Min added in v0.8.0

func Min(x, y int) int

func UpdateNSGLContext added in v0.7.10

func UpdateNSGLContext(window *glfw.Window)

Types

type FontMap

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

func NewFontMap

func NewFontMap(defaultFont *glfont.Font, defaultBoldFont *glfont.Font) *FontMap

func (*FontMap) AssignFonts added in v0.8.6

func (fm *FontMap) AssignFonts(defaultFont *glfont.Font, defaultBoldFont *glfont.Font)

func (*FontMap) BoldFont added in v0.7.7

func (fm *FontMap) BoldFont() *glfont.Font

func (*FontMap) DefaultFont added in v0.7.7

func (fm *FontMap) DefaultFont() *glfont.Font

func (*FontMap) Free added in v0.8.6

func (fm *FontMap) Free()

func (*FontMap) UpdateResolution

func (fm *FontMap) UpdateResolution(w int, h int)

type GUI

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

func New

func New(config *config.Config, terminal *terminal.Terminal, logger *zap.SugaredLogger) (*GUI, error)

func (*GUI) Close

func (gui *GUI) Close()

func (*GUI) GetMonitor added in v0.8.0

func (g *GUI) GetMonitor() *glfw.Monitor

func (*GUI) Render

func (gui *GUI) Render() error

func (*GUI) Screenshot added in v0.8.8

func (gui *GUI) Screenshot(path string)

func (*GUI) SetDPIScale added in v0.9.0

func (g *GUI) SetDPIScale()

SetDPIScale sets the GUI DPI scale from user configuration (if set) or by calculating it from the monitor's configuration and size.

func (*GUI) SwapBuffers added in v0.7.10

func (gui *GUI) SwapBuffers()

type OpenGLRenderer

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

func NewOpenGLRenderer

func NewOpenGLRenderer(config *config.Config, fontMap *FontMap, areaX int, areaY int, areaWidth int, areaHeight int, colourAttr uint32, program uint32) *OpenGLRenderer

func (*OpenGLRenderer) CellHeight

func (r *OpenGLRenderer) CellHeight() float32

func (*OpenGLRenderer) CellWidth

func (r *OpenGLRenderer) CellWidth() float32

func (*OpenGLRenderer) DrawCellBg

func (r *OpenGLRenderer) DrawCellBg(cell buffer.Cell, col uint, row uint, colour *config.Colour, force bool)

func (*OpenGLRenderer) DrawCellImage

func (r *OpenGLRenderer) DrawCellImage(cell buffer.Cell, col uint, row uint)

func (*OpenGLRenderer) DrawCellText

func (r *OpenGLRenderer) DrawCellText(text string, col uint, row uint, alpha float32, colour [3]float32, bold bool)

func (*OpenGLRenderer) DrawCursor

func (r *OpenGLRenderer) DrawCursor(col uint, row uint, colour config.Colour)

func (*OpenGLRenderer) DrawUnderline added in v0.9.0

func (r *OpenGLRenderer) DrawUnderline(span int, col uint, row uint, colour [3]float32)

DrawUnderline draws a line under 'span' characters starting at (col, row)

func (*OpenGLRenderer) Free added in v0.8.6

func (r *OpenGLRenderer) Free()

This method ensures that all OpenGL resources are deleted correctly

func (*OpenGLRenderer) GetRectangleSize added in v0.8.8

func (r *OpenGLRenderer) GetRectangleSize(col uint, row uint) (float32, float32)

func (*OpenGLRenderer) GetTermSize

func (r *OpenGLRenderer) GetTermSize() (uint, uint)

func (*OpenGLRenderer) SetArea

func (r *OpenGLRenderer) SetArea(areaX int, areaY int, areaWidth int, areaHeight int)

type ResizeCache added in v0.8.8

type ResizeCache struct {
	Width  int
	Height int
	Cols   uint
	Rows   uint
}

Jump to

Keyboard shortcuts

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