Documentation ¶
Overview ¶
Package gosgl is package gosgl
Index ¶
- Variables
- func Init()
- func ShaderFromFile(stype gl.GLenum, filename string) (shader glh.Shader)
- func Vector(p Point) mathgl.Vec2d
- type BezierCurve
- type Canvas
- type Config
- type GLPoint
- type GlColorConfig
- type GlDrawer
- type OpenGL
- type Paint
- type Path
- type PathSegment
- type Point
- type QuadraticCurve
- type QuadraticDrawConfig
- type Rectangle
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Black = color.RGBA{0, 0, 0, 255}
)
Functions ¶
Types ¶
type BezierCurve ¶
type BezierCurve struct {
// contains filtered or unexported fields
}
func NewBezierCurve ¶
func NewBezierCurve(p1, c1, c2, p2 Point) (bc *BezierCurve)
func (*BezierCurve) Draw ¶
func (c *BezierCurve) Draw(canv *Canvas)
func (*BezierCurve) Points ¶
func (c *BezierCurve) Points() (l []Point)
func (*BezierCurve) ToQuadratics ¶
func (c *BezierCurve) ToQuadratics() []QuadraticCurve
ToQuadratics approximates a cubic bezier curve with quadratics. Algorithm by Adrian Colomitchi at http://www.caffeineowl.com/graphics/2d/vectorial/cubic2quad01.html
type GlColorConfig ¶
type GlColorConfig struct {
// contains filtered or unexported fields
}
func (*GlColorConfig) Apply ¶
func (conf *GlColorConfig) Apply()
func (*GlColorConfig) Reset ¶
func (conf *GlColorConfig) Reset()
func (*GlColorConfig) SetColor ¶
func (conf *GlColorConfig) SetColor(color color.Color)
func (*GlColorConfig) SetProgram ¶
type GlDrawer ¶
type GlDrawer struct {
// contains filtered or unexported fields
}
GlDrawer represents an OpenGl program and shader, like an opengl draw mode
func NewGlDrawer ¶
type OpenGL ¶
type OpenGL struct { QuadraticDrawer *GlDrawer TriangleDrawer *GlDrawer FillDrawer *GlDrawer QuadraticDrawConfig *QuadraticDrawConfig GlColorConfig *GlColorConfig // contains filtered or unexported fields }
Describe opengl state object
func OpenGLInit ¶
func OpenGLInit() *OpenGL
type Path ¶
func (*Path) QuadraticTo ¶
type PathSegment ¶
type QuadraticCurve ¶
type QuadraticCurve struct {
// contains filtered or unexported fields
}
func NewQuadraticCurve ¶
func NewQuadraticCurve(p1, c, p2 Point) *QuadraticCurve
func (*QuadraticCurve) Draw ¶
func (c *QuadraticCurve) Draw(canv *Canvas)
func (*QuadraticCurve) Points ¶
func (c *QuadraticCurve) Points() []Point
func (*QuadraticCurve) SetPoints ¶
func (c *QuadraticCurve) SetPoints(pts [3]Point)
type QuadraticDrawConfig ¶
type QuadraticDrawConfig struct {
// contains filtered or unexported fields
}
func (*QuadraticDrawConfig) Apply ¶
func (conf *QuadraticDrawConfig) Apply()
func (*QuadraticDrawConfig) SetExcludeTransluFrags ¶
func (conf *QuadraticDrawConfig) SetExcludeTransluFrags(v bool)
func (*QuadraticDrawConfig) SetProgram ¶
Click to show internal directories.
Click to hide internal directories.