Documentation
¶
Overview ¶
Package mobilegles provides an OpenGL ES 2.0 backend for MeUi using purego.
Package mobilegles provides an OpenGL ES 2.0/3.0 backend for MeUi using purego. This enables mobile platform support without CGO dependencies.
FFI: purego is the binding layer today, but the planned replacement is pureffi (purego's API on go-webgpu/goffi) - architecture decision D7 in meui-migration/design/meui-platform-architecture.md, with the measured trial in MIGRATION.md P6a/P6b. Two consequences for anyone touching this package:
- pureffi works only under CGO_ENABLED=0, and the race detector needs CGO_ENABLED=1; that is why the switch is deferred rather than done; and
- do not add a cgo dependency to this module (or to meui) without checking D7 - a third-party cgo package in the graph is what forces that mode.
purego already needs CGO_ENABLED=1 on Android and iOS, and has no Windows Dlopen/Dlsym; that gap is what D7 plans to close.
Index ¶
- Constants
- func AcquireRenderer()
- func AntialiasPreference() bool
- func AppEventWatchAvailable() bool
- func AppEventWatchInstalled() bool
- func BeginBlur()
- func Blur(radius float32)
- func CapHeightPx(f *truetype.Font, size float32) float32
- func ClearScissor()
- func ClearScreen(col uint32)
- func CompileGeneratedGLSL(vert, frag string) (uint32, error)
- func CreateOffscreenFBO(w, h int32) (uint32, uint32)
- func CurClipQuad() (float32, float32, float32, float32)
- func DefaultReadFBO() int32
- func DeleteOffscreenFBO(fbo, tex uint32)
- func DescentPx(f *truetype.Font, size float32) float32
- func DrawCircleGL(cx, cy, radius float32, color Color)
- func DrawLineGL(x1, y1, x2, y2 float32, color Color, strokeW float32)
- func DrawOvalGL(x, y, w, h float32, color Color)
- func DrawRectGL(x, y, w, h float32, color Color, angle float32)
- func DrawTexturedQuadsBatch(verts []float32, texID uint32, color Color, isImage bool)
- func DrawTrianglesBatch(verts []float32, color Color)
- func DumpRenderState(where string)
- func EdgeZone(x, y, w, h float32) uint32
- func EffectiveSize(w *Window) (int32, int32)
- func EmbeddedRobotoFace(style string) *truetype.Font
- func EndBlur(radius float32)
- func EraseRoundedCorners(x, y, w, h, radius float32, topOnly bool)
- func ErrOffscreenFailed() error
- func FlushBatches()
- func FontMetricsRatios(f *truetype.Font) fontMetricsRatios
- func GLClearDepth()
- func GLDepthTest(enabled bool)
- func GLDepthWrite(enabled bool)
- func GLInfo() (vendor, renderer, version string)
- func GLXDrawableSize() (int32, int32, bool)
- func Gaussian(x, sigma float32) float32
- func GaussianWeights(radius int, sigma float32) []float32
- func GetClipboardText() string
- func GetError() uint32
- func GetGL3ProcAddress(name string) uintptr
- func GlobalAlphaPreference() float32
- func GlobalMousePos() (float32, float32)
- func HasEGLSupport() bool
- func HasGLSupport() bool
- func Init() error
- func InitEGLForAndroid(window unsafe.Pointer, width, height int32) error
- func InitRenderer() error
- func InitWindowError() error
- func InvalidateGLStateCache()
- func KnownCursorNames() []string
- func LoadGLESFromLib(lib uintptr)
- func LoadSystemFont(path string) (*truetype.Font, error)
- func LoadTTFFromBytes(data []byte) (*truetype.Font, error)
- func LoadTTFFromFile(path string) (*truetype.Font, error)
- func MaxTextureUnits() int
- func MaxTexturesPerBatch() int
- func MaxVertexAttribs() int
- func MouseLeftDown() bool
- func MoveResizeSDLWin(w *Window, x, y, width, height int32) bool
- func MoveSDLWinBy(w *Window, x, y int32)
- func NoteResizeAck(w *Window, width, height int32)
- func PendingBatchVerts() int
- func PrimarySDLWindowPointer() unsafe.Pointer
- func ProbeFullClear(w, h int32) (top, bottom uint32, ok bool)
- func ProcessEvents(w *Window)
- func ProcessEventsAndDispatch(w *Window)
- func PumpAll()
- func ReadOffscreenPixels(fbo uint32, w, h int32) []uint32
- func ReadScreenPixels(w, h int32) []uint32
- func ReleaseRenderer()
- func RenderOffscreen(w, h int32, renderFn func()) []uint32
- func ResetClipState()
- func ResetGLCache()
- func ResetSizeProbe()
- func ResizeWindow(w *Window, width, height int32)
- func RunHeadlessDemo(w *Window)
- func SDFBatchRect(x, y, w, h, radius float32, color Color, style int32, strokeW, angle float32)
- func SDFBatchTexturedQuads(verts []float32, texID uint32, isImage bool)
- func SDFBatchTriangles(verts []float32)
- func SetAntialiasPreference(on bool)
- func SetAppEventHandler(fn func(Event))
- func SetBlendModeCached(mode int32)
- func SetClipDiscardEnabled(on bool)
- func SetClipPlanes(planes []ClipPlane)
- func SetClipboardText(s string)
- func SetCurrentGradient(g Gradient)
- func SetCursorByName(s string)
- func SetFullscreen(w *Window, fullscreen bool)
- func SetGLContextVersion(major, minor int32, profile uint32)
- func SetGlobalAlphaPreference(a float32)
- func SetRendererFactory(f func() Renderer)
- func SetScissor(x, y, w, h int32)
- func SetScreenSize(w, h float32)
- func SetSensorHandler(fn func(uint32, [6]float32))
- func SetSwapInterval0()
- func SetSystemFont(face *truetype.Font)
- func SetWindowHitHandler(w *Window, fn func(x, y int32) uint32)
- func SetWindowSizeSDLWin(w *Window, width, height int32) bool
- func Shutdown()
- func SizeProbe(w *Window)
- func SwapEGLBuffers()
- func SwapWindow()
- func SystemTTF() *truetype.Font
- func TerminateEGL()
- func UseProgramCached(program uint32)
- func VideoDriver() string
- func WindowMaximized(w *Window) bool
- func WindowPos(w *Window) (int32, int32)
- func WindowSize(w *Window) (int32, int32)
- type BlendMode
- type BlurRenderer
- type Canvas
- func (c *Canvas) Clear(col uint32)
- func (c *Canvas) ClearWithViewport(col uint32, x, y, w, h int32)
- func (c *Canvas) ClipBounds() Rect
- func (c *Canvas) ClipDepth() int
- func (c *Canvas) ClipPath(path *Path) bool
- func (c *Canvas) ClipRect(r Rect)
- func (c *Canvas) DrawArc(x, y, w, h, startAngle, sweepAngle float32, p *Paint)
- func (c *Canvas) DrawCircle(cx, cy, r float32, p *Paint)
- func (c *Canvas) DrawCirclePath(cx, cy, r float32, p *Paint)
- func (c *Canvas) DrawColor(col uint32, mode BlendMode)
- func (c *Canvas) DrawImage(img *Image, x, y float32, p *Paint)
- func (c *Canvas) DrawImageInRect(img *Image, rect Rect, p *Paint)
- func (c *Canvas) DrawImageNine(img *Image, centerRect Rect, dest Rect, p *Paint)
- func (c *Canvas) DrawLine(x1, y1, x2, y2 float32, p *Paint)
- func (c *Canvas) DrawLineRotated(x, y, length, thickness, angle float32, p *Paint)
- func (c *Canvas) DrawOval(x, y, w, h float32, p *Paint)
- func (c *Canvas) DrawPath(path *Path, p *Paint)
- func (c *Canvas) DrawPoints(verts []float32, p *Paint)
- func (c *Canvas) DrawRect(x, y, w, h float32, p *Paint)
- func (c *Canvas) DrawRoundedRect(rect Rect, radiusX, radiusY float32, p *Paint)
- func (c *Canvas) DrawSimpleString(text string, x, y float32, p *Paint)
- func (c *Canvas) DrawText(text string, x, y float32, font *Font, p *Paint)
- func (c *Canvas) DrawTriangleFilled(p1, p2, p3 Point, p *Paint)
- func (c *Canvas) DropShadow(rect Rect, p *Paint, offsetX, offsetY, radius float32)
- func (c *Canvas) GetMatrix() Matrix
- func (c *Canvas) Height() float32
- func (c *Canvas) IsClipEmpty() bool
- func (c *Canvas) QuickRejectRect(rect Rect) bool
- func (c *Canvas) ResetClip()
- func (c *Canvas) Restore()
- func (c *Canvas) RestoreToCount(count int)
- func (c *Canvas) Rotate(degrees float32)
- func (c *Canvas) Save() int
- func (c *Canvas) SaveAndRestore(f func(c *Canvas))
- func (c *Canvas) Scale(sx, sy float32)
- func (c *Canvas) Skew(kx, ky float32)
- func (c *Canvas) TransformRect(x, y, w, h float32) (float32, float32, float32, float32)
- func (c *Canvas) Translate(dx, dy float32)
- func (c *Canvas) Width() float32
- func (c *Canvas) WithClip(r Rect, f func(c *Canvas))
- type ClipPlane
- type Color
- type DesktopRenderer
- func (d *DesktopRenderer) ClearScissor()
- func (d *DesktopRenderer) ClearWithViewport(col uint32, x, y, w, h int32)
- func (d *DesktopRenderer) DrainErrors()
- func (d *DesktopRenderer) DrawCircle(cx, cy, radius float32, color Color)
- func (d *DesktopRenderer) DrawColor(col uint32, mode BlendMode)
- func (d *DesktopRenderer) DrawLine(x1, y1, x2, y2 float32, color Color, strokeW float32)
- func (d *DesktopRenderer) DrawOval(x, y, w, h float32, color Color)
- func (d *DesktopRenderer) DrawPathFill(tris []float32, color Color, bounds Rect)
- func (d *DesktopRenderer) DrawRect(x, y, w, h float32, color Color, angle float32)
- func (d *DesktopRenderer) DrawRectStyled(x, y, w, h, radius, strokeW float32, color Color, style int32, angle float32)
- func (d *DesktopRenderer) DrawTexturedQuads(verts []float32, texID uint32, color Color, isImage bool)
- func (d *DesktopRenderer) DrawTriangles(verts []float32, color Color)
- func (d *DesktopRenderer) Flush()
- func (d *DesktopRenderer) Present()
- func (d *DesktopRenderer) ScissorState() (int32, int32, int32, int32, bool)
- func (d *DesktopRenderer) ScreenSize() (float32, float32)
- func (d *DesktopRenderer) SetBlendMode(mode BlendMode)
- func (d *DesktopRenderer) SetScissor(x, y, w, h int32)
- func (d *DesktopRenderer) SetScreenSize(w, h float32)
- func (d *DesktopRenderer) SetViewport(x, y, w, h int32)
- type EGLContext
- type ErrNotSupported
- type Event
- type EventQueue
- type EventSource
- type EventType
- type Font
- type FontDescriptor
- type FrameStats
- type GPUTimer
- type Gradient
- type GradientStop
- type GradientType
- type Image
- func (img *Image) Dirty() bool
- func (img *Image) Height() int32
- func (i *Image) LogicalSize() Size
- func (img *Image) MarkPixelsDirty()
- func (img *Image) Pixels() []uint32
- func (img *Image) SetPixels(pix []uint32)
- func (img *Image) TextureID() uint32
- func (img *Image) ToPNG(compressionLevel int) ([]byte, error)
- func (img *Image) Upload()
- func (img *Image) Width() int32
- type InstanceData
- type KeyMod
- type Keycode
- type Mat4
- type Matrix
- type Paint
- func (p *Paint) Antialias() bool
- func (p *Paint) BlendMode() BlendMode
- func (p *Paint) ClearGradient()
- func (p *Paint) Color() Color
- func (p *Paint) GlobalAlpha() float32
- func (p *Paint) Gradient() Gradient
- func (p *Paint) MiterLimit() float32
- func (p *Paint) SetAntialias(on bool)
- func (p *Paint) SetBlendMode(mode BlendMode)
- func (p *Paint) SetColor(c Color)
- func (p *Paint) SetConicGradient(center Point, startAngle float32, stops []GradientStop)
- func (p *Paint) SetGlobalAlpha(a float32)
- func (p *Paint) SetGradient(g Gradient)
- func (p *Paint) SetLinearGradient(start, end Point, stops []GradientStop)
- func (p *Paint) SetMiterLimit(limit float32)
- func (p *Paint) SetRadialGradient(center Point, radius float32, stops []GradientStop)
- func (p *Paint) SetStrokeCap(cap StrokeCap)
- func (p *Paint) SetStrokeJoin(join StrokeJoin)
- func (p *Paint) SetStrokeWidth(w float32)
- func (p *Paint) SetStyle(style int32)
- func (p *Paint) StrokeCap() StrokeCap
- func (p *Paint) StrokeJoin() StrokeJoin
- func (p *Paint) StrokeWidth() float32
- func (p *Paint) Style() PaintStyle
- type PaintStyle
- type Path
- type PathPt
- type PathVerb
- type Point
- type Rect
- type RectRenderer
- type Renderer
- type ShapeRenderer
- type Size
- type StrokeCap
- type StrokeJoin
- type TextRenderer
- type Touch
- type Vec3
- type Window
Constants ¶
const ( EGL_DEFAULT_DISPLAY = 0 EGL_PLATFORM_X11_KHR = 0x31D6 EGL_PLATFORM_X11_SCREEN_EXT = 0x31D6 EGL_OPENGL_ES_API = 0x30A0 EGL_OPENGL_ES2_BIT = 4 EGL_WINDOW_BIT = 4 EGL_RENDERABLE_TYPE = 0x3040 EGL_SURFACE_TYPE = 0x3033 EGL_RED_SIZE = 0x3021 EGL_GREEN_SIZE = 0x3022 EGL_BLUE_SIZE = 0x3023 EGL_ALPHA_SIZE = 0x3024 EGL_DEPTH_SIZE = 0x3025 EGL_NONE = 0x3038 EGL_CONTEXT_CLIENT_VERSION = 0x3098 EGL_SUCCESS = 0x3000 )
const ( GL_VERTEX_SHADER = 0x8B31 GL_FRAGMENT_SHADER = 0x8B30 GL_TRIANGLES = 0x0004 GL_FLOAT = 0x1406 GL_ARRAY_BUFFER = 0x8892 GL_ELEMENT_ARRAY_BUFFER = 0x8893 GL_UNSIGNED_INT = 0x1405 GL_STATIC_DRAW = 0x88E4 GL_STREAM_DRAW = 0x88E0 GL_COLOR_BUFFER_BIT = 0x00004000 GL_SCISSOR_TEST = 0x0C11 GL_TEXTURE_2D = 0x0DE1 GL_ALPHA = 0x1906 GL_RGBA = 0x1908 GL_UNSIGNED_BYTE = 0x1401 GL_LINEAR = 0x2601 GL_LINEAR_MIPMAP_LINEAR = 0x2703 GL_CLAMP_TO_EDGE = 0x812F GL_TEXTURE_MIN_FILTER = 0x2801 GL_TEXTURE_MAG_FILTER = 0x2800 GL_TEXTURE_WRAP_S = 0x2802 GL_TEXTURE_WRAP_T = 0x2803 GL_DEPTH_TEST = 0x0B71 GL_DEPTH_BUFFER_BIT = 0x00000100 GL_STENCIL_TEST = 0x0B90 GL_STENCIL_BUFFER_BIT = 0x00000400 GL_ALWAYS = 0x0207 GL_NOTEQUAL = 0x0205 GL_KEEP = 0x1E00 GL_INCR = 0x1E02 GL_LEQUAL = 0x0203 GL_BLEND = 0x0BE2 GL_SRC_ALPHA = 0x0302 GL_ONE_MINUS_SRC_ALPHA = 0x0303 GL_ONE_MINUS_SRC_COLOR = 0x0301 GL_ZERO = 0x0000 GL_SRC_COLOR = 0x0300 GL_DST_COLOR = 0x0306 GL_ONE = 0x0001 GL_FRAMEBUFFER = 0x8D40 GL_COLOR_ATTACHMENT0 = 0x8CE0 GL_FRAMEBUFFER_COMPLETE = 0x8CD5 GL_TIME_ELAPSED = 0x88BF GL_QUERY_RESULT = 0x8866 GL_QUERY_RESULT_AVAILABLE = 0x8867 )
const ( ButtonLeft = sdl.ButtonLeft ButtonMiddle = sdl.ButtonMiddle ButtonRight = sdl.ButtonRight EventNone = sdl.EventNone Key0 = sdl.Key0 Key1 = sdl.Key1 Key2 = sdl.Key2 Key3 = sdl.Key3 Key4 = sdl.Key4 Key5 = sdl.Key5 Key6 = sdl.Key6 Key7 = sdl.Key7 Key8 = sdl.Key8 Key9 = sdl.Key9 KeyA = sdl.KeyA KeyApostrophe = sdl.KeyApostrophe KeyB = sdl.KeyB KeyBackslash = sdl.KeyBackslash KeyBackspace = sdl.KeyBackspace KeyC = sdl.KeyC KeyCloseBracket = sdl.KeyCloseBracket KeyComma = sdl.KeyComma KeyD = sdl.KeyD KeyDelete = sdl.KeyDelete KeyDown = sdl.KeyDown KeyE = sdl.KeyE KeyEnd = sdl.KeyEnd KeyEnter = sdl.KeyEnter KeyEqual = sdl.KeyEqual KeyEscape = sdl.KeyEscape KeyF = sdl.KeyF KeyF1 = sdl.KeyF1 KeyF10 = sdl.KeyF10 KeyF11 = sdl.KeyF11 KeyF12 = sdl.KeyF12 KeyF2 = sdl.KeyF2 KeyF3 = sdl.KeyF3 KeyF4 = sdl.KeyF4 KeyF5 = sdl.KeyF5 KeyF6 = sdl.KeyF6 KeyF7 = sdl.KeyF7 KeyF8 = sdl.KeyF8 KeyF9 = sdl.KeyF9 KeyG = sdl.KeyG KeyGrave = sdl.KeyGrave KeyH = sdl.KeyH KeyHome = sdl.KeyHome KeyI = sdl.KeyI KeyInsert = sdl.KeyInsert KeyJ = sdl.KeyJ KeyK = sdl.KeyK KeyL = sdl.KeyL KeyLeft = sdl.KeyLeft KeyLeftAlt = sdl.KeyLeftAlt KeyLeftCtrl = sdl.KeyLeftCtrl KeyLeftMeta = sdl.KeyLeftMeta KeyLeftShift = sdl.KeyLeftShift KeyM = sdl.KeyM KeyMinus = sdl.KeyMinus KeyN = sdl.KeyN KeyO = sdl.KeyO KeyOpenBracket = sdl.KeyOpenBracket KeyP = sdl.KeyP KeyPageDown = sdl.KeyPageDown KeyPageUp = sdl.KeyPageUp KeyPause = sdl.KeyPause KeyPeriod = sdl.KeyPeriod KeyQ = sdl.KeyQ KeyR = sdl.KeyR KeyRight = sdl.KeyRight KeyRightAlt = sdl.KeyRightAlt KeyRightCtrl = sdl.KeyRightCtrl KeyRightMeta = sdl.KeyRightMeta KeyRightShift = sdl.KeyRightShift KeyS = sdl.KeyS KeySemicolon = sdl.KeySemicolon KeySlash = sdl.KeySlash KeySpace = sdl.KeySpace KeyT = sdl.KeyT KeyTab = sdl.KeyTab KeyU = sdl.KeyU KeyUnknown = sdl.KeyUnknown KeyUp = sdl.KeyUp KeyV = sdl.KeyV KeyW = sdl.KeyW KeyX = sdl.KeyX KeyY = sdl.KeyY KeyZ = sdl.KeyZ Keypad0 = sdl.Keypad0 Keypad1 = sdl.Keypad1 Keypad2 = sdl.Keypad2 Keypad3 = sdl.Keypad3 Keypad4 = sdl.Keypad4 Keypad5 = sdl.Keypad5 Keypad6 = sdl.Keypad6 Keypad7 = sdl.Keypad7 Keypad8 = sdl.Keypad8 Keypad9 = sdl.Keypad9 KeypadAsterisk = sdl.KeypadAsterisk KeypadComma = sdl.KeypadComma KeypadDot = sdl.KeypadDot KeypadEnter = sdl.KeypadEnter KeypadEquals = sdl.KeypadEquals KeypadMinus = sdl.KeypadMinus KeypadPercent = sdl.KeypadPercent KeypadPlus = sdl.KeypadPlus KeypadSlash = sdl.KeypadSlash ModAlt = sdl.ModAlt ModCaps = sdl.ModCaps ModCtrl = sdl.ModCtrl ModMeta = sdl.ModMeta ModNone = sdl.ModNone ModNum = sdl.ModNum ModScroll = sdl.ModScroll ModShift = sdl.ModShift EventAppLowMemory = sdl.EventAppLowMemory EventAppPause = sdl.EventAppPause EventAppResume = sdl.EventAppResume EventAppTerminating = sdl.EventAppTerminating EventBack = sdl.EventBack EventFileDrop = sdl.EventFileDrop EventFocusGained = sdl.EventFocusGained EventFocusLost = sdl.EventFocusLost EventJoystickAxis = sdl.EventJoystickAxis EventJoystickButtonDown = sdl.EventJoystickButtonDown EventJoystickButtonUp = sdl.EventJoystickButtonUp EventJoystickHat = sdl.EventJoystickHat EventKeyDown = sdl.EventKeyDown EventKeyUp = sdl.EventKeyUp EventMouseDown = sdl.EventMouseDown EventMouseMove = sdl.EventMouseMove EventMouseUp = sdl.EventMouseUp EventMouseWheel = sdl.EventMouseWheel EventOrientationChanged = sdl.EventOrientationChanged EventQuit = sdl.EventQuit EventResize = sdl.EventResize EventTextEditing = sdl.EventTextEditing EventTextInput = sdl.EventTextInput EventTouchCancel = sdl.EventTouchCancel EventTouchDown = sdl.EventTouchDown EventTouchMove = sdl.EventTouchMove EventTouchUp = sdl.EventTouchUp )
const ( EdgeBot = sdl.EdgeBot EdgeLeft = sdl.EdgeLeft EdgeNone = sdl.EdgeNone EdgeRight = sdl.EdgeRight EdgeTop = sdl.EdgeTop SDL3_EVENT_APP_DID_BACKGROUND = sdl.SDL3_EVENT_APP_DID_BACKGROUND SDL3_EVENT_APP_DID_FOREGROUND = sdl.SDL3_EVENT_APP_DID_FOREGROUND SDL3_EVENT_APP_LOW_MEMORY = sdl.SDL3_EVENT_APP_LOW_MEMORY SDL3_EVENT_APP_TERMINATING = sdl.SDL3_EVENT_APP_TERMINATING SDL3_EVENT_APP_WILL_BACKGROUND = sdl.SDL3_EVENT_APP_WILL_BACKGROUND SDL3_EVENT_APP_WILL_FOREGROUND = sdl.SDL3_EVENT_APP_WILL_FOREGROUND SDL3_EVENT_DISPLAY_ORIENTATION = sdl.SDL3_EVENT_DISPLAY_ORIENTATION SDL3_EVENT_DROP_BEGIN = sdl.SDL3_EVENT_DROP_BEGIN SDL3_EVENT_DROP_COMPLETE = sdl.SDL3_EVENT_DROP_COMPLETE SDL3_EVENT_DROP_FILE = sdl.SDL3_EVENT_DROP_FILE SDL3_EVENT_DROP_POSITION = sdl.SDL3_EVENT_DROP_POSITION SDL3_EVENT_DROP_TEXT = sdl.SDL3_EVENT_DROP_TEXT SDL3_EVENT_FINGER_CANCELED = sdl.SDL3_EVENT_FINGER_CANCELED SDL3_EVENT_FINGER_DOWN = sdl.SDL3_EVENT_FINGER_DOWN SDL3_EVENT_FINGER_MOTION = sdl.SDL3_EVENT_FINGER_MOTION SDL3_EVENT_FINGER_UP = sdl.SDL3_EVENT_FINGER_UP SDL3_EVENT_JOYSTICK_AXIS = sdl.SDL3_EVENT_JOYSTICK_AXIS SDL3_EVENT_JOYSTICK_BALL = sdl.SDL3_EVENT_JOYSTICK_BALL SDL3_EVENT_JOYSTICK_BUTTON_DOWN = sdl.SDL3_EVENT_JOYSTICK_BUTTON_DOWN SDL3_EVENT_JOYSTICK_BUTTON_UP = sdl.SDL3_EVENT_JOYSTICK_BUTTON_UP SDL3_EVENT_JOYSTICK_HAT = sdl.SDL3_EVENT_JOYSTICK_HAT SDL3_EVENT_KEYBOARD_ADDED = sdl.SDL3_EVENT_KEYBOARD_ADDED SDL3_EVENT_KEYBOARD_REMOVED = sdl.SDL3_EVENT_KEYBOARD_REMOVED SDL3_EVENT_KEYMAP_CHANGED = sdl.SDL3_EVENT_KEYMAP_CHANGED SDL3_EVENT_KEY_DOWN = sdl.SDL3_EVENT_KEY_DOWN SDL3_EVENT_KEY_UP = sdl.SDL3_EVENT_KEY_UP SDL3_EVENT_MOUSE_ADDED = sdl.SDL3_EVENT_MOUSE_ADDED SDL3_EVENT_MOUSE_BUTTON_DOWN = sdl.SDL3_EVENT_MOUSE_BUTTON_DOWN SDL3_EVENT_MOUSE_BUTTON_UP = sdl.SDL3_EVENT_MOUSE_BUTTON_UP SDL3_EVENT_MOUSE_MOTION = sdl.SDL3_EVENT_MOUSE_MOTION SDL3_EVENT_MOUSE_REMOVED = sdl.SDL3_EVENT_MOUSE_REMOVED SDL3_EVENT_MOUSE_WHEEL = sdl.SDL3_EVENT_MOUSE_WHEEL SDL3_EVENT_QUIT = sdl.SDL3_EVENT_QUIT SDL3_EVENT_SCREEN_KEYBOARD_HIDDEN = sdl.SDL3_EVENT_SCREEN_KEYBOARD_HIDDEN SDL3_EVENT_SCREEN_KEYBOARD_SHOWN = sdl.SDL3_EVENT_SCREEN_KEYBOARD_SHOWN SDL3_EVENT_SENSOR_UPDATE = sdl.SDL3_EVENT_SENSOR_UPDATE SDL3_EVENT_TEXT_EDITING = sdl.SDL3_EVENT_TEXT_EDITING SDL3_EVENT_TEXT_EDITING_CANDIDATES = sdl.SDL3_EVENT_TEXT_EDITING_CANDIDATES SDL3_EVENT_TEXT_INPUT = sdl.SDL3_EVENT_TEXT_INPUT SDL3_EVENT_WINDOW_CLOSE_REQUESTED = sdl.SDL3_EVENT_WINDOW_CLOSE_REQUESTED SDL3_EVENT_WINDOW_DESTROYED = sdl.SDL3_EVENT_WINDOW_DESTROYED SDL3_EVENT_WINDOW_DISPLAY_CHANGED = sdl.SDL3_EVENT_WINDOW_DISPLAY_CHANGED SDL3_EVENT_WINDOW_DISPLAY_SCALE_CHANGED = sdl.SDL3_EVENT_WINDOW_DISPLAY_SCALE_CHANGED SDL3_EVENT_WINDOW_ENTER_FULLSCREEN = sdl.SDL3_EVENT_WINDOW_ENTER_FULLSCREEN SDL3_EVENT_WINDOW_EXPOSED = sdl.SDL3_EVENT_WINDOW_EXPOSED SDL3_EVENT_WINDOW_FOCUS_GAINED = sdl.SDL3_EVENT_WINDOW_FOCUS_GAINED SDL3_EVENT_WINDOW_FOCUS_LOST = sdl.SDL3_EVENT_WINDOW_FOCUS_LOST SDL3_EVENT_WINDOW_HDR_STATE_CHANGED = sdl.SDL3_EVENT_WINDOW_HDR_STATE_CHANGED SDL3_EVENT_WINDOW_HIDDEN = sdl.SDL3_EVENT_WINDOW_HIDDEN SDL3_EVENT_WINDOW_HIT_TEST = sdl.SDL3_EVENT_WINDOW_HIT_TEST SDL3_EVENT_WINDOW_ICCPROF_CHANGED = sdl.SDL3_EVENT_WINDOW_ICCPROF_CHANGED SDL3_EVENT_WINDOW_LEAVE_FULLSCREEN = sdl.SDL3_EVENT_WINDOW_LEAVE_FULLSCREEN SDL3_EVENT_WINDOW_MAXIMIZED = sdl.SDL3_EVENT_WINDOW_MAXIMIZED SDL3_EVENT_WINDOW_METAL_VIEW_RESIZED = sdl.SDL3_EVENT_WINDOW_METAL_VIEW_RESIZED SDL3_EVENT_WINDOW_MINIMIZED = sdl.SDL3_EVENT_WINDOW_MINIMIZED SDL3_EVENT_WINDOW_MOUSE_ENTER = sdl.SDL3_EVENT_WINDOW_MOUSE_ENTER SDL3_EVENT_WINDOW_MOUSE_LEAVE = sdl.SDL3_EVENT_WINDOW_MOUSE_LEAVE SDL3_EVENT_WINDOW_MOVED = sdl.SDL3_EVENT_WINDOW_MOVED SDL3_EVENT_WINDOW_OCCLUDED = sdl.SDL3_EVENT_WINDOW_OCCLUDED SDL3_EVENT_WINDOW_PIXEL_SIZE_CHANGED = sdl.SDL3_EVENT_WINDOW_PIXEL_SIZE_CHANGED SDL3_EVENT_WINDOW_RESIZED = sdl.SDL3_EVENT_WINDOW_RESIZED SDL3_EVENT_WINDOW_RESTORED = sdl.SDL3_EVENT_WINDOW_RESTORED SDL3_EVENT_WINDOW_SAFE_AREA_CHANGED = sdl.SDL3_EVENT_WINDOW_SAFE_AREA_CHANGED SDL3_EVENT_WINDOW_SHOWN = sdl.SDL3_EVENT_WINDOW_SHOWN SDL3_GL_CONTEXT_MAJOR_VERSION = sdl.SDL3_GL_CONTEXT_MAJOR_VERSION SDL3_GL_CONTEXT_MINOR_VERSION = sdl.SDL3_GL_CONTEXT_MINOR_VERSION SDL3_GL_CONTEXT_PROFILE_ES = sdl.SDL3_GL_CONTEXT_PROFILE_ES SDL3_GL_CONTEXT_PROFILE_MASK = sdl.SDL3_GL_CONTEXT_PROFILE_MASK SDL3_GL_MULTISAMPLEBUFFERS = sdl.SDL3_GL_MULTISAMPLEBUFFERS SDL3_GL_MULTISAMPLESAMPLES = sdl.SDL3_GL_MULTISAMPLESAMPLES SDL3_GL_SHARE_WITH_CURRENT_CONTEXT = sdl.SDL3_GL_SHARE_WITH_CURRENT_CONTEXT SDL3_INIT_VIDEO = sdl.SDL3_INIT_VIDEO SDL3_KMOD_CAPS = sdl.SDL3_KMOD_CAPS SDL3_KMOD_LALT = sdl.SDL3_KMOD_LALT SDL3_KMOD_LCTRL = sdl.SDL3_KMOD_LCTRL SDL3_KMOD_LGUI = sdl.SDL3_KMOD_LGUI SDL3_KMOD_LSHIFT = sdl.SDL3_KMOD_LSHIFT SDL3_KMOD_NUM = sdl.SDL3_KMOD_NUM SDL3_KMOD_RALT = sdl.SDL3_KMOD_RALT SDL3_KMOD_RCTRL = sdl.SDL3_KMOD_RCTRL SDL3_KMOD_RGUI = sdl.SDL3_KMOD_RGUI SDL3_KMOD_RSHIFT = sdl.SDL3_KMOD_RSHIFT SDL3_KMOD_SCROLL = sdl.SDL3_KMOD_SCROLL SDL3_SCANCODE_0 = sdl.SDL3_SCANCODE_0 SDL3_SCANCODE_1 = sdl.SDL3_SCANCODE_1 SDL3_SCANCODE_2 = sdl.SDL3_SCANCODE_2 SDL3_SCANCODE_3 = sdl.SDL3_SCANCODE_3 SDL3_SCANCODE_4 = sdl.SDL3_SCANCODE_4 SDL3_SCANCODE_5 = sdl.SDL3_SCANCODE_5 SDL3_SCANCODE_6 = sdl.SDL3_SCANCODE_6 SDL3_SCANCODE_7 = sdl.SDL3_SCANCODE_7 SDL3_SCANCODE_8 = sdl.SDL3_SCANCODE_8 SDL3_SCANCODE_9 = sdl.SDL3_SCANCODE_9 SDL3_SCANCODE_A = sdl.SDL3_SCANCODE_A SDL3_SCANCODE_APOSTROPHE = sdl.SDL3_SCANCODE_APOSTROPHE SDL3_SCANCODE_B = sdl.SDL3_SCANCODE_B SDL3_SCANCODE_BACKSLASH = sdl.SDL3_SCANCODE_BACKSLASH SDL3_SCANCODE_BACKSPACE = sdl.SDL3_SCANCODE_BACKSPACE SDL3_SCANCODE_C = sdl.SDL3_SCANCODE_C SDL3_SCANCODE_COMMA = sdl.SDL3_SCANCODE_COMMA SDL3_SCANCODE_D = sdl.SDL3_SCANCODE_D SDL3_SCANCODE_DELETE = sdl.SDL3_SCANCODE_DELETE SDL3_SCANCODE_DOWN = sdl.SDL3_SCANCODE_DOWN SDL3_SCANCODE_E = sdl.SDL3_SCANCODE_E SDL3_SCANCODE_END = sdl.SDL3_SCANCODE_END SDL3_SCANCODE_EQUAL = sdl.SDL3_SCANCODE_EQUAL SDL3_SCANCODE_ESCAPE = sdl.SDL3_SCANCODE_ESCAPE SDL3_SCANCODE_F = sdl.SDL3_SCANCODE_F SDL3_SCANCODE_F1 = sdl.SDL3_SCANCODE_F1 SDL3_SCANCODE_F10 = sdl.SDL3_SCANCODE_F10 SDL3_SCANCODE_F11 = sdl.SDL3_SCANCODE_F11 SDL3_SCANCODE_F12 = sdl.SDL3_SCANCODE_F12 SDL3_SCANCODE_F2 = sdl.SDL3_SCANCODE_F2 SDL3_SCANCODE_F3 = sdl.SDL3_SCANCODE_F3 SDL3_SCANCODE_F4 = sdl.SDL3_SCANCODE_F4 SDL3_SCANCODE_F5 = sdl.SDL3_SCANCODE_F5 SDL3_SCANCODE_F6 = sdl.SDL3_SCANCODE_F6 SDL3_SCANCODE_F7 = sdl.SDL3_SCANCODE_F7 SDL3_SCANCODE_F8 = sdl.SDL3_SCANCODE_F8 SDL3_SCANCODE_F9 = sdl.SDL3_SCANCODE_F9 SDL3_SCANCODE_G = sdl.SDL3_SCANCODE_G SDL3_SCANCODE_GRAVE = sdl.SDL3_SCANCODE_GRAVE SDL3_SCANCODE_H = sdl.SDL3_SCANCODE_H SDL3_SCANCODE_HOME = sdl.SDL3_SCANCODE_HOME SDL3_SCANCODE_I = sdl.SDL3_SCANCODE_I SDL3_SCANCODE_INSERT = sdl.SDL3_SCANCODE_INSERT SDL3_SCANCODE_J = sdl.SDL3_SCANCODE_J SDL3_SCANCODE_K = sdl.SDL3_SCANCODE_K SDL3_SCANCODE_KP_0 = sdl.SDL3_SCANCODE_KP_0 SDL3_SCANCODE_KP_1 = sdl.SDL3_SCANCODE_KP_1 SDL3_SCANCODE_KP_2 = sdl.SDL3_SCANCODE_KP_2 SDL3_SCANCODE_KP_3 = sdl.SDL3_SCANCODE_KP_3 SDL3_SCANCODE_KP_4 = sdl.SDL3_SCANCODE_KP_4 SDL3_SCANCODE_KP_5 = sdl.SDL3_SCANCODE_KP_5 SDL3_SCANCODE_KP_6 = sdl.SDL3_SCANCODE_KP_6 SDL3_SCANCODE_KP_7 = sdl.SDL3_SCANCODE_KP_7 SDL3_SCANCODE_KP_8 = sdl.SDL3_SCANCODE_KP_8 SDL3_SCANCODE_KP_9 = sdl.SDL3_SCANCODE_KP_9 SDL3_SCANCODE_KP_COMMA = sdl.SDL3_SCANCODE_KP_COMMA SDL3_SCANCODE_KP_DIVIDE = sdl.SDL3_SCANCODE_KP_DIVIDE SDL3_SCANCODE_KP_ENTER = sdl.SDL3_SCANCODE_KP_ENTER SDL3_SCANCODE_KP_EQUALS = sdl.SDL3_SCANCODE_KP_EQUALS SDL3_SCANCODE_KP_MINUS = sdl.SDL3_SCANCODE_KP_MINUS SDL3_SCANCODE_KP_MULTIPLY = sdl.SDL3_SCANCODE_KP_MULTIPLY SDL3_SCANCODE_KP_PERIOD = sdl.SDL3_SCANCODE_KP_PERIOD SDL3_SCANCODE_KP_PLUS = sdl.SDL3_SCANCODE_KP_PLUS SDL3_SCANCODE_L = sdl.SDL3_SCANCODE_L SDL3_SCANCODE_LALT = sdl.SDL3_SCANCODE_LALT SDL3_SCANCODE_LCTRL = sdl.SDL3_SCANCODE_LCTRL SDL3_SCANCODE_LEFT = sdl.SDL3_SCANCODE_LEFT SDL3_SCANCODE_LEFTBRACKET = sdl.SDL3_SCANCODE_LEFTBRACKET SDL3_SCANCODE_LGUI = sdl.SDL3_SCANCODE_LGUI SDL3_SCANCODE_LSHIFT = sdl.SDL3_SCANCODE_LSHIFT SDL3_SCANCODE_M = sdl.SDL3_SCANCODE_M SDL3_SCANCODE_MINUS = sdl.SDL3_SCANCODE_MINUS SDL3_SCANCODE_N = sdl.SDL3_SCANCODE_N SDL3_SCANCODE_O = sdl.SDL3_SCANCODE_O SDL3_SCANCODE_P = sdl.SDL3_SCANCODE_P SDL3_SCANCODE_PAGEDOWN = sdl.SDL3_SCANCODE_PAGEDOWN SDL3_SCANCODE_PAGEUP = sdl.SDL3_SCANCODE_PAGEUP SDL3_SCANCODE_PAUSE = sdl.SDL3_SCANCODE_PAUSE SDL3_SCANCODE_PERIOD = sdl.SDL3_SCANCODE_PERIOD SDL3_SCANCODE_Q = sdl.SDL3_SCANCODE_Q SDL3_SCANCODE_R = sdl.SDL3_SCANCODE_R SDL3_SCANCODE_RALT = sdl.SDL3_SCANCODE_RALT SDL3_SCANCODE_RCTRL = sdl.SDL3_SCANCODE_RCTRL SDL3_SCANCODE_RETURN = sdl.SDL3_SCANCODE_RETURN SDL3_SCANCODE_RGUI = sdl.SDL3_SCANCODE_RGUI SDL3_SCANCODE_RIGHT = sdl.SDL3_SCANCODE_RIGHT SDL3_SCANCODE_RIGHTBRACKET = sdl.SDL3_SCANCODE_RIGHTBRACKET SDL3_SCANCODE_RSHIFT = sdl.SDL3_SCANCODE_RSHIFT SDL3_SCANCODE_S = sdl.SDL3_SCANCODE_S SDL3_SCANCODE_SEMICOLON = sdl.SDL3_SCANCODE_SEMICOLON SDL3_SCANCODE_SLASH = sdl.SDL3_SCANCODE_SLASH SDL3_SCANCODE_SPACE = sdl.SDL3_SCANCODE_SPACE SDL3_SCANCODE_T = sdl.SDL3_SCANCODE_T SDL3_SCANCODE_TAB = sdl.SDL3_SCANCODE_TAB SDL3_SCANCODE_U = sdl.SDL3_SCANCODE_U SDL3_SCANCODE_UP = sdl.SDL3_SCANCODE_UP SDL3_SCANCODE_V = sdl.SDL3_SCANCODE_V SDL3_SCANCODE_W = sdl.SDL3_SCANCODE_W SDL3_SCANCODE_X = sdl.SDL3_SCANCODE_X SDL3_SCANCODE_Y = sdl.SDL3_SCANCODE_Y SDL3_SCANCODE_Z = sdl.SDL3_SCANCODE_Z SDL3_WINDOW_BORDERLESS = sdl.SDL3_WINDOW_BORDERLESS SDL3_WINDOW_FULLSCREEN = sdl.SDL3_WINDOW_FULLSCREEN SDL3_WINDOW_HIDDEN = sdl.SDL3_WINDOW_HIDDEN SDL3_WINDOW_OCCLUDED = sdl.SDL3_WINDOW_OCCLUDED SDL3_WINDOW_OPENGL = sdl.SDL3_WINDOW_OPENGL SDL3_WINDOW_RESIZABLE = sdl.SDL3_WINDOW_RESIZABLE SDL3_WINDOW_TRANSPARENT = sdl.SDL3_WINDOW_TRANSPARENT SDL_GL_CONTEXT_MAJOR_VERSION = sdl.SDL_GL_CONTEXT_MAJOR_VERSION SDL_GL_CONTEXT_MINOR_VERSION = sdl.SDL_GL_CONTEXT_MINOR_VERSION SDL_GL_CONTEXT_PROFILE_ES = sdl.SDL_GL_CONTEXT_PROFILE_ES SDL_GL_CONTEXT_PROFILE_MASK = sdl.SDL_GL_CONTEXT_PROFILE_MASK SDL_HITTEST_DRAGGABLE = sdl.SDL_HITTEST_DRAGGABLE SDL_HITTEST_NORMAL = sdl.SDL_HITTEST_NORMAL SDL_HITTEST_RESIZE_LEFT = sdl.SDL_HITTEST_RESIZE_LEFT SDL_HITTEST_RESIZE_TOPLEFT = sdl.SDL_HITTEST_RESIZE_TOPLEFT SDL_INIT_VIDEO = sdl.SDL_INIT_VIDEO SDL_KEYDOWN = sdl.SDL_KEYDOWN SDL_KEYUP = sdl.SDL_KEYUP SDL_MOUSEBUTTONDOWN = sdl.SDL_MOUSEBUTTONDOWN SDL_MOUSEBUTTONUP = sdl.SDL_MOUSEBUTTONUP SDL_MOUSEMOTION = sdl.SDL_MOUSEMOTION SDL_QUIT = sdl.SDL_QUIT SDL_WINDOWEVENT = sdl.SDL_WINDOWEVENT SDL_WINDOW_OPENGL = sdl.SDL_WINDOW_OPENGL SDL_WINDOW_SHOWN = sdl.SDL_WINDOW_SHOWN )
const ( GLProfileCore = sdl.GLProfileCore GLProfileCompatibility = sdl.GLProfileCompatibility GLProfileES = sdl.GLProfileES )
const GL_UNSIGNED_SHORT = 0x1403
GL constant used by the indexed batch path.
const MaxGradientStops = 16
MaxGradientStops caps a gradient's stops. The ramp is rasterised into a 256-wide LUT row, so more stops than that would not be resolvable anyway.
Variables ¶
This section is empty.
Functions ¶
func AcquireRenderer ¶
func AcquireRenderer()
AcquireRenderer locks the global render pipeline. Call before any batch accumulation and hold through Swap/flush. See renderMu.
func AntialiasPreference ¶
func AntialiasPreference() bool
AntialiasPreference reports the current preference.
func AppEventWatchAvailable ¶
func AppEventWatchAvailable() bool
func AppEventWatchInstalled ¶
func AppEventWatchInstalled() bool
func BeginBlur ¶
func BeginBlur()
BeginBlur redirects rendering to the FBO texture for offscreen capture.
func Blur ¶
func Blur(radius float32)
Blur applies a separable Gaussian blur to the current framebuffer contents
func CapHeightPx ¶
CapHeightPx measures the 'H' cap height in px for a truetype font at the given em size. Returns 0 if it cannot be measured.
func ClearScissor ¶
func ClearScissor()
func ClearScreen ¶
func ClearScreen(col uint32)
func CompileGeneratedGLSL ¶ added in v0.2.0
CompileGeneratedGLSL compiles and links one generated GLSL 330 program from meui-shaders. It is the probe used before the renderer migrates a pipeline.
func CreateOffscreenFBO ¶
func CurClipQuad ¶
curClipQuad returns the active clip as (minX, minY, maxX, maxY) in GL window coords for stamping into per-vertex clip attributes. CurClipQuad exposes the per-vertex clip stamp for diagnostics — the same value appendWithClip and SDFBatchTexturedQuads put on every vertex. Exported like DefaultReadFBO, for probes that need to see what a draw was stamped with.
func DefaultReadFBO ¶
func DefaultReadFBO() int32
DefaultReadFBO reports the framebuffer binding captured at package init, which the offscreen helpers rebind as "the default framebuffer". It is exposed so a probe can confirm what it actually holds: 0 is each context's own drawable (per-context-correct), while any other value would be a binding captured in some other context and would be wrong to rebind here.
func DeleteOffscreenFBO ¶
func DeleteOffscreenFBO(fbo, tex uint32)
func DescentPx ¶
DescentPx returns the font's descent (distance below baseline) in px at the given em size. Prefers hhea metrics (what skia reports to unison); falls back to the global glyph bounding box.
func DrawCircleGL ¶
func DrawLineGL ¶
func DrawOvalGL ¶
func DrawRectGL ¶
Drawing helpers for platform backends.
func DrawTexturedQuadsBatch ¶
DrawTexturedQuadsBatch appends textured quads to the frame batch.
func DrawTrianglesBatch ¶
DrawTrianglesBatch appends triangles to the frame batch (for AndroidRenderer).
func DumpRenderState ¶
func DumpRenderState(where string)
DumpRenderState prints the process-global render state that is neither per-context GL state nor covered by InvalidateGLStateCache: the screen-size uniforms, the FBO currently bound, and the clip-discard flag and plane table.
The offscreen pass (RenderOffscreen) runs in the middle of a window's frame and mutates all of these; the window that performed it then looks fine while the windows painted after it break, which points at state consumed at the START of the next frame. Comparing this line across an offscreen pass and the next ClearWithViewport is how that state is found. Gated by MEUI_STATE_TRACE.
func EffectiveSize ¶
func EmbeddedRobotoFace ¶
EmbeddedRobotoFace returns the embedded Roboto face for a style suffix ("Light", "Bold", "Bold Italic", …) with "Regular" fallback.
func EndBlur ¶
func EndBlur(radius float32)
EndBlur unbinds the FBO and blurs the result to the screen.
func EraseRoundedCorners ¶
EraseRoundedCorners zeroes the framebuffer alpha outside the rounded rect (x, y, w, h) at the given radius. topOnly extends the shape below the window so only the top corners round. Call after all content for the frame has been batched; the pending batches are flushed first, then the erase quad is drawn with erase blending.
func ErrOffscreenFailed ¶
func ErrOffscreenFailed() error
func FlushBatches ¶
func FlushBatches()
func FontMetricsRatios ¶
FontMetricsRatios returns the hhea-derived ascent/descent ratios for a parsed font (0 values if unknown).
func GLClearDepth ¶
func GLClearDepth()
func GLDepthTest ¶
func GLDepthTest(enabled bool)
func GLDepthWrite ¶
func GLDepthWrite(enabled bool)
func GLInfo ¶
func GLInfo() (vendor, renderer, version string)
GLInfo returns the driver's vendor, renderer and version strings.
func GLXDrawableSize ¶
GLXDrawableSize reports the size of the GLX drawable current on this thread, as the X server sees it. ok is false when the probe is unavailable (no GLX symbol, no current context, or the server refuses the query) - never silently (0,0,true).
func GaussianWeights ¶
GaussianWeights calculates normalized Gaussian weights for blur kernel
func GetClipboardText ¶
func GetClipboardText() string
func GetError ¶
func GetError() uint32
GetError returns the current OpenGL error (0 means no error).
func GetGL3ProcAddress ¶
Compatibility helpers for the renderer's existing call sites.
func GlobalAlphaPreference ¶
func GlobalAlphaPreference() float32
GlobalAlphaPreference reports the current alpha multiplier.
func GlobalMousePos ¶
func HasEGLSupport ¶
func HasEGLSupport() bool
HasEGLSupport returns true if EGL/GLES libraries were loaded successfully
func HasGLSupport ¶
func HasGLSupport() bool
HasGLSupport returns true if desktop OpenGL is available
func Init ¶
func Init() error
Init loads OpenGL ES symbols from the system libraries using purego. This must be called before any GLES functions are used.
func InitEGLForAndroid ¶
InitEGLForAndroid initializes EGL for an Android ANativeWindow. window is the ANativeWindow pointer passed from JNI. After success, GL function pointers are loaded via eglGetProcAddress.
func InitRenderer ¶
func InitRenderer() error
func InitWindowError ¶
func InitWindowError() error
func InvalidateGLStateCache ¶
func InvalidateGLStateCache()
InvalidateGLStateCache resets every cached GL binding after a context switch. GL state is PER-CONTEXT: the caches describe the previous context — a flush after MakeCurrent(otherCtx) would skip re-binding program/VBO/IBO/attribs and draw with this context's defaults (null attrib pointers → driver SIGSEGV).
func KnownCursorNames ¶
func KnownCursorNames() []string
func LoadGLESFromLib ¶
func LoadGLESFromLib(lib uintptr)
LoadGLESFromLib registers all GLES function pointers from a loaded library handle. Used by platform backends (e.g. Android) to load GL functions after EGL init.
func MaxTextureUnits ¶
func MaxTextureUnits() int
MaxTextureUnits reports GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, which bounds how many distinct textures one batch can sample.
func MaxTexturesPerBatch ¶
func MaxTexturesPerBatch() int
MaxTexturesPerBatch reports how many distinct textures one unified batch can sample before it flushes and starts a new sampler-unit table.
func MaxVertexAttribs ¶
func MaxVertexAttribs() int
MaxVertexAttribs reports GL_MAX_VERTEX_ATTRIBS, or 0 when it cannot be read. The unified SDF batch uses 16 attributes, so on a driver reporting fewer the gradient attributes would silently not bind.
func MouseLeftDown ¶
func MouseLeftDown() bool
func MoveResizeSDLWin ¶
func MoveSDLWinBy ¶
func NoteResizeAck ¶
func PendingBatchVerts ¶
func PendingBatchVerts() int
PendingBatchVerts reports how many vertices are still queued in ANY of the process-global batches (SDF shapes/text/images, triangles, immediate shapes) and therefore not yet submitted to GL.
The batches are process-global and their vertices are stamped with the CURRENT window's projection and clip, so a non-zero count at a frame boundary means work that belongs to the window that just drew: presenting the buffer with a non-empty batch defers that work into whatever frame (usually another window) flushes next. It must be 0 before every Swap.
func PrimarySDLWindowPointer ¶
func ProbeFullClear ¶
ProbeFullClear paints the ENTIRE claimed surface (viewport w x h, scissor and stencil off) a distinctive colour, then reads one pixel near the top row and one near the bottom. If a 520x620 window's back buffer is really 520x380, the clear fills only the bottom 380 rows and the read at y=610 is outside it. This separates "the surface is smaller than the window" from "the surface is fine and the fragments are being rejected", which no existing instrument could tell apart because every one of them reads through the same glReadPixels.
func ProcessEvents ¶
func ProcessEvents(w *Window)
func ProcessEventsAndDispatch ¶
func ProcessEventsAndDispatch(w *Window)
func ReadOffscreenPixels ¶
func ReadScreenPixels ¶
ReadScreenPixels reads the default framebuffer (back buffer) as 0xAARRGGBB pixels, bottom-up as GL delivers them. Call while the GL context is current and after FlushBatches() (e.g. inside the draw callback, before the swap).
func RenderOffscreen ¶
func ResetClipState ¶
func ResetClipState()
ResetClipState clears the Go-side clip mirror at the start of a window's frame. scissorState is process-global and is stamped into every batched vertex (clipMin/clipMax); without a per-frame reset a window's early draws (title bar, panel background) inherit the PREVIOUS window's last clip rect — everything outside it is shader-discarded and edge primitives clip into garbage shapes (observed: window 2 rendered exactly one triangle — the stale rect).
func ResetGLCache ¶
func ResetGLCache()
ResetGLCache resets all cached GL state (call after any external GL code).
func ResetSizeProbe ¶
func ResetSizeProbe()
func ResizeWindow ¶
func RunHeadlessDemo ¶
func RunHeadlessDemo(w *Window)
func SDFBatchRect ¶
SDFBatchRect appends an axis-aligned rect / rounded rect / circle to the batch. x,y,w,h are SCREEN pixels; radius 0 = sharp box, radius = min(w,h)/2 = circle/oval. Call on the GL thread.
func SDFBatchTexturedQuads ¶
SDFBatchTexturedQuads appends glyph (mode 1) or image (mode 2) quads to the unified SDF batch. verts holds 4 indexed vertices per quad, 8 floats each: pos2 uv2 color4. Blending is unified to premultiplied (ONE, ONE_MINUS_SRC_ALPHA) — the glyph/image shader paths output premultiplied color, and the SDF shape path premultiplies in the fragment shader, so one batch can interleave shapes, text and images in exact draw order with a single draw call.
func SDFBatchTriangles ¶
func SDFBatchTriangles(verts []float32)
SDFBatchTriangles appends barycentric-AA triangles to the unified batch (mode 3). verts holds 9 floats per vertex: pos2 bary3 color4. Each triangle is padded to a 4-vertex quad so the shared quad index buffer applies: (v0,v1,v2) + degenerate (v1,v3,v2) with v3=v2 — the original triangle rasterizes unchanged and the degenerate half covers nothing.
func SetAntialiasPreference ¶
func SetAntialiasPreference(on bool)
SetAntialiasPreference sets the antialiasing stamped into subsequently batched primitives. Text and image quads ignore it: they sample a texture and have no edge ramp of their own.
func SetAppEventHandler ¶
func SetAppEventHandler(fn func(Event))
func SetBlendModeCached ¶
func SetBlendModeCached(mode int32)
SetBlendModeCached sets the blend mode only if it has changed.
func SetClipDiscardEnabled ¶
func SetClipDiscardEnabled(on bool)
SetClipDiscardEnabled toggles the batch shaders' per-vertex clip discard. Offscreen rendering turns it off.
func SetClipPlanes ¶
func SetClipPlanes(planes []ClipPlane)
SetClipPlanes replaces the path clip. It is the renderer-side mirror the batched shaders read; the toolkit updates it whenever the effective clip changes.
func SetClipboardText ¶
func SetClipboardText(s string)
func SetCurrentGradient ¶
func SetCurrentGradient(g Gradient)
SetCurrentGradient publishes the gradient for subsequently batched primitives; the zero Gradient means solid colour.
func SetCursorByName ¶
func SetCursorByName(s string)
func SetFullscreen ¶
func SetGLContextVersion ¶ added in v0.2.2
GL context version selection (see meui-sdl).
func SetGlobalAlphaPreference ¶
func SetGlobalAlphaPreference(a float32)
SetGlobalAlphaPreference sets the alpha multiplier applied to subsequently batched primitives. The legacy immediate paths (gradient rects) ignore it.
func SetRendererFactory ¶
func SetRendererFactory(f func() Renderer)
SetRendererFactory installs the constructor used for the process renderer. Call it before InitRenderer.
func SetScissor ¶
func SetScissor(x, y, w, h int32)
func SetScreenSize ¶
func SetScreenSize(w, h float32)
func SetSensorHandler ¶
func SetSwapInterval0 ¶
func SetSwapInterval0()
func SetSystemFont ¶
func SetWindowHitHandler ¶
func SetWindowSizeSDLWin ¶
func SwapEGLBuffers ¶
func SwapEGLBuffers()
SwapEGLBuffers swaps the EGL buffers (call after rendering)
func SwapWindow ¶
func SwapWindow()
func UseProgramCached ¶
func UseProgramCached(program uint32)
UseProgramCached calls glUseProgram only if the program has changed.
func VideoDriver ¶
func VideoDriver() string
func WindowMaximized ¶
func WindowSize ¶
Types ¶
type BlendMode ¶
type BlendMode int
BlendMode defines blend modes
const ( BlendModeNormal BlendMode = iota BlendModeMultiply BlendModeScreen BlendModeOverlay BlendModeDarken BlendModeLighten BlendModeColorDodge BlendModeColorBurn BlendModeHardLight BlendModeSoftLight BlendModeDifference BlendModeExclusion BlendModeHue BlendModeSaturation BlendModeColor BlendModeLuminosity )
type BlurRenderer ¶
type BlurRenderer struct {
// contains filtered or unexported fields
}
type Canvas ¶
type Canvas struct {
// contains filtered or unexported fields
}
Canvas is a simplified drawing surface for OpenGL ES. This is a subset of unison.Canvas methods needed for MeUi.
func (*Canvas) ClearWithViewport ¶
ClearWithViewport clears the canvas with a color and sets viewport
func (*Canvas) ClipBounds ¶
ClipBounds returns the current clip bounds.
func (*Canvas) ClipDepth ¶
ClipDepth returns the current clip-stack depth. Debug aid for hunting widgets that push a clip without popping it.
func (*Canvas) ClipPath ¶
ClipPath intersects the clip with the interior of path, transformed by the current matrix.
It reports whether the clip is EXACT. Clipping is applied as per-vertex half-planes, which express any convex outline; a concave outline is clipped to its convex hull, and an outline needing more than maxClipPlanes edges is clipped to its bounding rectangle instead. Both fallbacks are supersets of the requested region, so content the caller asked to keep is never hidden — the clip can only ever show a little more than asked, never less — but both report false.
func (*Canvas) DrawCircle ¶
DrawCircle draws a filled circle at (cx, cy) with radius r.
func (*Canvas) DrawCirclePath ¶
func (*Canvas) DrawColor ¶
DrawColor fills the entire canvas with a color using the specified blend mode.
func (*Canvas) DrawImage ¶
DrawImage draws an image at the given position DrawImage draws an image at the given position (no scaling).
func (*Canvas) DrawImageInRect ¶
DrawImageInRect draws an image scaled to fit the given rectangle. Uploads the image as a GL_RGBA texture and renders via textured quads.
func (*Canvas) DrawImageNine ¶
DrawImageNine draws a 9-patch image. The source image is divided into 9 regions by centerRect (in pixel coordinates). The four corners are drawn at their natural size, edges stretch along one axis, and the center stretches in both directions.
func (*Canvas) DrawLineRotated ¶
DrawLineRotated draws a rotated line starting at (x, y)
func (*Canvas) DrawPath ¶
DrawPath draws a path by splitting into contours, flattening curves, triangulating each contour with earcut, and submitting triangles to the GPU.
func (*Canvas) DrawPoints ¶
QuickRejectPath returns true if the path bounds are entirely outside the current clip. DrawPoints renders a batch of points as filled circles.
func (*Canvas) DrawRect ¶
DrawRect draws a rectangle at (x, y) with given width and height. Triangulated into 2 triangles and accumulated in the frame batch.
func (*Canvas) DrawRoundedRect ¶
DrawRoundedRect draws a rectangle with rounded corners DrawRoundedRect draws a rounded rectangle using a path with corner arcs. Reuses the existing path rendering pipeline for proper edge AA.
func (*Canvas) DrawSimpleString ¶
DrawSimpleString draws simple text using the system font
func (*Canvas) DrawTriangleFilled ¶
DrawTriangleFilled fills one triangle. Like every other Canvas entry point it takes LOCAL coordinates and applies the canvas transform itself — the stroke walk's joins pass the same local points it hands to DrawLine, and a triangle that skipped the transform landed a whole view offset away from its own stroke (visible as flecks of cable colour on the canvas).
func (*Canvas) DropShadow ¶
DropShadow draws a blurred drop shadow using the FBO pipeline. The shadow shape is rendered offset, then blurred, composited back to screen. Call between BeginBlur/EndBlur for the blurred background shape. Uses the 2-pass separable Gaussian blur for smooth edges.
func (*Canvas) IsClipEmpty ¶
IsClipEmpty returns true if the current clip is empty.
func (*Canvas) QuickRejectRect ¶
QuickRejectRect returns true if the rect is entirely outside the current clip.
func (*Canvas) ResetClip ¶
func (c *Canvas) ResetClip()
ResetClip drops any active clip and returns the canvas to an unclipped state: the clip stack is cleared and the process-global scissor mirror (stamped into every batched vertex) is reset. Used by callers that draw OUTSIDE a content tree — window title bars — so a leaked content clip (a widget's ClipRect without a matching Restore) cannot discard the bar's primitives.
func (*Canvas) Restore ¶
func (c *Canvas) Restore()
Restore restores the state to the most recent Save: the matrix/paint stacks pop one entry and the clip stack pops back to the length recorded at that Save (removing every ClipRect pushed since).
func (*Canvas) RestoreToCount ¶
RestoreToCount restores to a specific save count.
func (*Canvas) SaveAndRestore ¶
SaveAndRestore runs f inside a Save/Restore pair — the transaction form of Save: every state change f makes (clips, transforms) is rolled back when it returns, even on early paths. Prefer this over bare Save/Restore in widget paints; it cannot leak stack entries.
func (*Canvas) TransformRect ¶
TransformRect is the public version of transformRect, used by meuishim.
func (*Canvas) Width ¶
Width returns the canvas width in pixels. Clip reset bounds derive from it, so a canvas must be recreated when its window resizes.
func (*Canvas) WithClip ¶
WithClip intersects the clip with r (top-down canvas coords) for the duration of f, then restores the previous clip. The transaction form of ClipRect: drawing with a clip can no longer leak stack entries (the historic TextField bug — every paint pushed a clip that was never popped, poisoning everything painted after it).
type ClipPlane ¶
type ClipPlane struct {
NX, NY, D float32
}
ClipPlane is one half-plane of a convex clip, in DEVICE space (GL window coordinates, y increasing upward). A pixel is kept when
NX*x + NY*y + D >= 0
Planes are always combined by intersection.
func ClipPlanes ¶
func ClipPlanes() []ClipPlane
ClipPlanes returns the current path clip (nil when only the rect applies).
type DesktopRenderer ¶
type DesktopRenderer struct{}
DesktopRenderer implements Renderer using the existing OpenGL globals.
func (*DesktopRenderer) ClearScissor ¶
func (d *DesktopRenderer) ClearScissor()
func (*DesktopRenderer) ClearWithViewport ¶
func (d *DesktopRenderer) ClearWithViewport(col uint32, x, y, w, h int32)
ClearWithViewport clears the surface and sets the viewport. Clears must never be scissored: batch flushes leave the scissor enabled, and on a fresh context the scissor box is stale, which would leave the rest of the buffer showing uninitialized surface garbage.
func (*DesktopRenderer) DrainErrors ¶
func (d *DesktopRenderer) DrainErrors()
func (*DesktopRenderer) DrawCircle ¶
func (d *DesktopRenderer) DrawCircle(cx, cy, radius float32, color Color)
func (*DesktopRenderer) DrawColor ¶
func (d *DesktopRenderer) DrawColor(col uint32, mode BlendMode)
DrawColor fills the whole surface with col using the given blend mode. It is the legacy immediate path (the rect program), kept behind the interface so Canvas owns no GL state of its own.
func (*DesktopRenderer) DrawLine ¶
func (d *DesktopRenderer) DrawLine(x1, y1, x2, y2 float32, color Color, strokeW float32)
func (*DesktopRenderer) DrawOval ¶
func (d *DesktopRenderer) DrawOval(x, y, w, h float32, color Color)
func (*DesktopRenderer) DrawPathFill ¶
func (d *DesktopRenderer) DrawPathFill(tris []float32, color Color, bounds Rect)
func (*DesktopRenderer) DrawRect ¶
func (d *DesktopRenderer) DrawRect(x, y, w, h float32, color Color, angle float32)
func (*DesktopRenderer) DrawRectStyled ¶
func (d *DesktopRenderer) DrawRectStyled(x, y, w, h, radius, strokeW float32, color Color, style int32, angle float32)
func (*DesktopRenderer) DrawTexturedQuads ¶
func (d *DesktopRenderer) DrawTexturedQuads(verts []float32, texID uint32, color Color, isImage bool)
func (*DesktopRenderer) DrawTriangles ¶
func (d *DesktopRenderer) DrawTriangles(verts []float32, color Color)
func (*DesktopRenderer) Flush ¶
func (d *DesktopRenderer) Flush()
func (*DesktopRenderer) Present ¶
func (d *DesktopRenderer) Present()
func (*DesktopRenderer) ScissorState ¶
func (*DesktopRenderer) ScreenSize ¶
func (d *DesktopRenderer) ScreenSize() (float32, float32)
func (*DesktopRenderer) SetBlendMode ¶
func (d *DesktopRenderer) SetBlendMode(mode BlendMode)
SetBlendMode selects how subsequent draws composite. The GL blend state is global while draws are batched, so a mode change is a batch boundary: the pending batch is flushed under the old mode first.
func (*DesktopRenderer) SetScissor ¶
func (d *DesktopRenderer) SetScissor(x, y, w, h int32)
func (*DesktopRenderer) SetScreenSize ¶
func (d *DesktopRenderer) SetScreenSize(w, h float32)
func (*DesktopRenderer) SetViewport ¶
func (d *DesktopRenderer) SetViewport(x, y, w, h int32)
type EGLContext ¶
type EGLContext struct {
// contains filtered or unexported fields
}
EGLContext holds EGL display, context, and surface
type ErrNotSupported ¶
type ErrNotSupported struct {
Platform string
}
ErrNotSupported indicates a backend is not available on this platform.
func (*ErrNotSupported) Error ¶
func (e *ErrNotSupported) Error() string
type EventQueue ¶
type EventQueue = sdl.EventQueue
Compatibility aliases while the GL backend switches to meui-sdl.
type EventSource ¶
type EventSource = sdl.EventSource
Compatibility aliases while the GL backend switches to meui-sdl.
type Font ¶
type Font struct {
// contains filtered or unexported fields
}
Font holds font data for GPU-accelerated text rendering
func NewFontStyled ¶
func NewFontStyled(family string, size float32, face *truetype.Font, fakeBold, fakeItalic bool) *Font
NewFontStyled creates a font, optionally with synthetic bold/italic (rasterized emboldening/shear for faces lacking real companions — Skia-style synthesis). Styled variants get their own atlas.
func (*Font) Baseline ¶
Baseline returns the baseline that vertically centers text optically. Widget code centers with (h - LineHeight)/2 + Baseline; using the font bbox ascent here (bounds.Max.Y ≈ 1.23em — accent headroom over ALL glyphs) pushed every centered label ~3.5px below the box center. The correct value is the line-box midpoint plus half the cap height, with cap height measured from the rasterized 'H' glyph.
func (*Font) Descriptor ¶
func (f *Font) Descriptor() FontDescriptor
Descriptor returns the font descriptor
func (*Font) LineHeight ¶
LineHeight returns the font line height
func (*Font) TextWidth ¶
TextWidth measures with the SAME engine that draws: the glyph atlas. It mirrors DrawText's pen walk exactly (kern + whole-pixel atlas advance per glyph, same skips and same nil fallback) so measurement can never drift from rendering — synthetic styles included, since their advance adjustments live in the atlas itself. Returns the widest line.
type FontDescriptor ¶
FontDescriptor describes a font
type FrameStats ¶
FrameStats is a snapshot of renderer activity counters.
type GPUTimer ¶
type GPUTimer struct {
// contains filtered or unexported fields
}
GPUTimer provides GPU-side timing for profiling shader performance.
func (*GPUTimer) Nanoseconds ¶
Nanoseconds returns the elapsed GPU time in nanoseconds. Returns 0 if the result is not yet available.
type Gradient ¶
type Gradient struct {
Type GradientType
Stops [MaxGradientStops]GradientStop
StopCount int
Start, End Point
Center Point
Radius float32
StartAngle float32
}
Gradient describes a multi-stop colour gradient for fills and strokes.
Linear: ramp runs from Start to End. Radial: ramp runs from Center out to Radius. Conic: ramp sweeps around Center, starting at StartAngle degrees.
Stops are kept sorted by Offset so sampleGradientStops can walk them.
func CurrentGradient ¶
func CurrentGradient() Gradient
CurrentGradient returns the published gradient.
func (*Gradient) SetStops ¶
func (g *Gradient) SetStops(stops []GradientStop)
SetStops replaces the gradient's stops, sorted by offset so the ramp is well defined. Fewer than two stops leaves it a flat fill of the first.
type GradientStop ¶
GradientStop is one colour stop at Offset (0..1) along the gradient.
type GradientType ¶
type GradientType int
GradientType defines gradient shape
const ( GradientNone GradientType = iota GradientLinear GradientRadial GradientConic )
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image represents an image with texture
func NewImage ¶
NewImage creates a new image from raw ARGB data. Pixels are assumed premultiplied (the case for framebuffer readbacks); use NewImageFromPNG for straight-alpha sources.
func NewImageFromPNG ¶
NewImageFromPNG decodes a PNG from bytes
func (*Image) LogicalSize ¶
LogicalSize returns the image's dimensions as a Size. Used by meui for layout.
func (*Image) MarkPixelsDirty ¶
func (img *Image) MarkPixelsDirty()
MarkPixelsDirty flags the CPU pixel buffer as modified so the next draw re-uploads the texture. Safe to call off the GL thread.
func (*Image) SetPixels ¶
SetPixels replaces the pixel buffer, for a caller that re-renders into the same surface. The buffer must be the same size as the image: this image keeps one texture, and a different extent would be uploaded under the old shape.
func (*Image) ToPNG ¶
ToPNG encodes the image as a PNG and returns the bytes. compressionLevel: 0 = default, 1-9 = higher compression.
type InstanceData ¶
type InstanceData struct {
PosX, PosY float32
SizeX, SizeY float32
Angle float32
ColorR, ColorG float32
ColorB, ColorA float32
BlendMode int32
// contains filtered or unexported fields
}
InstanceData holds per-instance attributes for batched rendering
type Mat4 ¶
type Mat4 [16]float32
Mat4 is a 4x4 column-major matrix for 3D transforms. Layout: [col0, col1, col2, col3] where each col is 4 float32s. Index: row r, col c = m[c*4+r]
func Perspective ¶
Perspective creates a perspective projection matrix (fov in degrees)
type Matrix ¶
type Matrix [9]float32
Matrix is a 3x3 affine transformation matrix (row-major) [sx, kx, tx, ky, sy, ty, 0, 0, 1]
func RotateMatrix ¶
RotateMatrix creates a rotation matrix (degrees)
func SkewMatrix ¶
SkewMatrix creates a skew matrix (degrees for both axes)
func TranslateMatrix ¶
Translate creates a translation matrix
type Paint ¶
type Paint struct {
// contains filtered or unexported fields
}
Paint holds drawing style (subset of unison.Paint)
func (*Paint) ClearGradient ¶
func (p *Paint) ClearGradient()
ClearGradient removes any gradient from this paint.
func (*Paint) GlobalAlpha ¶
GlobalAlpha returns the alpha multiplier (1 when unset).
func (*Paint) MiterLimit ¶
MiterLimit returns the miter limit (4 when unset).
func (*Paint) SetAntialias ¶
SetAntialias turns the SDF pipeline's analytic edge ramp on or off.
func (*Paint) SetBlendMode ¶
SetBlendMode sets the blend mode
func (*Paint) SetConicGradient ¶
func (p *Paint) SetConicGradient(center Point, startAngle float32, stops []GradientStop)
SetConicGradient sets a multi-stop conic gradient sweeping around center from startAngle degrees.
func (*Paint) SetGlobalAlpha ¶
SetGlobalAlpha sets the alpha multiplier applied to everything this paint draws, on top of the colour's own alpha. Values outside 0..1 are clamped; 1 means no modulation.
func (*Paint) SetGradient ¶
SetGradient replaces the paint's gradient wholesale.
func (*Paint) SetLinearGradient ¶
func (p *Paint) SetLinearGradient(start, end Point, stops []GradientStop)
SetLinearGradient sets a multi-stop linear gradient running start→end.
func (*Paint) SetMiterLimit ¶
SetMiterLimit sets the miter limit: the longest miter allowed, as a multiple of half the stroke width, before a miter join falls back to a bevel. Values <= 0 mean the conventional default of 4.
func (*Paint) SetRadialGradient ¶
func (p *Paint) SetRadialGradient(center Point, radius float32, stops []GradientStop)
SetRadialGradient sets a multi-stop radial gradient centred at center.
func (*Paint) SetStrokeCap ¶
SetStrokeCap sets the stroke cap
func (*Paint) SetStrokeJoin ¶
func (p *Paint) SetStrokeJoin(join StrokeJoin)
SetStrokeJoin sets the stroke join
func (*Paint) SetStrokeWidth ¶
SetStrokeWidth sets the stroke width
func (*Paint) StrokeJoin ¶
func (p *Paint) StrokeJoin() StrokeJoin
StrokeJoin returns the stroke join
func (*Paint) StrokeWidth ¶
StrokeWidth returns the stroke width
type PaintStyle ¶
type PaintStyle int
PaintStyle defines fill/stroke style
const ( Fill PaintStyle = iota Stroke FillStroke )
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path represents a path with points and verbs
type Point ¶
type Point struct {
X, Y float32
}
Point represents a 2D point (compatible with toolbox/geom.Point)
type Rect ¶
Rect represents a rectangle (compatible with toolbox/geom.Rect)
func (Rect) Intersects ¶
Intersects returns true if this rectangle overlaps with other.
type RectRenderer ¶
type RectRenderer struct {
// contains filtered or unexported fields
}
type Renderer ¶
type Renderer interface {
// Lifecycle
SetScreenSize(w, h float32)
ScreenSize() (float32, float32)
// Frame control
Present()
// Surface state
ClearWithViewport(col uint32, x, y, w, h int32)
SetViewport(x, y, w, h int32)
// ScissorState reports the GL scissor box and whether the test is on.
ScissorState() (x, y, w, h int32, test bool)
// DrainErrors clears any pending GL error flags.
DrainErrors()
// State
SetBlendMode(mode BlendMode)
SetScissor(x, y, w, h int32)
ClearScissor()
// 2D drawing
DrawRect(x, y, w, h float32, color Color, angle float32)
DrawCircle(cx, cy, r float32, color Color)
DrawOval(x, y, w, h float32, color Color)
DrawLine(x1, y1, x2, y2 float32, color Color, strokeW float32)
DrawTriangles(verts []float32, color Color)
DrawTexturedQuads(verts []float32, texID uint32, color Color, isImage bool)
// DrawColor fills the whole surface with col, composited with mode.
DrawColor(col uint32, mode BlendMode)
// DrawRectStyled is the shaped-rect primitive: fill or stroke, with a
// corner radius and stroke width. It is the primitive the toolkit's rect
// drawing actually uses, so it belongs in the contract.
DrawRectStyled(x, y, w, h, radius, strokeW float32, color Color, style int32, angle float32)
// Flush emits any pending batched draws, preserving strict draw order.
Flush()
}
Renderer is the interface that Canvas uses for all GPU operations. Each platform (desktop, Android, iOS) provides its own implementation.
func NewRenderer ¶
func NewRenderer() Renderer
NewRenderer builds the process renderer from the installed factory.
type ShapeRenderer ¶
type ShapeRenderer struct {
// contains filtered or unexported fields
}
type StrokeJoin ¶
type StrokeJoin int
StrokeJoin defines line join style
const ( StrokeJoinMiter StrokeJoin = iota StrokeJoinRound StrokeJoinBevel )
type TextRenderer ¶
type TextRenderer struct {
// contains filtered or unexported fields
}
type Window ¶
Compatibility aliases while the GL backend switches to meui-sdl.
func GetMainWindow ¶
func GetMainWindow() *Window
func InitWindow ¶
Source Files
¶
- atlas.go
- backend.go
- backend_api.go
- canvas.go
- clippath.go
- dl_unix.go
- drawablesize.go
- drawablesize_glx.go
- egl_ctx.go
- embed_shaders.go
- font.go
- generated_glsl.go
- generated_rect.go
- generated_tri.go
- gl_draw.go
- gl_state.go
- gles.go
- gles_export.go
- gles_init_unix.go
- glinfo.go
- gradient_atlas.go
- missing_stubs.go
- offscreen.go
- renderer.go
- renderer_init.go
- sdf_batch.go
- sdl_compat.go
- sdl_hooks.go
- types.go