Documentation ¶
Index ¶
- Constants
- Variables
- type Atlas
- func (atlas *Atlas) BindTexture()
- func (atlas *Atlas) Destroy()
- func (atlas *Atlas) FontKit() *fontkit.FontKit
- func (atlas *Atlas) FontSize() float64
- func (atlas *Atlas) GetCharPos(char rune, bold, italic, underline, strikethrough bool, ...) common.Rectangle[int]
- func (atlas *Atlas) ImageSize() common.Vector2[int]
- func (atlas *Atlas) Normalize(pos common.Rectangle[int]) common.Rectangle[float32]
- func (atlas *Atlas) Reset()
- func (atlas *Atlas) SetBoxDrawing(useBoxDrawing, useBlockDrawing bool)
- func (atlas *Atlas) SetFontKit(kit *fontkit.FontKit)
- func (atlas *Atlas) SetFontSize(fontSize, dpi float64)
- func (atlas *Atlas) String() string
- func (atlas *Atlas) Undercurl(imgSize common.Vector2[int]) (common.Rectangle[int], bool)
- type Context
- func (context *Context) ClearScreen(c common.Color)
- func (context *Context) CreateTexture(width, height int) Texture
- func (context *Context) CreateVertexBuffer(size int) *VertexBuffer
- func (context *Context) Destroy()
- func (context *Context) Flush()
- func (context *Context) Info() ContextInfo
- func (context *Context) NewAtlas(kit *fontkit.FontKit, size, dpi float64, useBoxDrawing, useBlockDrawing bool) *Atlas
- func (context *Context) SetViewport(rect common.Rectangle[int])
- type ContextInfo
- type Shader
- type ShaderProgram
- type ShaderType
- type Texture
- func (texture *Texture) Bind()
- func (texture *Texture) Clear()
- func (texture *Texture) Delete()
- func (texture *Texture) Draw(image *image.RGBA, dest common.Rectangle[int])
- func (texture *Texture) Normalize(pos common.Rectangle[int]) common.Rectangle[float32]
- func (texture *Texture) Resize(width, height int)
- func (texture *Texture) Size() common.Vector2[int]
- func (texture Texture) String() string
- type Vertex
- type VertexBuffer
- func (buffer *VertexBuffer) Bind()
- func (buffer *VertexBuffer) CopyButPos(dst, src int)
- func (buffer *VertexBuffer) Destroy()
- func (buffer *VertexBuffer) Render()
- func (buffer *VertexBuffer) Resize(size int)
- func (buffer *VertexBuffer) SetIndexBg(index int, bg common.Color)
- func (buffer *VertexBuffer) SetIndexFg(index int, fg common.Color)
- func (buffer *VertexBuffer) SetIndexPos(index int, pos common.Rectangle[float32])
- func (buffer *VertexBuffer) SetIndexSp(index int, sp common.Color)
- func (buffer *VertexBuffer) SetIndexTex1(index int, tex1 common.Rectangle[float32])
- func (buffer *VertexBuffer) SetIndexTex2(index int, tex2 common.Rectangle[float32])
- func (buffer *VertexBuffer) SetProjection(rect common.Rectangle[float32])
- func (buffer *VertexBuffer) SetUndercurlRect(rect common.Rectangle[float32])
- func (buffer *VertexBuffer) String() string
- func (buffer *VertexBuffer) Update()
- func (buffer *VertexBuffer) VertexAt(index int) Vertex
Constants ¶
View Source
const ( UNSUPPORTED_GLYPH_ID = 0xffffffffffffffff // "Unsupported" UNDERCURL_GLYPH_ID = 0xfffffffffffffffe // "Undercurl" )
Variables ¶
View Source
var ( //go:embed shaders/grid.vert ShaderSourceGridVert string //go:embed shaders/grid.geom ShaderSourceGridGeom string //go:embed shaders/grid.frag ShaderSourceGridFrag string )
Embedded shader sources
Functions ¶
This section is empty.
Types ¶
type Atlas ¶
type Atlas struct {
// contains filtered or unexported fields
}
func (*Atlas) BindTexture ¶
func (atlas *Atlas) BindTexture()
func (*Atlas) GetCharPos ¶
func (*Atlas) SetBoxDrawing ¶
func (*Atlas) SetFontKit ¶
func (*Atlas) SetFontSize ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) ClearScreen ¶
func (*Context) CreateTexture ¶
func (*Context) CreateVertexBuffer ¶
func (context *Context) CreateVertexBuffer(size int) *VertexBuffer
func (*Context) Info ¶
func (context *Context) Info() ContextInfo
type ContextInfo ¶
type Shader ¶ added in v0.2.5
type Shader struct { ID uint32 Type ShaderType }
func NewShaderFromSource ¶ added in v0.2.5
func NewShaderFromSource(shader_type ShaderType, source string) *Shader
type ShaderProgram ¶
type ShaderProgram struct { ID uint32 // contains filtered or unexported fields }
func NewShaderProgram ¶ added in v0.2.5
func NewShaderProgram(vert *Shader, geom *Shader, frag *Shader) *ShaderProgram
All shaders can be safely destroyed after program creation
func (ShaderProgram) Destroy ¶
func (program ShaderProgram) Destroy()
func (ShaderProgram) UniformLocation ¶
func (program ShaderProgram) UniformLocation(name string) int32
func (ShaderProgram) Use ¶
func (program ShaderProgram) Use()
type ShaderType ¶ added in v0.2.5
type ShaderType uint32
const ( VERTEX_SHADER ShaderType = gl.VERTEX_SHADER GEOMETRY_SHADER ShaderType = gl.GEOMETRY_SHADER FRAGMENT_SHADER ShaderType = gl.FRAGMENT_SHADER )
func (ShaderType) String ¶ added in v0.2.5
func (st ShaderType) String() string
type Texture ¶
type Texture struct {
// contains filtered or unexported fields
}
type Vertex ¶
type Vertex struct { // position of this vertex Pos common.Rectangle[float32] // layout 0 // texture position Tex1 common.Rectangle[float32] // layout 1 // second texture position used for multiwidth characters Tex2 common.Rectangle[float32] // layout 2 // foreground color Fg common.Color // layout 3 // background color Bg common.Color // layout 4 // special color Sp common.Color // layout 5 }
type VertexBuffer ¶
type VertexBuffer struct {
// contains filtered or unexported fields
}
func (*VertexBuffer) Bind ¶
func (buffer *VertexBuffer) Bind()
func (*VertexBuffer) CopyButPos ¶
func (buffer *VertexBuffer) CopyButPos(dst, src int)
func (*VertexBuffer) Destroy ¶
func (buffer *VertexBuffer) Destroy()
func (*VertexBuffer) Render ¶
func (buffer *VertexBuffer) Render()
Caller responsible to bind buffer Caller responsible to Flush
func (*VertexBuffer) Resize ¶
func (buffer *VertexBuffer) Resize(size int)
Resize should clear the buffer
func (*VertexBuffer) SetIndexBg ¶
func (buffer *VertexBuffer) SetIndexBg(index int, bg common.Color)
func (*VertexBuffer) SetIndexFg ¶
func (buffer *VertexBuffer) SetIndexFg(index int, fg common.Color)
func (*VertexBuffer) SetIndexPos ¶
func (buffer *VertexBuffer) SetIndexPos(index int, pos common.Rectangle[float32])
func (*VertexBuffer) SetIndexSp ¶
func (buffer *VertexBuffer) SetIndexSp(index int, sp common.Color)
func (*VertexBuffer) SetIndexTex1 ¶
func (buffer *VertexBuffer) SetIndexTex1(index int, tex1 common.Rectangle[float32])
func (*VertexBuffer) SetIndexTex2 ¶
func (buffer *VertexBuffer) SetIndexTex2(index int, tex2 common.Rectangle[float32])
func (*VertexBuffer) SetProjection ¶
func (buffer *VertexBuffer) SetProjection(rect common.Rectangle[float32])
func (*VertexBuffer) SetUndercurlRect ¶
func (buffer *VertexBuffer) SetUndercurlRect(rect common.Rectangle[float32])
func (*VertexBuffer) String ¶
func (buffer *VertexBuffer) String() string
func (*VertexBuffer) Update ¶
func (buffer *VertexBuffer) Update()
Updates current buffer to GPU Caller responsible to bind buffer
func (*VertexBuffer) VertexAt ¶
func (buffer *VertexBuffer) VertexAt(index int) Vertex
Click to show internal directories.
Click to hide internal directories.