ggl

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package ggl defines essential abstraction over opengl types, you should use this and dodge gl calls to make you code cleaner. If struct has methdod Drop it has to be called in order to prevent memory leak. All main datatypes that has Drop method contain pointer to underlining gl object so droping one struct makes all copies dengling and using them can produce undefined behavior. All constructors starts with N folwed by name of a struct. If struct ha a constructor it has to be used or you will not get expected behavior. Other methods that are repetitive are Start() and End<StructName>(), this is for binding and unbinding objects. Because calling gl functions introduces 120 nanoseconds overhead so package uses global state to skip redundant start and end calls, using of global state si justified by the fact that YOU HAVE TO USE ALL STRUCTS INTERFACING OPENGL OBJECTS FROM THREAD WHERE YOU CREATED A WINDOW anyway.

Package also utilizes gogen code generator (github.com/jakubDoka/gogen)

Index

Constants

View Source
const (
	SpriteVertexSize  = 4
	SpriteIndicesSize = 6
	NinePatchSide     = 3
)

Sprite related constants

View Source
const Dynamic = gl.DYNAMIC_DRAW

Dynamic combines Static and stream

View Source
const Static = gl.STATIC_DRAW

Static is used when you want to draw once and reuse multiple times

View Source
const Stream = gl.STREAM_DRAW

Stream is used when you want to update a lot and use at most few times

Variables

DefaultTextureConfig use this if you don't know what to use

View Source
var SpriteIndices = Indices{0, 1, 2, 0, 3, 2}

SpriteIndices is slice of constant indices used by Sprite

Functions

func Clear

func Clear(c mat.RGBA, mode ClearMode)

Clear clears currently bound framebuffer with given mode

func EndCanvas

func EndCanvas()

EndCanvas unbinds current canvas

func EndProgram

func EndProgram()

EndProgram ...

func EndTexture

func EndTexture()

EndTexture ...

func EndVao

func EndVao()

EndVao ...

func EndVbo

func EndVbo()

EndVbo ...

func FlipNRGBA

func FlipNRGBA(r *image.NRGBA)

FlipNRGBA flips image over the X-axis

func LoadImage

func LoadImage(p string) (*image.NRGBA, error)

LoadImage loads image from disk

func PadMap

func PadMap(frame, padding mat.AABB) (v, h [4]float64)

PadMap creates padding break points with help of witch we can determinate vertices of Patch, think of v as four vertical lines and h as 4 horizontal lines, if you draw them on paper you will get 9 rectangles

func SetBlend

func SetBlend(val bool)

SetBlend enables or disables blending

func VerifyVertexData

func VerifyVertexData(v VertexData) error

VerifyVertexData should be used in UnitTest to verify that type you are using for VertexData is safe for use. Function uses heavy reflection and is not suited for ordinary usage.

Types

type Batch

type Batch struct {
	Data

	Buffer  *Buffer
	Program *Program
	Texture *Texture
}

Batch is main drawer, it performs direct draw to canvas and is used as target for Sprite. Batch acts like canvas i some ways but performance difference of drawing Batch to canvas and drawing canvas to canvas is significant. If you need image to ber redrawn ewer frame draw Batch to canvas and use canvas for drawing.

func (*Batch) Draw

func (b *Batch) Draw(target Renderer)

Draw draws all Data to target

type Buffer

type Buffer struct {
	VAO VAO
	VBO VBO
}

Buffer combines VAO and VBO to finally draw to current frame buffer

func NBuffer

func NBuffer(sizes ...int32) Buffer

NBuffer setups a buffer, sizes are passed to VBO constructor, indices determine whether you want to use EBO or not

func (*Buffer) Draw

func (b *Buffer) Draw(data VertexData, indices Indices, mode uint32)

Draw draws data with optional indices, if indices are nil or with length 0 classic drawcall will be triggered

func (*Buffer) Drop

func (b *Buffer) Drop()

Drop ...

type Canvas

type Canvas struct {
	Ptr

	Texture
	Program
	Buffer Buffer

	ClearColor mat.RGBA
	// contains filtered or unexported fields
}

Canvas allows of screen drawing, drawing to canvas produces draw calls. Its the abstraction over opengl framebuffer. It stores drawn image in given texture, if you want to capture it use Image method on texture. Program that canvas uses is applied on resulting image but also on triangles drawn by batch that does not have custom program. Same goes for Buffer.

