Documentation
¶
Overview ¶
Package sdlgpu is the SDL3 GPU backend for MeUI. It creates a native GPU device through SDL (Vulkan, Metal or D3D12) and presents frames through a claimed window.
This is deliberately a separate module from meui-render-gl: it does not use OpenGL or EGL, and it selects its shaders from the generated artifacts in meui-shaders.
Index ¶
- type Device
- func (d *Device) Claim(window unsafe.Pointer) error
- func (d *Device) Clear(window unsafe.Pointer, c FColor) error
- func (d *Device) Close()
- func (d *Device) CreateWindow(title string, w, h int32) unsafe.Pointer
- func (d *Device) DestroyWindow(win unsafe.Pointer)
- func (d *Device) Driver() string
- func (d *Device) ReleaseWindow(window unsafe.Pointer)
- type FColor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device owns one SDL GPU device and the windows claimed for presentation.
func New ¶
New creates a GPU device, trying every shader format SDL can provide. SDL picks the native backend (Vulkan/Metal/D3D12) from the platform.
func (*Device) Clear ¶
Clear acquires a swapchain, clears it and submits. It is the smallest real frame and is used to validate the device/window path before the full batch renderer lands.
func (*Device) CreateWindow ¶
CreateWindow creates a plain SDL window for GPU presentation. Unlike meui-sdl's InitWindow it creates no OpenGL context.
func (*Device) DestroyWindow ¶
DestroyWindow destroys a window from CreateWindow.
func (*Device) ReleaseWindow ¶
ReleaseWindow releases a claimed window.