Documentation ¶
Index ¶
- func BindFramebuffer(fb graphics.Framebuffer)
- func Clear(c color.Color)
- func Close()
- func DisableFPS()
- func DisableWindowResize()
- func Draw()
- func EnableFPS()
- func GetCursorPosition() (int, int)
- func GetFPS() float64
- func GetViewportSize() (int, int)
- func GetWindowHeight() int
- func GetWindowPosition() (int, int)
- func GetWindowSize() (int, int)
- func GetWindowWidth() int
- func IsButtonJustPressed(buttonCode input.MouseButton) bool
- func IsButtonPressed(buttonCode input.MouseButton) bool
- func IsKeyJustPressed(keyCode input.Key) bool
- func IsKeyPressed(keyCode input.Key) bool
- func PressButton(buttonCode input.MouseButton)
- func PressKey(keyCode input.Key)
- func ReleaseButton(buttonCode input.MouseButton)
- func ReleaseKey(keyCode input.Key)
- func RenderFramebuffer(fb Framebuffer, options *TextureRenderOptions)
- func RenderShape(shape Renderable)
- func RenderText(text string, options *TextRenderOptions)
- func RenderTexture(textureHandle uint32, options *TextureRenderOptions)
- func ResizeFramebuffer(fb Framebuffer, width, height int)
- func Run(updateFn func(), renderFn func())
- func RunApp(game Game)
- func RunGame(game Game)
- func SetBorderlessWindowed(v bool)
- func SetFullScreenBorderless(v bool)
- func SetResizeCallback(fn func(physicalWidth, physicalHeight uint32))
- func SetScrollCallback(cb func(x float64, y float64))
- func SetTitle(title string)
- func SetWindowPosition(x, y int)
- func SetWindowSize(width, height int)
- func UnbindFramebuffer()
- func UpdateTexture(textureID uint32, img image.Image, xOffset, yOffset float32)
- func UploadTexture(img image.Image) uint32
- func Viewport(x int32, y int32, width int32, height int32)
- type Circle
- type Framebuffer
- type Game
- type Polygon
- type Rect
- type Renderable
- type Segment
- type TextRenderOptions
- type TextureRenderOptions
- type Vertex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindFramebuffer ¶
func BindFramebuffer(fb graphics.Framebuffer)
func DisableWindowResize ¶
func DisableWindowResize()
func GetCursorPosition ¶
func GetViewportSize ¶
func GetWindowHeight ¶
func GetWindowHeight() int
func GetWindowPosition ¶
func GetWindowSize ¶
GetWindowSize retrieves the current window size.
func GetWindowWidth ¶
func GetWindowWidth() int
func IsButtonJustPressed ¶
func IsButtonJustPressed(buttonCode input.MouseButton) bool
IsButtonJustPressed checks if a mouse button was just pressed
func IsButtonPressed ¶
func IsButtonPressed(buttonCode input.MouseButton) bool
func IsKeyJustPressed ¶
func IsKeyPressed ¶
IsKeyPressed checks if a key is currently pressed
func PressButton ¶
func PressButton(buttonCode input.MouseButton)
PressButton simulates a mouse button press
func ReleaseButton ¶
func ReleaseButton(buttonCode input.MouseButton)
func ReleaseKey ¶
func RenderFramebuffer ¶
func RenderFramebuffer(fb Framebuffer, options *TextureRenderOptions)
func RenderShape ¶
func RenderShape(shape Renderable)
func RenderText ¶
func RenderText(text string, options *TextRenderOptions)
func RenderTexture ¶
func RenderTexture(textureHandle uint32, options *TextureRenderOptions)
func ResizeFramebuffer ¶
func ResizeFramebuffer(fb Framebuffer, width, height int)
func Run ¶
func Run(updateFn func(), renderFn func())
Run is the main update function called to refresh the engine state.
func SetBorderlessWindowed ¶
func SetBorderlessWindowed(v bool)
func SetFullScreenBorderless ¶
func SetFullScreenBorderless(v bool)
func SetResizeCallback ¶
func SetResizeCallback(fn func(physicalWidth, physicalHeight uint32))
func SetScrollCallback ¶
func SetWindowPosition ¶
func SetWindowPosition(x, y int)
func SetWindowSize ¶
func SetWindowSize(width, height int)
func UnbindFramebuffer ¶
func UnbindFramebuffer()
func UpdateTexture ¶
func UploadTexture ¶
Types ¶
type Framebuffer ¶
type Framebuffer graphics.Framebuffer
func AddFramebuffer ¶
func AddFramebuffer(width, height int) (Framebuffer, error)
type Renderable ¶
type Segment ¶
type Segment struct {
X1, Y1, X2, Y2, Width float32
Color color.Color
StencilWriteValue uint8
StencilTestValue uint8
}
func (*Segment) GetStencilTestValue ¶
func (*Segment) GetStencilWriteValue ¶
type TextRenderOptions ¶
type TextureRenderOptions ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
Code in the `exp` package is experimental and will likely change
|
Code in the `exp` package is experimental and will likely change |
gui
The gui package is currently expiramental.
|
The gui package is currently expiramental. |
Package graphics provides functionality for 2D graphics rendering, including textures, sprites, text, and shapes.
|
Package graphics provides functionality for 2D graphics rendering, including textures, sprites, text, and shapes. |
pkg
|
|
fb
The fb package provides a framebuffer abstraction.
|
The fb package provides a framebuffer abstraction. |
Click to show internal directories.
Click to hide internal directories.