func NCanvas

func NCanvas(texture Texture, program Program, buffer Buffer) *Canvas

NCanvas creates new framebuffer, all three arguments has to e valid instances of gl objects for canvas to work.

	buff := ggl.NBuffer(2, 2, 4) // see buffer doc
	prog := ggl.LoadProgram("yourVertex.glsl", "yourFragment.glsl")
	texture := ggl.RawTexture(canvasInitialWidth, canvasInitialHeight, nil, DefaultTextureConfig)
 canvas := NCanvas(*texture, *program, buffer)

the texture you are creating is a drawing target, you can of corse use existing texture,draw to it and then capture the result via image:

img := canvas.Image() // returning savable image

func (*Canvas) Clear

func (c *Canvas) Clear(color mat.RGBA)

Clear clears canvas in mode

func (*Canvas) ClearMode

func (c *Canvas) ClearMode(color mat.RGBA, mode ClearMode)

ClearMode clears canvas with given color

func (*Canvas) Draw

func (c *Canvas) Draw(t Renderer, mat mat.Mat, mask mat.RGBA)

Draw draws canvas to another target as a sprite

c.Render(t, mat.IM, mat.Alpha(1)) //draws framebuffer to the center of a screen as it is to t
c.Render(t, mat.IM.Scaled(mat.Vec{}, 2), mat.RGB(1, 0, 0)) //draws framebuffer scaled up with red mask to t

method makes draw call

func (*Canvas) Drop

func (c *Canvas) Drop()

Drop ...

func (*Canvas) Frame

func (c *Canvas) Frame() mat.AABB

Frame returns window frame relative to window center

func (*Canvas) Rect

func (c *Canvas) Rect() mat.AABB

Rect returns rectangle in world coordinates that is visible by canvas

func (*Canvas) Render

func (c *Canvas) Render(data VertexData, indices Indices, texture *Texture, program *Program, buffer *Buffer)

Render implements Renderer interface

func (*Canvas) RenderToScreen

func (c *Canvas) RenderToScreen(mat mat.Mat, mask mat.RGBA, w, h int32)

RenderToScreen renders canvas to main framebuffer (window framebuffer) as a sprite:

c.Render(mat.IM, mat.Alpha(1)) //draws framebuffer to the center of a screen as it is
c.Render(mat.IM.Scaled(mat.Vec{}, 2), mat.RGB(1, 0, 0)) //draws framebuffer scaled up with red mask

method makes draw call

func (*Canvas) Resize

func (c *Canvas) Resize(frame mat.AABB)

Resize resizes the canvas to given frame, canvas viewport is also set, that why you are passing frame,

func (*Canvas) SetCamera

func (c *Canvas) SetCamera(mat mat.Mat)

SetCamera sets view, this has no effect in case of 3D mode (it that ewer be implemented)

func (*Canvas) Start

func (c *Canvas) Start()

Start ...

type ClearMode

type ClearMode uint32

ClearMode is enum type used for clearing a framebuffer

Clearing modes

type Data

type Data struct {
	Vertexes Vertexes
	Indices  Indices
}

Data is Vertex and indice collector, mainly utility that handles vertex offsets it also stores one aditionall slice as space for preporsessing

func (*Data) Accept

func (d *Data) Accept(Data Vertexes, indices Indices)

Accept accepts vertex Data, this is only correct way of feeding batch with Vertexes along side indices, if you don't use indices append directly to Data

func (*Data) Clear

func (d *Data) Clear()

Clear clears t batch but leaves allocated Data

func (*Data) Copy

func (d *Data) Copy(dst *Data)

Copy copies Data to another resulting into two deeply equal objects

func (*Data) Fetch

func (d *Data) Fetch(t Target)

Fetch implements Fetcher interface

type Drawer

type Drawer interface {
	Draw(b Target, mat mat.Mat, mask mat.RGBA)
}

Drawer is triangle drawer, it should always preporcess triangles with given matrix and color and then give them to target

type Fetcher

type Fetcher interface {
	Fetch(b Target)
}

Fetcher is something that only passes triangle data, and does no preprocessing use Fetch if you don't need to modify triangles, its faster for all structs that implement this interface

type Indices

type Indices []uint32

Indices are drawing indices passed to opengl to lower data traffic. Theier use is optional you can always pass nil if you don't want to use them. Though mind that if Batch already contain indices produced by other drawer you have to use them otherwise your triangles will not get rendered.

func (*Indices) Clear

func (i *Indices) Clear()

Clear clears indices

func (*Indices) Resize

func (v *Indices) Resize(size int)

Resize resizes the Indices

func (Indices) Shift

func (i Indices) Shift(delta uint32)

Shift shifts all indices by delta

type Patch

type Patch struct {
	Padding mat.AABB
	// contains filtered or unexported fields
}

Patch consists of grid layout of 3x3 sprites that together form a continuous rectangle. Even though it has same properties as sprite, every operation is 9x as expensive, now little showcase of how NPS works:

	+-+-+-+    	 	+-+------+-+
	| | | |			| |      | |
 +-+-+-+			+-+------+-+
	| | | |			| |      | |
 +-+-+-+			+-+------+-+
	| | | |			| |      | |
 +-+-+-+	(7, 7)	+-+------+-+ (12, 7)

Patch is not window thread dependant

func NPatch

func NPatch(frame, padding mat.AABB) Patch

NPatch creates ready-for-use Patch

func (*Patch) Draw

func (n *Patch) Draw(t Target, mat mat.Mat, mask mat.RGBA)

Draw implements Drawer interface

func (*Patch) Fetch

func (n *Patch) Fetch(t Target)

Fetch implements Fetcher interface

func (*Patch) Resize

func (n *Patch) Resize(width, height float64)

Resize resizes NPS to given width and height, corners will stay as same scale while other 5 parts scale up accordingly to create continuos Rectangle. This is mainly usefull for ui panels and flexible frames.

func (*Patch) SetColor

func (n *Patch) SetColor(value mat.RGBA)

SetColor sets modulation with witch Patch gets drawn

func (*Patch) SetDist

func (n *Patch) SetDist(dst mat.AABB)

SetDist makes sprite drawn into dst area just by fetching it

func (*Patch) SetIntensity

func (n *Patch) SetIntensity(value float64)

SetIntensity sets intensity of all inner sprites, so it has same effect as sprite intensity

func (*Patch) Size

func (n *Patch) Size() mat.Vec

Size returns sprite size when its drawn with mat.IM transforation

func (*Patch) Update

func (n *Patch) Update(mat mat.Mat, mask mat.RGBA)

Update transforms NPS vertices with matrix and sets mask

type Program

type Program struct {
	Ptr
	// contains filtered or unexported fields
}

Program is handle to opengl shader program

func LoadProgram

func LoadProgram(vertexPath, fragmentPath string) (*Program, error)

LoadProgram loads program from disk

func NProgram

func NProgram(vertex, fragment Shader) (*Program, error)

NProgram links vertex and fragment shader into program

func NProgramFromSource

func NProgramFromSource(vertexSource, fragmentSource string) (*Program, error)

NProgramFromSource ...

func (*Program) Drop

func (p *Program) Drop()

Drop ...

func (*Program) SetCamera

func (p *Program) SetCamera(mat mat.Mat)

SetCamera sets "camera" field in fragment shader

func (*Program) SetInt

func (p *Program) SetInt(name string, i int32)

SetInt sets int uniform

func (*Program) SetMat

func (p *Program) SetMat(name string, m *mat.Mat)

SetMat sets mat3 uniform

func (*Program) SetTextureSize

func (p *Program) SetTextureSize(w, h int32)

SetTextureSize sets "textureSize" in vertex shader, if the size is already equal to given values it does nothing

func (*Program) SetUseTexture

func (p *Program) SetUseTexture(b bool)

SetUseTexture sets "useTexture" in fragment shader, its noop if value is already in given state

func (*Program) SetVec

func (p *Program) SetVec(name string, v mat.Vec)

SetVec sets vec2 uniform

func (*Program) SetViewportSize

func (p *Program) SetViewportSize(w, h int32)

SetViewportSize sets "viewportSize" in vertex shader, if the size is already equal to given values it does nothing

func (*Program) Start

func (p *Program) Start()

Start ...

type Ptr

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

Ptr is convenience struct, is sores pointer and only allows reading it

func (Ptr) ID

func (p Ptr) ID() uint32

ID returns pointer valuse

type Renderer

type Renderer interface {
	Render(data VertexData, indices Indices, texture *Texture, program *Program, buffer *Buffer)
}

Renderer is something that you can draw to, last tree parameters can be optional and not even be used by a target, though if you don't provide tham when you should Target can fall back to defaults or panic

type Setup

type Setup interface {
	// VertexShader returns vertex shader source code of Setup
	FragmentShader() string
	// FragmentShader returns fragment shader source of Setup
	VertexShader() string
	// Buffer returns buffer that window will use
	Buffer() Buffer
	// Modify leaves space for some additional modification
	Modify(win *Window)
}

Setup is something that sets up the window drawing state, as library will support and 3D different Setups can be used. its preferale to use lib setup with composition and override methods

type Setup2D

type Setup2D struct{}

Setup2D is basic game rendering setup, if you would like to change some part of it just embed it in your setup struct and override methods. Thought setup isn't just that, it brings lot of utility to its scope to separate it from 3D setup (comming soon)

func (Setup2D) Batch

func (s Setup2D) Batch(texture *Texture, fragmentShader string) (*Batch, error)

Batch creates batch from texture with fragment shader, it does the setup of shader program for you

func (Setup2D) Buffer

func (s Setup2D) Buffer() Buffer

Buffer implements Setup interface

func (Setup2D) Canvas

func (s Setup2D) Canvas(w, h int, fragmentShader string) (*Canvas, error)

Canvas creates canvas with custom fragment shader prepared for rendering

func (Setup2D) FragmentShader

func (s Setup2D) FragmentShader() string

FragmentShader implements Setup interface

func (Setup2D) Modify

func (s Setup2D) Modify(win *Window)

Modify implements Setup interface

func (Setup2D) VertexShader

func (s Setup2D) VertexShader() string

VertexShader implements Setup interface

type Shader

type Shader struct {
	Ptr
}

Shader represents gl sager object

func LoadFragmentShader

func LoadFragmentShader(p string) (*Shader, error)

LoadFragmentShader ...

func LoadShader

func LoadShader(p string, shaderType uint32) (*Shader, error)

LoadShader loads shader from disk

func LoadVertexShader

func LoadVertexShader(p string) (*Shader, error)

LoadVertexShader ...

func NFragmentShader

func NFragmentShader(source string) (*Shader, error)

NFragmentShader ...

func NShader

func NShader(source string, shaderType uint32) (*Shader, error)

NShader creates shader from source, provided type of shader (gl.VERTEX_SHADER or gl.FRAGMENT_SHADER)

func NVertexShader

func NVertexShader(source string) (*Shader, error)

NVertexShader ...

func (Shader) Drop

func (s Shader) Drop()

Drop ...

type Sprite

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

Sprite is most efficient way of drawing textures to Batch (if you find faster way i welcome your pr) sprite does not allocate any memory all data is on stack, its designed to be easily copied by value.

Sprite is not window thread dependant

func NSprite

func NSprite(frame mat.AABB) Sprite

NSprite creates new sprite out of frame. Frame should be the region where the texture, you want to draw, is located on spritesheet, Pivot point is at center by default.

ggl.NSprite(yourTexture.Frame()) // draws whole texture

func (*Sprite) Clear

func (s *Sprite) Clear()

Clear makes sprite invisible when its drawn, this is to impelemt paceholder data

func (*Sprite) Draw

func (s *Sprite) Draw(b Target, mat mat.Mat, mask mat.RGBA)

Draw draws sprite to Batch projected by given matrix, and colored by mask

func (*Sprite) Fetch

func (s *Sprite) Fetch(b Target)

Fetch draws sprite as it is, to change draw result call Update

func (*Sprite) Frame added in v0.2.10

func (s *Sprite) Frame() mat.AABB

Frame returns original sprite-frame

func (*Sprite) Set

func (s *Sprite) Set(dst, src mat.AABB)

Set sets sprites source texture region and destination rectangle, this is mainly used when drawing text

func (*Sprite) SetColor

func (s *Sprite) SetColor(value mat.RGBA)

SetColor sets the color of sprite

func (*Sprite) SetDist

func (s *Sprite) SetDist(dst mat.AABB)

SetDist sets destination area where sprite will be drawn

func (*Sprite) SetIntensity

func (s *Sprite) SetIntensity(value float64)

SetIntensity sets the intensity of sprite image, if you set it to 0 the rectangle in a color of sprite mask will be drawn, if you set it to 1 (which is default) it will draw texture as it is or black area if batch does not have texture.

func (*Sprite) SetPivot added in v0.2.10

func (s *Sprite) SetPivot(pos mat.Vec)

func (*Sprite) Size

func (s *Sprite) Size() mat.Vec

Size returns sprite size when its drawn with mat.IM transforation

func (*Sprite) Update

func (s *Sprite) Update(mat mat.Mat, mask mat.RGBA)

Update only updates sprite data but does not draw it

type Target

type Target interface {
	Accept(vertexes Vertexes, indices Indices)
}

Target is something that accepts triangle data, but data is just copied, is is not used for anything, though shifting of indices is Targets roles

type Texture

type Texture struct {
	Ptr
	W, H int32
}

Texture is a handle to opengl texture object

func LoadTexture

func LoadTexture(p string) (*Texture, error)

LoadTexture loads texture from disk and creates gl texture from it:

tex, err := LoadTexture("maPath.png")

Use NTexture instead if you have to modify it before turning it into gl object, Note that texture is fed with default params and converted ti *image.RGBA if format does not match

func NTexture

func NTexture(img image.Image, flip bool) *Texture

NTexture calls NTextureWithParams with default config

func NTextureWithParams

func NTextureWithParams(img image.Image, flip bool, params ...TextureParam) *Texture

NTextureWithParams allows you to specify additional parameters when creating texture, paramethers are then in code set like:

for _, p := range params {
	gl.TexParameteri(gl.TEXTURE_, p.First, p.Second)
}

Note that even though this function takes image.Image it will always convert it to image.NRGBA witch should already be present as png is parsed int this format. In order to not affect original image, image is copied either way. If you need multiple instances of texture but faster, flip or convert the image your self and use RawTexture instead.

func RawTexture

func RawTexture(w, h int32, pixels []byte, params ...TextureParam) *Texture

RawTexture creates texture out of raw parts, if you do not provide bytes slice texture will be empty but opengl will allocate memory

func (Texture) Drop

func (t Texture) Drop()

Drop ...

func (*Texture) Frame

func (t *Texture) Frame() mat.AABB

Frame returns texture frame, origin is always at [0, 0]

func (*Texture) Image

func (t *Texture) Image() *image.NRGBA

Image withdraws texture data from gpu, this is mainly usefull for capturing framebuffer state it basically makes recording possible

func (*Texture) Resize

func (t *Texture) Resize(w, h int32, pixels []byte)

Resize Resizes the texture resizing does not maintain texture content. If texture is already in given size and you don't input new pixels, this function does nothing

func (*Texture) Start

func (t *Texture) Start()

Start ...

func (*Texture) SubImage

func (t *Texture) SubImage(region image.Rectangle) *image.NRGBA

SubImage returns specified part of texture.

panics if region does not fit into texture (only partially overlaps with texture)

type TextureParam

type TextureParam struct {
	First  uint32
	Second int32
}

TextureParam specifies what is passed to gl.TextureParameteri

type Updater

type Updater interface {
	Update(mat mat.Mat, mask mat.RGBA)
}

Updater si something that can update its state based of color and transformation

type VAO

type VAO struct {
	Ptr
}

VAO abstracts over opengl vertex array

func NVAO

func NVAO() VAO

NVAO ...

func (VAO) Drop

func (v VAO) Drop()

Drop ...

func (VAO) Start

func (v VAO) Start()

Start ...

type VBO

type VBO struct {
	Ptr
	// contains filtered or unexported fields
}

VBO abstracts over opengl array buffer

func NVBO

func NVBO(vertexSizes ...int32) VBO

NVBO initializes buffer structure:

ggl.NVBO(2, 2, 4) // initializes buffer with 3 pointers with given sizes

Then in your vertex shader you access them like:

layout (location = 0) in vec2 vert;
layout (location = 1) in vec2 tex;
layout (location = 2) in vec4 mask;

bdw this is default buffer setup

func (*VBO) Drop

func (v *VBO) Drop()

Drop ...

func (*VBO) SetData

func (v *VBO) SetData(data VertexData, mode uint32)

SetData loads data into VBO, for mode you can use gl version, or redefined package modes that also have some comments, Stream is mostly the best option.

panics if buffer vertexSize does not match with data vertex size

func (*VBO) Start

func (v *VBO) Start()

Start ...

type Vertex

type Vertex struct {
	Pos, Tex  mat.Vec
	Color     mat.RGBA
	Intensity float64
}

Vertex is essentia vertex struct for rendering

type VertexData

type VertexData interface {
	// Len simply returns length of slice
	Len() int
	// VertexSize is amount of floats one element of VertexData contains
	VertexSize() int
}

VertexData is what you use to hand data to opengl, its very important for you to pass a Slice containing doubles or structs composed only from doubles. If you are not sure whether your data is valid call VerifyVertexData with instance of your data, it will return helpfull error if behavior is not satisfied, though function is slow thats why its not used to infer parameters that you can provide with lot lower overhead.

type Vertexes

type Vertexes []Vertex

Vertexes implements essential utility methods for any struct satisfying VertexData interface. Its a gogen TEMPLATE:

/*gen(
	Vertexes<Vertex, 9, Vertexes>
)*/

this block generates VertexSlice with Vertex and 8 is the size of Vertex, Vertexes is name of generated struct divided by float64 byte size for more info search github.com/jakubDoka/gogen.

func (*Vertexes) Clear

func (v *Vertexes) Clear()

Clear clears slice

func (Vertexes) Len

func (v Vertexes) Len() int

Len implements VertexData interface

func (*Vertexes) Resize

func (v *Vertexes) Resize(size int)

Resize resizes the Vertexes

func (Vertexes) Rewrite

func (v Vertexes) Rewrite(o Vertexes, idx int)

Rewrite revrites elements from index to o values

func (Vertexes) VertexSize

func (v Vertexes) VertexSize() int

VertexSize implements VertexData interface

type Window

type Window struct {
	*glfw.Window
	Mask mat.RGBA
	Canvas
	// contains filtered or unexported fields
}

Window enables use of almost all other structs avaliable in this package, Window initializes opengl context.

func NWindow

func NWindow(config *WindowConfig) (*Window, error)

NWindow creates new window from WindowConfig, if config is nil, default one will be used

func (*Window) JustPressed

func (w *Window) JustPressed(button key.Key) bool

JustPressed returns whether the Button has just been pressed down.

func (*Window) JustReleased

func (w *Window) JustReleased(button key.Key) bool

JustReleased returns whether the Button has just been released up.

func (*Window) MouseIsInside

func (w *Window) MouseIsInside() bool

MouseIsInside returns true if the mouse position is within the Window's Bounds.

func (*Window) MousePos

func (w *Window) MousePos() mat.Vec

MousePos returns the current mouse position in the Window's Bounds.

func (*Window) MousePrevPos

func (w *Window) MousePrevPos() mat.Vec

MousePrevPos returns the previous mouse position in the Window's Bounds.

func (*Window) MouseScroll

func (w *Window) MouseScroll() mat.Vec

MouseScroll returns the mouse scroll amount (in both axes) since the last call to Window.Update.

func (*Window) Pressed

func (w *Window) Pressed(button key.Key) bool

Pressed returns whether the Button is currently pressed down.

func (*Window) Repeated

func (w *Window) Repeated(button key.Key) bool

Repeated returns whether a repeat event has been triggered on button.

Repeat event occurs repeatedly when a button is held down for some time.

func (*Window) Typed

func (w *Window) Typed() string

Typed returns the text typed on the keyboard since the last call to Window.Update.

func (*Window) Update

func (w *Window) Update()

Update updates the window so you can see it changing and also updates input

type WindowConfig

type WindowConfig struct {
	Setup         Setup
	Width, Height int
	Title         string

	Resizable              bool
	Undecorated            bool
	TransparentFramebuffer bool
	AlwaysOnTop            bool
	NoIconify              bool
	Maximized              bool
	Invisible              bool

	Hints   []WindowHint
	Monitor *glfw.Monitor
	Share   *glfw.Window
}

WindowConfig stores configuration for window, But that des not mean you cannot set these propertis later on, Its just nicer to have ewerithing on one place

type WindowHint

type WindowHint struct {
	Hint  glfw.Hint
	Value int
}

WindowHint allows to specify vindow hints (revolution right here)

Directories

Path Synopsis
drw
key
binding
Package binding implements simple B system on top of window input methods
Package binding implements simple B system on top of window input methods
Package ui brings robust ui system based on elements.
Package ui brings robust ui system based on elements.

Jump to

Keyboard shortcuts

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