Documentation
¶
Index ¶
- Constants
- func AcquireGPUSwapchainTexture(commandBuffer *GPUCommandBuffer, window *Window, swapchainTexture **GPUTexture, ...) bool
- func AddEventWatch(filter EventFilter, userdata unsafe.Pointer) bool
- func AddHintCallback(name string, callback HintCallback, userdata unsafe.Pointer) bool
- func AddSurfaceAlternateImage(surface, image *Surface) bool
- func AddVulkanRenderSemaphores(renderer *Renderer, waitStageMask uint32, waitSemaphore int64, ...) bool
- func AudioStreamDevicePaused(stream *AudioStream) bool
- func BindGPUFragmentSamplers(renderPass *GPURenderPass, firstSlot uint32, ...)
- func BindGPUFragmentStorageBuffers(renderPass *GPURenderPass, firstSlot uint32, storageBuffers **GPUBuffer, ...)
- func BindGPUGraphicsPipeline(renderPass *GPURenderPass, graphicsPipeline *GPUGraphicsPipeline)
- func BindGPUIndexBuffer(renderPass *GPURenderPass, binding *GPUBufferBinding, ...)
- func BindGPUVertexBuffers(renderPass *GPURenderPass, firstSlot uint32, bindings *GPUBufferBinding, ...)
- func BindGPUVertexStorageBuffers(renderPass *GPURenderPass, firstSlot uint32, storageBuffers **GPUBuffer, ...)
- func BlitSurface(src *Surface, srcrect *Rect, dst *Surface, dstrect *Rect) bool
- func CaptureMouse(enabled bool) bool
- func ClaimWindowForGPUDevice(device *GPUDevice, window *Window) bool
- func ClearAudioStream(stream *AudioStream) bool
- func ClearComposition(window *Window) bool
- func ClearError() bool
- func ClearProperty(props PropertiesID, name string) bool
- func CloseCamera(camera *Camera)
- func CloseGamepad(gamepad *Gamepad)
- func CloseIO(context *IOStream) bool
- func CloseJoystick(joystick *Joystick)
- func ConvertEventToRenderCoordinates(renderer *Renderer, event *Event) bool
- func ConvertPixels(width int32, height int32, srcFormat PixelFormat, src unsafe.Pointer, ...) bool
- func ConvertPixelsAndColorspace(width int32, height int32, srcFormat PixelFormat, srcColorspace Colorspace, ...) bool
- func CopyProperties(src PropertiesID, dst PropertiesID) bool
- func CreateWindowAndRenderer(title string, width, height int32, flags WindowFlags, window **Window, ...) bool
- func CursorVisible() bool
- func DelayNS(ns uint64)
- func DestroyAudioStream(stream *AudioStream)
- func DestroyCursor(cursor *Cursor)
- func DestroyGPUDevice(device *GPUDevice)
- func DestroyPalette(palette *Palette)
- func DestroyProperties(props PropertiesID)
- func DestroyRenderer(renderer *Renderer)
- func DestroySurface(surface *Surface)
- func DestroyTexture(texture *Texture)
- func DestroyWindow(window *Window)
- func DestroyWindowSurface(window *Window) bool
- func DisableScreenSaver() bool
- func DrawGPUIndexedPrimitives(renderPass *GPURenderPass, numIndices uint32, numInstances uint32, ...)
- func DrawGPUPrimitives(renderPass *GPURenderPass, numVertices uint32, numInstances uint32, ...)
- func EnableScreenSaver() bool
- func EndGPUCopyPass(copyPass *GPUCopyPass)
- func EndGPURenderPass(renderPass *GPURenderPass)
- func EnumerateProperties(props PropertiesID, callback EnumeratePropertiesCallback, ...) bool
- func EventEnabled(eventType EventType) bool
- func FillSurfaceRect(dst *Surface, rect *Rect, color uint32) bool
- func FilterEvents(filter EventFilter, userdata unsafe.Pointer)
- func FlashWindow(window *Window, operation FlashOperation) bool
- func FlipSurface(surface *Surface, flip FlipMode) bool
- func FlushAudioStream(stream *AudioStream) bool
- func FlushEvent(eventType EventType)
- func FlushEvents(minType, maxType EventType)
- func FlushRenderer(renderer *Renderer) bool
- func FourCC(a, b, c, d byte) uint32
- func Free(mem unsafe.Pointer)
- func GLDestroyContext(context GLContext) bool
- func GLGetAttribute(attr GLAttr, value *int32) bool
- func GLSetAttribute(attr GLAttr, value int32) bool
- func GLSetSwapInterval(interval int32) bool
- func GLSwapWindow(window *Window) bool
- func GetAppMetadataProperty(name string) string
- func GetAudioDriver(index int32) string
- func GetAudioStreamFormat(stream *AudioStream, srcSpec *AudioSpec, dstSpec *AudioSpec) bool
- func GetAudioStreamFrequencyRatio(stream *AudioStream) float32
- func GetAudioStreamGain(stream *AudioStream) float32
- func GetAudioStreamQueued(stream *AudioStream) int32
- func GetBasePath() string
- func GetBooleanProperty(props PropertiesID, name string, defaultValue bool) bool
- func GetCPUCacheLineSize() int32
- func GetCameraDriver(index int32) string
- func GetCameraFormat(camera *Camera, spec *CameraSpec) bool
- func GetCameraName(instanceId CameraID) string
- func GetClipboardText() string
- func GetClosestFullscreenDisplayMode(displayID DisplayID, w int32, h int32, refreshRate float32, ...) bool
- func GetCurrentAudioDriver() string
- func GetCurrentCameraDriver() string
- func GetCurrentDirectory() string
- func GetCurrentRenderOutputSize(renderer *Renderer, w *int32, h *int32) bool
- func GetCurrentVideoDriver() string
- func GetDefaultTextureScaleMode(renderer *Renderer, scaleMode *ScaleMode) bool
- func GetDisplayBounds(displayID DisplayID, rect *Rect) bool
- func GetDisplayContentScale(displayID DisplayID) float32
- func GetDisplayName(displayID DisplayID) string
- func GetDisplayUsableBounds(displayID DisplayID, rect *Rect) bool
- func GetError() string
- func GetEventFilter(filter *EventFilter, userdata *unsafe.Pointer) bool
- func GetFloatProperty(props PropertiesID, name string, defaultValue float32) float32
- func GetGPUDeviceDriver(device *GPUDevice) string
- func GetGPUDriver(index int32) string
- func GetGamepadName(gamepad *Gamepad) string
- func GetGamepadNameForID(instanceId JoystickID) string
- func GetGamepadSerial(gamepad *Gamepad) string
- func GetGamepadStringForButton(button GamepadButton) string
- func GetGamepadStringForType(gamepadType GamepadType) string
- func GetHint(name string) string
- func GetHintBoolean(name string, defaultValue bool) bool
- func GetJoystickAxis(joystick *Joystick, axis int32) int16
- func GetJoystickAxisInitialState(joystick *Joystick, axis int32, state *int16) bool
- func GetJoystickBall(joystick *Joystick, ball int32, dx *int32, dy *int32) bool
- func GetJoystickButton(joystick *Joystick, button int32) bool
- func GetJoystickFirmwareVersion(joystick *Joystick) uint16
- func GetJoystickHat(joystick *Joystick, hat int32) uint8
- func GetJoystickName(joystick *Joystick) string
- func GetJoystickNameForID(instanceId JoystickID) string
- func GetJoystickPath(joystick *Joystick) string
- func GetJoystickPathForID(instanceId JoystickID) string
- func GetJoystickPlayerIndex(joystick *Joystick) int32
- func GetJoystickPlayerIndexForID(instanceId JoystickID) int32
- func GetJoystickProduct(joystick *Joystick) uint16
- func GetJoystickProductForID(instanceId JoystickID) uint16
- func GetJoystickProductVersion(joystick *Joystick) uint16
- func GetJoystickProductVersionForID(instanceId JoystickID) uint16
- func GetJoystickSerial(joystick *Joystick) string
- func GetJoystickVendor(joystick *Joystick) uint16
- func GetJoystickVendorForID(instanceId JoystickID) uint16
- func GetKeyName(key Keycode) string
- func GetKeyboardNameForID(instanceId KeyboardID) string
- func GetKeyboardState() []bool
- func GetMouseNameForID(instanceId MouseID) string
- func GetNumAudioDrivers() int32
- func GetNumCameraDrivers() int32
- func GetNumGPUDrivers() int32
- func GetNumJoystickAxes(joystick *Joystick) int32
- func GetNumJoystickBalls(joystick *Joystick) int32
- func GetNumJoystickButtons(joystick *Joystick) int32
- func GetNumJoystickHats(joystick *Joystick) int32
- func GetNumLogicalCPUCores() int32
- func GetNumRenderDrivers() int32
- func GetNumVideoDrivers() int32
- func GetNumberProperty(props PropertiesID, name string, defaultValue int64) int64
- func GetPerformanceCounter() uint64
- func GetPerformanceFrequency() uint64
- func GetPointerProperty(props PropertiesID, name string, defaultValue unsafe.Pointer) unsafe.Pointer
- func GetPrefPath(org string, app string) string
- func GetRectAndLineIntersection(rect Rect, x1, y1, x2, y2 *int32) bool
- func GetRectAndLineIntersectionFloat(rect FRect, x1, y1, x2, y2 *float32) bool
- func GetRenderClipRect(renderer *Renderer, rect *Rect) bool
- func GetRenderColorScale(renderer *Renderer, scale *float32) bool
- func GetRenderDrawBlendMode(renderer *Renderer, blendMode *BlendMode) bool
- func GetRenderDrawColor(renderer *Renderer, r *uint8, g *uint8, b *uint8, a *uint8) bool
- func GetRenderDrawColorFloat(renderer *Renderer, r *float32, g *float32, b *float32, a *float32) bool
- func GetRenderDriver(index int32) string
- func GetRenderLogicalPresentation(renderer *Renderer, w *int32, h *int32, mode *RendererLogicalPresentation) bool
- func GetRenderLogicalPresentationRect(renderer *Renderer, rect *FRect) bool
- func GetRenderMetalCommandEncoder(renderer *Renderer) unsafe.Pointer
- func GetRenderMetalLayer(renderer *Renderer) unsafe.Pointer
- func GetRenderOutputSize(renderer *Renderer, w *int32, h *int32) bool
- func GetRenderSafeArea(renderer *Renderer, rect *Rect) bool
- func GetRenderScale(renderer *Renderer, scaleX *float32, scaleY *float32) bool
- func GetRenderTextureAddressMode(renderer *Renderer, uMode, vMode *TextureAddressMode) bool
- func GetRenderVSync(renderer *Renderer, vsync *int32) bool
- func GetRenderViewport(renderer *Renderer, rect *Rect) bool
- func GetRendererName(renderer *Renderer) string
- func GetRevision() string
- func GetSIMDAlignment() uint64
- func GetScancodeName(scancode Scancode) string
- func GetStringProperty(props PropertiesID, name string, defaultValue string) string
- func GetSurfaceAlphaMod(surface *Surface, alpha *uint8) bool
- func GetSurfaceBlendMode(surface *Surface, blendMode *BlendMode) bool
- func GetSurfaceClipRect(surface *Surface, rect *Rect) bool
- func GetSurfaceColorKey(surface *Surface, key *uint32) bool
- func GetSurfaceColorMod(surface *Surface, r *uint8, g *uint8, b *uint8) bool
- func GetSystemPageSize() int32
- func GetSystemRAM() int32
- func GetTextInputArea(window *Window, rect *Rect, cursor *int32) bool
- func GetTextureAlphaMod(texture *Texture, alpha *uint8) bool
- func GetTextureAlphaModFloat(texture *Texture, alpha *float32) bool
- func GetTextureBlendMode(texture *Texture, blendMode *BlendMode) bool
- func GetTextureColorMod(texture *Texture, r *uint8, g *uint8, b *uint8) bool
- func GetTextureColorModFloat(texture *Texture, r *float32, g *float32, b *float32) bool
- func GetTextureScaleMode(texture *Texture, scaleMode *ScaleMode) bool
- func GetTextureSize(texture *Texture, w *float32, h *float32) bool
- func GetTicks() uint64
- func GetTicksNS() uint64
- func GetVersion() (major, minor, patch int32)
- func GetVideoDriver(index int32) string
- func GetWindowAspectRatio(window *Window, minAspect, maxAspect *float32) bool
- func GetWindowBordersSize(window *Window, top, left, bottom, right *int32) bool
- func GetWindowDisplayScale(window *Window) float32
- func GetWindowKeyboardGrab(window *Window) bool
- func GetWindowMaximumSize(window *Window, w, h *int32) bool
- func GetWindowMinimumSize(window *Window, w, h *int32) bool
- func GetWindowMouseGrab(window *Window) bool
- func GetWindowOpacity(window *Window) float32
- func GetWindowPixelDensity(window *Window) float32
- func GetWindowPosition(window *Window, x *int32, y *int32) bool
- func GetWindowProgressValue(window *Window) float32
- func GetWindowRelativeMouseMode(window *Window) bool
- func GetWindowSafeArea(window *Window, rect *Rect) bool
- func GetWindowSize(window *Window, w *int32, h *int32) bool
- func GetWindowSizeInPixels(window *Window, w *int32, h *int32) bool
- func GetWindowSurfaceVSync(window *Window, vsync *int32) bool
- func GetWindowTitle(window *Window) string
- func HasARMSIMD() bool
- func HasAVX() bool
- func HasAVX2() bool
- func HasAVX512F() bool
- func HasAltiVec() bool
- func HasEvent(eventType EventType) bool
- func HasEvents(minType, maxType EventType) bool
- func HasJoystick() bool
- func HasKeyboard() bool
- func HasLASX() bool
- func HasLSX() bool
- func HasMMX() bool
- func HasMouse() bool
- func HasNEON() bool
- func HasProperty(props PropertiesID, name string) bool
- func HasRectIntersection(a, b Rect) bool
- func HasRectIntersectionFloat(a, b FRect) bool
- func HasSSE() bool
- func HasSSE2() bool
- func HasSSE3() bool
- func HasSSE41() bool
- func HasSSE42() bool
- func HasScreenKeyboardSupport() bool
- func HideCursor() bool
- func HideWindow(window *Window) bool
- func Init(flags InitFlags) bool
- func InitSubSystem(flags InitFlags) bool
- func InvalidParamError(param string) bool
- func IsMainThread() bool
- func JoystickConnected(joystick *Joystick) bool
- func JoystickEventsEnabled() bool
- func LoadFile(file string, dataSize *uint64) unsafe.Pointer
- func LoadWAV(path string, spec *AudioSpec, audioBuf **uint8, audioLen *uint32) bool
- func LoadWAVIO(src *IOStream, closeio bool, spec *AudioSpec, audioBuf **uint8, ...) bool
- func LockJoysticks()
- func LockProperties(props PropertiesID) bool
- func LockSurface(surface *Surface) bool
- func LockTexture(texture *Texture, rect *Rect, pixels *unsafe.Pointer, pitch *int32) bool
- func LockTextureToSurface(texture *Texture, rect *Rect, surface **Surface) bool
- func Log(format string, a ...any)
- func LogError(category LogCategory, format string, a ...any)
- func LogMessage(category LogCategory, priority LogPriority, format string, a ...any)
- func MapGPUTransferBuffer(device *GPUDevice, transferBuffer *GPUTransferBuffer, cycle bool) unsafe.Pointer
- func MapRGB(format *PixelFormatDetails, palette *Palette, r uint8, g uint8, b uint8) uint32
- func MapSurfaceRGB(surface *Surface, r uint8, g uint8, b uint8) uint32
- func MaximizeWindow(window *Window) bool
- func MinimizeWindow(window *Window) bool
- func MustLock(surface *Surface) bool
- func OpenURL(url string) bool
- func PauseAudioStreamDevice(stream *AudioStream) bool
- func PeepEvents(events *Event, numevents int32, action EventAction, minType, maxType EventType) int32
- func PointInRect(p Point, r Rect) bool
- func PointInRectFloat(p FPoint, r FRect) bool
- func PollEvent(event *Event) bool
- func PumpEvents()
- func PushEvent(event *Event) bool
- func PushGPUFragmentUniformData(commandBuffer *GPUCommandBuffer, slotIndex uint32, data unsafe.Pointer, ...)
- func PushGPUVertexUniformData(commandBuffer *GPUCommandBuffer, slotIndex uint32, data unsafe.Pointer, ...)
- func PutAudioStreamData(stream *AudioStream, buf *uint8, len int32) bool
- func Quit()
- func QuitSubSystem(flags InitFlags)
- func RaiseWindow(window *Window) bool
- func RectEmpty(r Rect) bool
- func RectEmptyFloat(r FRect) bool
- func RectsEqual(a, b Rect) bool
- func RectsEqualEpsilon(a, b FRect, epsilon float32) bool
- func RectsEqualFloat(a, b FRect) bool
- func RegisterEvents(numevents int32) uint32
- func ReleaseCameraFrame(camera *Camera, frame *Surface)
- func ReleaseGPUBuffer(device *GPUDevice, buffer *GPUBuffer)
- func ReleaseGPUGraphicsPipeline(device *GPUDevice, graphicsPipeline *GPUGraphicsPipeline)
- func ReleaseGPUSampler(device *GPUDevice, sampler *GPUSampler)
- func ReleaseGPUShader(device *GPUDevice, shader *GPUShader)
- func ReleaseGPUTexture(device *GPUDevice, texture *GPUTexture)
- func ReleaseGPUTransferBuffer(device *GPUDevice, transferBuffer *GPUTransferBuffer)
- func ReleaseWindowFromGPUDevice(device *GPUDevice, window *Window)
- func RemoveEventWatch(filter EventFilter, userdata unsafe.Pointer)
- func RemoveHintCallback(name string, callback HintCallback, userdata unsafe.Pointer)
- func RemoveSurfaceAlternateImages(surface *Surface)
- func RenderClear(renderer *Renderer) bool
- func RenderClipEnabled(renderer *Renderer) bool
- func RenderCoordinatesFromWindow(renderer *Renderer, windowX float32, windowY float32, x *float32, y *float32) bool
- func RenderCoordinatesToWindow(renderer *Renderer, x float32, y float32, windowX *float32, windowY *float32) bool
- func RenderDebugText(renderer *Renderer, x, y float32, str string) bool
- func RenderDebugTextFormat(renderer *Renderer, x float32, y float32, format string, a ...any) bool
- func RenderFillRect(renderer *Renderer, rect *FRect) bool
- func RenderFillRects(renderer *Renderer, rects []FRect) bool
- func RenderGeometry(renderer *Renderer, texture *Texture, vertices []Vertex, indices []int32) bool
- func RenderGeometryRaw(renderer *Renderer, texture *Texture, xy []FPoint, color []FColor, uv []FPoint, ...) bool
- func RenderLine(renderer *Renderer, x1 float32, y1 float32, x2 float32, y2 float32) bool
- func RenderLines(renderer *Renderer, points []FPoint) bool
- func RenderPoint(renderer *Renderer, x float32, y float32) bool
- func RenderPoints(renderer *Renderer, points []FPoint) bool
- func RenderPresent(renderer *Renderer) bool
- func RenderRect(renderer *Renderer, rect *FRect) bool
- func RenderRects(renderer *Renderer, rects []FRect) bool
- func RenderTexture(renderer *Renderer, texture *Texture, srcrect *FRect, dstrect *FRect) bool
- func RenderTexture9Grid(renderer *Renderer, texture *Texture, srcrect *FRect, ...) bool
- func RenderTexture9GridTiled(renderer *Renderer, texture *Texture, srcrect *FRect, ...) bool
- func RenderTextureAffine(renderer *Renderer, texture *Texture, srcrect *FRect, origin *FPoint, ...) bool
- func RenderTextureRotated(renderer *Renderer, texture *Texture, srcrect *FRect, dstrect *FRect, ...) bool
- func RenderTextureTiled(renderer *Renderer, texture *Texture, srcrect *FRect, scale float32, ...) bool
- func RenderViewportSet(renderer *Renderer) bool
- func ResetHint(name string) bool
- func ResetHints()
- func ResetKeyboard()
- func ResetLogPriorities()
- func RestoreWindow(window *Window) bool
- func ResumeAudioStreamDevice(stream *AudioStream) bool
- func RumbleJoystick(joystick *Joystick, lowFrequencyRumble uint16, highFrequencyRumble uint16, ...) bool
- func RumbleJoystickTriggers(joystick *Joystick, leftRumble uint16, rightRumble uint16, durationMs uint32) bool
- func SaveBMP(surface *Surface, file string) bool
- func SaveBMPIO(surface *Surface, dst *IOStream, closeio bool) bool
- func SavePNG(surface *Surface, file string) bool
- func ScreenKeyboardShown(window *Window) bool
- func ScreenSaverEnabled() bool
- func SendJoystickEffect(joystick *Joystick, data unsafe.Pointer, size int32) bool
- func SetAudioStreamFormat(stream *AudioStream, srcSpec *AudioSpec, dstSpec *AudioSpec) bool
- func SetAudioStreamFrequencyRatio(stream *AudioStream, ratio float32) bool
- func SetAudioStreamGain(stream *AudioStream, gain float32) bool
- func SetBooleanProperty(props PropertiesID, name string, value bool) bool
- func SetCursor(cursor *Cursor) bool
- func SetDefaultTextureScaleMode(renderer *Renderer, scaleMode ScaleMode) bool
- func SetError(format string, a ...any) bool
- func SetEventEnabled(eventType EventType, enabled bool)
- func SetEventFilter(filter EventFilter, userdata unsafe.Pointer)
- func SetFloatProperty(props PropertiesID, name string, value float32) bool
- func SetGPUBufferName(device *GPUDevice, buffer *GPUBuffer, text string)
- func SetGPUScissor(renderPass *GPURenderPass, scissor *Rect)
- func SetGPUSwapchainParameters(device *GPUDevice, window *Window, ...) bool
- func SetGPUViewport(renderass *GPURenderPass, viewport *GPUViewport)
- func SetHint(name, value string) bool
- func SetHintWithPriority(name string, value string, priority HintPriority) bool
- func SetJoystickEventsEnabled(enabled bool)
- func SetJoystickLED(joystick *Joystick, red uint8, green uint8, blue uint8) bool
- func SetJoystickPlayerIndex(joystick *Joystick, playerIndex int32) bool
- func SetLogOutputFunction(callback LogOutputFunction, userdata unsafe.Pointer)
- func SetLogPriorities(priority LogPriority)
- func SetLogPriority(category int32, priority LogPriority)
- func SetModState(modstate Keymod)
- func SetNumberProperty(props PropertiesID, name string, value int64) bool
- func SetPaletteColors(palette *Palette, firstcolor int32, Colors ...Color) bool
- func SetPointerProperty(props PropertiesID, name string, value unsafe.Pointer) bool
- func SetPointerPropertyWithCleanup(props PropertiesID, name string, value unsafe.Pointer, ...) bool
- func SetRenderClipRect(renderer *Renderer, rect *Rect) bool
- func SetRenderColorScale(renderer *Renderer, scale float32) bool
- func SetRenderDrawBlendMode(renderer *Renderer, blendMode BlendMode) bool
- func SetRenderDrawColor(renderer *Renderer, r, g, b, a uint8) bool
- func SetRenderDrawColorFloat(renderer *Renderer, r float32, g float32, b float32, a float32) bool
- func SetRenderLogicalPresentation(renderer *Renderer, w int32, h int32, mode RendererLogicalPresentation) bool
- func SetRenderScale(renderer *Renderer, scaleX float32, scaleY float32) bool
- func SetRenderTarget(renderer *Renderer, texture *Texture) bool
- func SetRenderTextureAddressMode(renderer *Renderer, uMode, vMode TextureAddressMode) bool
- func SetRenderVSync(renderer *Renderer, vsync int32) bool
- func SetRenderViewport(renderer *Renderer, rect *Rect) bool
- func SetScancodeName(scancode Scancode, name string) bool
- func SetStringProperty(props PropertiesID, name string, value string) bool
- func SetSurfaceAlphaMod(surface *Surface, alpha uint8) bool
- func SetSurfaceBlendMode(surface *Surface, blendMode BlendMode) bool
- func SetSurfaceClipRect(surface *Surface, rect *Rect) bool
- func SetSurfaceColorKey(surface *Surface, enabled bool, key uint32) bool
- func SetSurfaceColorMod(surface *Surface, r uint8, g uint8, b uint8) bool
- func SetSurfaceColorspace(surface *Surface, colorspace Colorspace) bool
- func SetSurfacePalette(surface *Surface, palette *Palette) bool
- func SetSurfaceRLE(surface *Surface, enabled bool) bool
- func SetTextInputArea(window *Window, rect *Rect, cursor int32) bool
- func SetTextureAlphaMod(texture *Texture, alpha uint8) bool
- func SetTextureAlphaModFloat(texture *Texture, alpha float32) bool
- func SetTextureBlendMode(texture *Texture, blendMode BlendMode) bool
- func SetTextureColorMod(texture *Texture, r uint8, g uint8, b uint8) bool
- func SetTextureColorModFloat(texture *Texture, r float32, g float32, b float32) bool
- func SetTexturePalette(texture *Texture, palette *Palette) bool
- func SetTextureScaleMode(texture *Texture, scaleMode ScaleMode) bool
- func SetWindowAlwaysOnTop(window *Window, onTop bool) bool
- func SetWindowAspectRatio(window *Window, minAspect, maxAspect float32) bool
- func SetWindowBordered(window *Window, bordered bool) bool
- func SetWindowFocusable(window *Window, focusable bool) bool
- func SetWindowFullscreen(window *Window, fullscreen bool) bool
- func SetWindowFullscreenMode(window *Window, mode *DisplayMode) bool
- func SetWindowHitTest(window *Window, callback HitTest, callbackData unsafe.Pointer) bool
- func SetWindowIcon(window *Window, icon *Surface) bool
- func SetWindowKeyboardGrab(window *Window, grabbed bool) bool
- func SetWindowMaximumSize(window *Window, maxW, maxH int32) bool
- func SetWindowMinimumSize(window *Window, minW, minH int32) bool
- func SetWindowModal(window *Window, modal bool) bool
- func SetWindowMouseGrab(window *Window, grabbed bool) bool
- func SetWindowMouseRect(window *Window, rect *Rect) bool
- func SetWindowOpacity(window *Window, opacity float32) bool
- func SetWindowParent(window *Window, parent *Window) bool
- func SetWindowPosition(window *Window, x int32, y int32) bool
- func SetWindowProgressState(window *Window, state ProgressState) bool
- func SetWindowProgressValue(window *Window, value float32) bool
- func SetWindowRelativeMouseMode(window *Window, enabled bool) bool
- func SetWindowResizable(window *Window, resizable bool) bool
- func SetWindowSize(window *Window, w int32, h int32) bool
- func SetWindowSurfaceVSync(window *Window, vsync int32) bool
- func SetWindowTitle(window *Window, title string) bool
- func ShowCursor() bool
- func ShowFileDialogWithProperties(dialogType FileDialogType, callback DialogFileCallback, ...)
- func ShowMessageBox(messageboxdata *MessageBoxData, buttonid *int32) bool
- func ShowOpenFileDialog(callback DialogFileCallback, userdata unsafe.Pointer, window *Window, ...)
- func ShowOpenFolderDialog(callback DialogFileCallback, userdata unsafe.Pointer, window *Window, ...)
- func ShowSaveFileDialog(callback DialogFileCallback, userdata unsafe.Pointer, window *Window, ...)
- func ShowSimpleMessageBox(flags MessageBoxFlags, title string, message string, window *Window) bool
- func ShowWindow(window *Window) bool
- func ShowWindowSystemMenu(window *Window, x, y int32) bool
- func StartTextInput(window *Window) bool
- func StartTextInputWithProperties(window *Window, props PropertiesID) bool
- func StopTextInput(window *Window) bool
- func StretchSurface(src *Surface, srcrect *Rect, dst *Surface, dstrect *Rect, scaleMode ScaleMode) bool
- func Strstr(haystack string, needle string) string
- func SubmitGPUCommandBuffer(commandBuffer *GPUCommandBuffer) bool
- func SurfaceHasAlternateImages(surface *Surface) bool
- func SurfaceHasColorKey(surface *Surface) bool
- func SurfaceHasRLE(surface *Surface) bool
- func SyncWindow(window *Window) bool
- func TextInputActive(window *Window) bool
- func UnlockJoysticks()
- func UnlockProperties(props PropertiesID)
- func UnlockSurface(surface *Surface)
- func UnlockTexture(texture *Texture)
- func UnmapGPUTransferBuffer(device *GPUDevice, transferBuffer *GPUTransferBuffer)
- func UpdateJoysticks()
- func UpdateNVTexture(texture *Texture, rect *Rect, yPlane *uint8, yPitch int32, uvPlane *uint8, ...) bool
- func UpdateTexture(texture *Texture, rect *Rect, pixels unsafe.Pointer, pitch int32) bool
- func UpdateWindowSurface(window *Window) bool
- func UpdateYUVTexture(texture *Texture, rect *Rect, yPlane *uint8, yPitch int32, uPlane *uint8, ...) bool
- func UploadToGPUBuffer(copyPass *GPUCopyPass, source *GPUTransferBufferLocation, ...)
- func UploadToGPUTexture(copyPass *GPUCopyPass, source *GPUTextureTransferInfo, ...)
- func WaitAndAcquireGPUSwapchainTexture(commandBuffer *GPUCommandBuffer, window *Window, swapchainTexture **GPUTexture, ...) bool
- func WaitEvent(event *Event) bool
- func WaitEventTimeout(event *Event, timeoutMS int32) bool
- func WarpMouseGlobal(x float32, y float32) bool
- func WarpMouseInWindow(window *Window, x float32, y float32)
- func WindowHasSurface(window *Window) bool
- func WindowPosCenteredDisplay(displayID DisplayID) uint32
- func WindowSupportsGPUPresentMode(device *GPUDevice, window *Window, presentMode GPUPresentMode) bool
- type AppResult
- type ArrayOrder
- type AssertState
- type AsyncIOResult
- type AsyncIOTaskType
- type AtomicInt
- type AtomicU32
- type AudioDeviceEvent
- type AudioDeviceID
- type AudioFormat
- type AudioSpec
- type AudioStream
- type AudioStreamCallback
- type AudioStreamDataCompleteCallback
- type BitmapOrder
- type BlendFactor
- type BlendMode
- type BlendOperation
- type Camera
- type CameraDeviceEvent
- type CameraID
- type CameraPermissionState
- type CameraPosition
- type CameraSpec
- type Capitalization
- type ChromaLocation
- type CleanupPropertyCallback
- type ClipboardEvent
- type Color
- type ColorPrimaries
- type ColorRange
- type ColorType
- type Colorspace
- type CommonEvent
- type Condition
- type Cursor
- func CreateAnimatedCursor(frames *CursorFrameInfo, frameCount, hotX, hotY int32) *Cursor
- func CreateColorCursor(surface *Surface, hotX int32, hotY int32) *Cursor
- func CreateCursor(data *uint8, mask *uint8, w int32, h int32, hotX int32, hotY int32) *Cursor
- func CreateSystemCursor(id SystemCursor) *Cursor
- func GetCursor() *Cursor
- func GetDefaultCursor() *Cursor
- type CursorFrameInfo
- type DateFormat
- type DateTime
- type DialogFileCallback
- type DialogFileFilter
- type DisplayEvent
- type DisplayID
- type DisplayMode
- type DisplayModeData
- type DisplayOrientation
- type DropEvent
- type EnumerateDirectoryCallback
- type EnumeratePropertiesCallback
- type EnumerationResult
- type Environment
- type Event
- func (e *Event) ADevice() AudioDeviceEvent
- func (e *Event) Button() MouseButtonEvent
- func (e *Event) CDevice() CameraDeviceEvent
- func (e *Event) Clipboard() ClipboardEvent
- func (e *Event) Common() CommonEvent
- func (e *Event) Display() DisplayEvent
- func (e *Event) Drop() DropEvent
- func (e *Event) Edit() TextEditingEvent
- func (e *Event) EditCandidates() TextEditingCandidatesEvent
- func (e *Event) GAxis() GamepadAxisEvent
- func (e *Event) GButton() GamepadButtonEvent
- func (e *Event) GDevice() GamepadDeviceEvent
- func (e *Event) GSensor() GamepadSensorEvent
- func (e *Event) GTouchpad() GamepadTouchpadEvent
- func (e *Event) JAxis() JoyAxisEvent
- func (e *Event) JBall() JoyBallEvent
- func (e *Event) JBattery() JoyBatteryEvent
- func (e *Event) JButton() JoyButtonEvent
- func (e *Event) JDevice() JoyDeviceEvent
- func (e *Event) JHat() JoyHatEvent
- func (e *Event) KDevice() KeyboardDeviceEvent
- func (e *Event) Key() KeyboardEvent
- func (e *Event) MDevice() MouseDeviceEvent
- func (e *Event) Motion() MouseMotionEvent
- func (e *Event) PAxis() PenAxisEvent
- func (e *Event) PButton() PenButtonEvent
- func (e *Event) PMotion() PenMotionEvent
- func (e *Event) PProximity() PenProximityEvent
- func (e *Event) PTouch() PenTouchEvent
- func (e *Event) Quit() QuitEvent
- func (e *Event) Render() RenderEvent
- func (e *Event) Sensor() SensorEvent
- func (e *Event) TFinger() TouchFingerEvent
- func (e *Event) Text() TextInputEvent
- func (e *Event) Type() EventType
- func (e *Event) User() UserEvent
- func (e *Event) Wheel() MouseWheelEvent
- func (e *Event) Window() WindowEvent
- type EventAction
- type EventFilter
- type EventType
- type FColor
- type FPoint
- type FRect
- type FileDialogType
- type Finger
- type FingerID
- type FlashOperation
- type FlipMode
- type Folder
- type GLAttr
- type GLContext
- type GLContextFlag
- type GLContextReleaseFlag
- type GLContextResetNotification_
- type GLContextState
- type GLProfile
- type GPUBlendFactor
- type GPUBlendOp
- type GPUBlitInfo
- type GPUBlitRegion
- type GPUBuffer
- type GPUBufferBinding
- type GPUBufferCreateInfo
- type GPUBufferLocation
- type GPUBufferRegion
- type GPUBufferUsageFlags
- type GPUColorComponentFlags
- type GPUColorTargetBlendState
- type GPUColorTargetDescription
- type GPUColorTargetInfo
- type GPUCommandBuffer
- type GPUCompareOp
- type GPUComputePass
- type GPUComputePipeline
- type GPUComputePipelineCreateInfo
- type GPUCopyPass
- type GPUCubeMapFace
- type GPUCullMode
- type GPUDepthStencilState
- type GPUDepthStencilTargetInfo
- type GPUDevice
- type GPUFence
- type GPUFillMode
- type GPUFilter
- type GPUFrontFace
- type GPUGraphicsPipeline
- type GPUGraphicsPipelineCreateInfo
- type GPUGraphicsPipelineTargetInfo
- type GPUIndexElementSize
- type GPUIndexedIndirectDrawCommand
- type GPUIndirectDispatchCommand
- type GPUIndirectDrawCommand
- type GPULoadOp
- type GPUMultisampleState
- type GPUPresentMode
- type GPUPrimitiveType
- type GPURasterizerState
- type GPURenderPass
- type GPURenderState
- type GPURenderStateCreateInfo
- type GPUSampleCount
- type GPUSampler
- type GPUSamplerAddressMode
- type GPUSamplerCreateInfo
- type GPUSamplerMipmapMode
- type GPUShader
- type GPUShaderCreateInfo
- type GPUShaderFormat
- type GPUShaderStage
- type GPUStencilOp
- type GPUStencilOpState
- type GPUStorageBufferReadWriteBinding
- type GPUStorageTextureReadWriteBinding
- type GPUStoreOp
- type GPUSwapchainComposition
- type GPUTexture
- type GPUTextureCreateInfo
- type GPUTextureFormat
- type GPUTextureLocation
- type GPUTextureRegion
- type GPUTextureSamplerBinding
- type GPUTextureTransferInfo
- type GPUTextureType
- type GPUTextureUsageFlags
- type GPUTransferBuffer
- type GPUTransferBufferCreateInfo
- type GPUTransferBufferLocation
- type GPUTransferBufferUsage
- type GPUVertexAttribute
- type GPUVertexBufferDescription
- type GPUVertexElementFormat
- type GPUVertexInputRate
- type GPUVertexInputState
- type GPUViewport
- type GPUVulkanOptions
- type Gamepad
- type GamepadAxis
- type GamepadAxisEvent
- type GamepadBinding
- type GamepadBindingType
- type GamepadButton
- type GamepadButtonEvent
- type GamepadButtonLabel
- type GamepadDeviceEvent
- type GamepadSensorEvent
- type GamepadTouchpadEvent
- type GamepadType
- type GlobFlags
- type Haptic
- type HapticCondition
- type HapticConstant
- type HapticCustom
- type HapticDirection
- type HapticDirectionType
- type HapticEffect
- type HapticEffectID
- type HapticEffectType
- type HapticID
- type HapticLeftRight
- type HapticPeriodic
- type HapticRamp
- type HidBusType
- type HidDevice
- type HidDeviceInfo
- type HintCallback
- type HintPriority
- type HitTest
- type HitTestResult
- type IOStatus
- type IOStream
- type IOStreamInterface
- type IOWhence
- type InitFlags
- type InitState
- type InitStatus
- type JoyAxisEvent
- type JoyBallEvent
- type JoyBatteryEvent
- type JoyButtonEvent
- type JoyDeviceEvent
- type JoyHatEvent
- type Joystick
- type JoystickConnectionState
- type JoystickID
- type JoystickType
- type KeyboardDeviceEvent
- type KeyboardEvent
- type KeyboardID
- type Keycode
- type Keymod
- type Locale
- type LogCategory
- type LogOutputFunction
- type LogPriority
- type MatrixCoefficients
- type MessageBoxButtonData
- type MessageBoxButtonFlags
- type MessageBoxColor
- type MessageBoxColorScheme
- type MessageBoxColorType
- type MessageBoxData
- type MessageBoxFlags
- type MouseButtonEvent
- type MouseButtonFlags
- type MouseDeviceEvent
- type MouseID
- type MouseMotionEvent
- type MouseMotionTransformCallback
- type MouseWheelDirection
- type MouseWheelEvent
- type Mutex
- type NSTimerCallback
- type PackedLayout
- type PackedOrder
- type Palette
- type PathInfo
- type PathType
- type PenAxis
- type PenAxisEvent
- type PenButtonEvent
- type PenDeviceType
- type PenID
- type PenInputFlags
- type PenMotionEvent
- type PenProximityEvent
- type PenTouchEvent
- type PinchFingerEvent
- type PixelFormat
- func DefinePixelFormat[T BitmapOrder | PackedOrder | ArrayOrder](pixelType PixelType, order T, layout PackedLayout, ...) PixelFormat
- func DefinePixelFourCC(a, b, c, d byte) PixelFormat
- func GetPixelFormatFromGPUTextureFormat(format GPUTextureFormat) PixelFormat
- func GetWindowPixelFormat(window *Window) PixelFormat
- type PixelFormatDetails
- type PixelType
- type Point
- type PowerState
- type Process
- type ProcessIO
- type ProgressState
- type PropertiesID
- func CreateProperties() PropertiesID
- func GetCameraProperties(camera *Camera) PropertiesID
- func GetDisplayProperties(displayID DisplayID) PropertiesID
- func GetGPUDeviceProperties(device *GPUDevice) PropertiesID
- func GetGlobalProperties() PropertiesID
- func GetJoystickProperties(joystick *Joystick) PropertiesID
- func GetRendererProperties(renderer *Renderer) PropertiesID
- func GetSurfaceProperties(surface *Surface) PropertiesID
- func GetTextureProperties(texture *Texture) PropertiesID
- func GetWindowProperties(window *Window) PropertiesID
- type PropertyType
- type QuitEvent
- type RWLock
- type Rect
- type RenderEvent
- type Renderer
- func CreateGPURenderer(device *GPUDevice, window *Window) *Renderer
- func CreateRenderer(window *Window, name string) *Renderer
- func CreateRendererWithProperties(props PropertiesID) *Renderer
- func CreateSoftwareRenderer(surface *Surface) *Renderer
- func GetRenderer(window *Window) *Renderer
- func GetRendererFromTexture(texture *Texture) *Renderer
- type RendererLogicalPresentation
- type Sandbox
- type ScaleMode
- type Scancode
- type Semaphore
- type Sensor
- type SensorEvent
- type SensorID
- type SensorType
- type SpinLock
- type Storage
- type StorageInterface
- type Surface
- func AcquireCameraFrame(camera *Camera, timestampNS *uint64) *Surface
- func ConvertSurface(surface *Surface, format PixelFormat) *Surface
- func ConvertSurfaceAndColorspace(surface *Surface, format PixelFormat, palette *Palette, colorspace Colorspace, ...) *Surface
- func CreateSurface(width int32, height int32, format PixelFormat) *Surface
- func CreateSurfaceFrom(width int32, height int32, format PixelFormat, pixels unsafe.Pointer, ...) *Surface
- func DuplicateSurface(surface *Surface) *Surface
- func GetSurfaceImages(surface *Surface) []*Surface
- func GetWindowSurface(window *Window) *Surface
- func LoadBMP(file string) *Surface
- func LoadBMPIO(src *IOStream, closeio bool) *Surface
- func LoadPNG(file string) *Surface
- func LoadSurface(file string) *Surface
- func RenderReadPixels(renderer *Renderer, rect *Rect) *Surface
- func RotateSurface(surface *Surface, angle float32) *Surface
- func ScaleSurface(surface *Surface, width int32, height int32, scaleMode ScaleMode) *Surface
- type SurfaceFlags
- type SystemCursor
- type SystemTheme
- type TLSID
- type TextEditingCandidatesEvent
- type TextEditingEvent
- type TextInputEvent
- type TextInputType
- type Texture
- func CreateTexture(renderer *Renderer, format PixelFormat, access TextureAccess, w int32, h int32) *Texture
- func CreateTextureFromSurface(renderer *Renderer, surface *Surface) *Texture
- func CreateTextureWithProperties(renderer *Renderer, props PropertiesID) *Texture
- func GetRenderTarget(renderer *Renderer) *Texture
- type TextureAccess
- type TextureAddressMode
- type Thread
- type ThreadFunction
- type ThreadID
- type ThreadPriority
- type ThreadState
- type Time
- type TimeFormat
- type TimerCallback
- type TimerID
- type TouchDeviceType
- type TouchFingerEvent
- type TouchID
- type TransferCharacteristics
- type Tray
- type TrayEntry
- type TrayEntryFlags
- type TrayMenu
- type UserEvent
- type Vertex
- type VirtualJoystickDesc
- type VirtualJoystickSensorDesc
- type VirtualJoystickTouchpadDesc
- type Window
- func CreateWindow(title string, w int32, h int32, flags WindowFlags) *Window
- func CreateWindowWithProperties(props PropertiesID) *Window
- func GLGetCurrentWindow() *Window
- func GetGrabbedWindow() *Window
- func GetKeyboardFocus() *Window
- func GetMouseFocus() *Window
- func GetRenderWindow(renderer *Renderer) *Window
- func GetWindowFromEvent(event *Event) *Window
- func GetWindowFromID(id WindowID) *Window
- func GetWindowParent(window *Window) *Window
- func GetWindows() []*Window
- type WindowEvent
- type WindowFlags
- type WindowID
Constants ¶
const ( BlendModeNone = 0x00000000 // No blending: dstRGBA = srcRGBA. BlendModeBlend = 0x00000001 // Alpha blending: dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)), dstA = srcA + (dstA * (1-srcA)). BlendModeBlendPremultiplied = 0x00000010 // Pre-multiplied alpha blending: dstRGBA = srcRGBA + (dstRGBA * (1-srcA)). BlendModeAdd = 0x00000002 // Additive blending: dstRGB = (srcRGB * srcA) + dstRGB, dstA = dstA. BlendModeAddPremultiplied = 0x00000020 // Pre-multiplied additive blending: dstRGB = srcRGB + dstRGB, dstA = dstA. BlendModeMod = 0x00000004 // Color modulate: dstRGB = srcRGB * dstRGB, dstA = dstA. BlendModeMul = 0x00000008 // Color multiply: dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)), dstA = dstA. BlendModeInvalid = 0x7FFFFFFF )
const ( PropFileDialogFiltersPointer = "SDL.filedialog.filters" PropFileDialogNfiltersNumber = "SDL.filedialog.nfilters" PropFileDialogWindowPointer = "SDL.filedialog.window" PropFileDialogLocationString = "SDL.filedialog.location" PropFileDialogManyBoolean = "SDL.filedialog.many" PropFileDialogTitleString = "SDL.filedialog.title" PropFileDialogAcceptString = "SDL.filedialog.accept" PropFileDialogCancelString = "SDL.filedialog.cancel" )
const ( PropGPUDeviceCreateDebugmodeBoolean = "SDL.gpu.device.create.debugmode" PropGPUDeviceCreatePreferlowpowerBoolean = "SDL.gpu.device.create.preferlowpower" PropGPUDeviceCreateVerboseBoolean = "SDL.gpu.device.create.verbose" PropGPUDeviceCreateNameString = "SDL.gpu.device.create.name" PropGPUDeviceCreateFeatureClipDistanceBoolean = "SDL.gpu.device.create.feature.clip_distance" PropGPUDeviceCreateFeatureDepthClampingBoolean = "SDL.gpu.device.create.feature.depth_clamping" PropGPUDeviceCreateFeatureIndirectDrawFirstInstanceBoolean = "SDL.gpu.device.create.feature.indirect_draw_first_instance" PropGPUDeviceCreateFeatureAnisotropyBoolean = "SDL.gpu.device.create.feature.anisotropy" PropGPUDeviceCreateShadersPrivateBoolean = "SDL.gpu.device.create.shaders.private" PropGPUDeviceCreateShadersSpirvBoolean = "SDL.gpu.device.create.shaders.spirv" PropGPUDeviceCreateShadersDxbcBoolean = "SDL.gpu.device.create.shaders.dxbc" PropGPUDeviceCreateShadersDxilBoolean = "SDL.gpu.device.create.shaders.dxil" PropGPUDeviceCreateShadersMslBoolean = "SDL.gpu.device.create.shaders.msl" PropGPUDeviceCreateShadersMetallibBoolean = "SDL.gpu.device.create.shaders.metallib" PropGPUDeviceCreateD3d12AllowFewerResourceSlotsBoolean = "SDL.gpu.device.create.d3d12.allowtier1resourcebinding" PropGPUDeviceCreateD3d12SemanticNameString = "SDL.gpu.device.create.d3d12.semantic" PropGPUDeviceCreateD3d12AgilitySdkVersionNumber = "SDL.gpu.device.create.d3d12.agility_sdk_version" PropGPUDeviceCreateD3d12AgilitySdkPathString = "SDL.gpu.device.create.d3d12.agility_sdk_path" PropGPUDeviceCreateVulkanRequireHardwareAccelerationBoolean = "SDL.gpu.device.create.vulkan.requirehardwareacceleration" PropGPUDeviceCreateVulkanOptionsPointer = "SDL.gpu.device.create.vulkan.options" PropGPUDeviceCreateMetalAllowMacfamily1Boolean = "SDL.gpu.device.create.metal.allowmacfamily1" )
const ( PropGPUDeviceNameString = "SDL.gpu.device.name" PropGPUDeviceDriverNameString = "SDL.gpu.device.driver_name" PropGPUDeviceDriverVersionString = "SDL.gpu.device.driver_version" PropGPUDeviceDriverInfoString = "SDL.gpu.device.driver_info" )
const ( PropGPUComputepipelineCreateNameString = "SDL.gpu.computepipeline.create.name" PropGPUGraphicspipelineCreateNameString = "SDL.gpu.graphicspipeline.create.name" )
const ( PropGPUTextureCreateD3d12ClearRFloat = "SDL.gpu.texture.create.d3d12.clear.r" PropGPUTextureCreateD3d12ClearGFloat = "SDL.gpu.texture.create.d3d12.clear.g" PropGPUTextureCreateD3d12ClearBFloat = "SDL.gpu.texture.create.d3d12.clear.b" PropGPUTextureCreateD3d12ClearAFloat = "SDL.gpu.texture.create.d3d12.clear.a" PropGPUTextureCreateD3d12ClearDepthFloat = "SDL.gpu.texture.create.d3d12.clear.depth" PropGPUTextureCreateD3d12ClearStencilNumber = "SDL.gpu.texture.create.d3d12.clear.stencil" PropGPUTextureCreateNameString = "SDL.gpu.texture.create.name" )
const ( HapticConstant_ HapticEffectType = 1 << iota // Constant effect supported. HapticSine // Sine wave effect supported. HapticSquare // Square wave effect supported. HapticTriangle // Triangle wave effect supported. HapticSawtoothup // Sawtoothup wave effect supported. HapticSawtoothdown // Sawtoothdown wave effect supported. HapticRamp_ // Ramp effect supported. HapticSpring // Spring effect supported - uses axes position. HapticDamper // Damper effect supported - uses axes velocity. HapticInertia // Inertia effect supported - uses axes acceleration. HapticFriction // Friction effect supported - uses axes movement. HapticLeftright // Left/Right effect supported. HapticReserved1 // Reserved for future use. HapticReserved2 // Reserved for future use. HapticReserved3 // Reserved for future use. HapticCustom_ // Custom effect is supported. HapticGain uint32 = 1<<iota + 16 // Device can set global gain. HapticAutocenter // Device can set autocenter. HapticStatus // Device can be queried for effect status. HapticPause // Device can be paused. )
const ( HintAllowAltTabWhileGrabbed = "SDL_ALLOW_ALT_TAB_WHILE_GRABBED" HintAndroidAllowRecreateActivity = "SDL_ANDROID_ALLOW_RECREATE_ACTIVITY" HintAndroidBlockOnPause = "SDL_ANDROID_BLOCK_ON_PAUSE" HintAndroidLowLatencyAudio = "SDL_ANDROID_LOW_LATENCY_AUDIO" HintAndroidTrapBackButton = "SDL_ANDROID_TRAP_BACK_BUTTON" HintAppID = "SDL_APP_ID" HintAppName = "SDL_APP_NAME" HintAppleTVControllerUiEvents = "SDL_APPLE_TV_CONTROLLER_UI_EVENTS" HintAppleTVRemoteAllowRotation = "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION" HintAudioAlsaDefaultDevice = "SDL_AUDIO_ALSA_DEFAULT_DEVICE" HintAudioAlsaDefaultPlaybackDevice = "SDL_AUDIO_ALSA_DEFAULT_PLAYBACK_DEVICE" HintAudioAlsaDefaultRecordingDevice = "SDL_AUDIO_ALSA_DEFAULT_RECORDING_DEVICE" HintAudioCategory = "SDL_AUDIO_CATEGORY" HintAudioChannels = "SDL_AUDIO_CHANNELS" HintAudioDeviceAppIconName = "SDL_AUDIO_DEVICE_APP_ICON_NAME" HintAudioDeviceSampleFrames = "SDL_AUDIO_DEVICE_SAMPLE_FRAMES" HintAudioDeviceStreamName = "SDL_AUDIO_DEVICE_STREAM_NAME" HintAudioDeviceStreamRole = "SDL_AUDIO_DEVICE_STREAM_ROLE" HintAudioDeviceRawStream = "SDL_AUDIO_DEVICE_RAW_STREAM" // Available since SDL 3.4.0. HintAudioDiskInputFile = "SDL_AUDIO_DISK_INPUT_FILE" HintAudioDiskOutputFile = "SDL_AUDIO_DISK_OUTPUT_FILE" HintAudioDiskTimescale = "SDL_AUDIO_DISK_TIMESCALE" HintAudioDriver = "SDL_AUDIO_DRIVER" HintAudioDummyTimescale = "SDL_AUDIO_DUMMY_TIMESCALE" HintAudioFormat = "SDL_AUDIO_FORMAT" HintAudioFrequency = "SDL_AUDIO_FREQUENCY" HintAudioIncludeMonitors = "SDL_AUDIO_INCLUDE_MONITORS" HintAutoUpdateJoysticks = "SDL_AUTO_UPDATE_JOYSTICKS" HintAutoUpdateSensors = "SDL_AUTO_UPDATE_SENSORS" HintBmpSaveLegacyFormat = "SDL_BMP_SAVE_LEGACY_FORMAT" HintCameraDriver = "SDL_CAMERA_DRIVER" HintCpuFeatureMask = "SDL_CPU_FEATURE_MASK" HintJoystickDirectInput = "SDL_JOYSTICK_DIRECTINPUT" HintFileDialogDriver = "SDL_FILE_DIALOG_DRIVER" HintDisplayUsableBounds = "SDL_DISPLAY_USABLE_BOUNDS" HintInvalidParamChecks = "SDL_INVALID_PARAM_CHECKS" // Available since SDL 3.4.0. HintEmscriptenAsyncify = "SDL_EMSCRIPTEN_ASYNCIFY" HintEmscriptenCanvasSelector = "SDL_EMSCRIPTEN_CANVAS_SELECTOR" HintEmscriptenKeyboardElement = "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" HintEnableScreenKeyboard = "SDL_ENABLE_SCREEN_KEYBOARD" HintEvdevDevices = "SDL_EVDEV_DEVICES" HintEventLogging = "SDL_EVENT_LOGGING" HintForceRaiseWindow = "SDL_FORCE_RAISEWINDOW" HintFramebufferAcceleration = "SDL_FRAMEBUFFER_ACCELERATION" HintGamecontrollerConfig = "SDL_GAMECONTROLLERCONFIG" HintGamecontrollerConfigFile = "SDL_GAMECONTROLLERCONFIG_FILE" HintGamecontrollerType = "SDL_GAMECONTROLLERTYPE" HintGamecontrollerIgnoreDevices = "SDL_GAMECONTROLLER_IGNORE_DEVICES" HintGamecontrollerIgnoreDevicesExcept = "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT" HintGamecontrollerSensorFusion = "SDL_GAMECONTROLLER_SENSOR_FUSION" HintGDKTextInputDefaultText = "SDL_GDK_TEXTINPUT_DEFAULT_TEXT" HintGDKTextInputDescription = "SDL_GDK_TEXTINPUT_DESCRIPTION" HintGDKTextInputMaxLength = "SDL_GDK_TEXTINPUT_MAX_LENGTH" HintGDKTextInputScope = "SDL_GDK_TEXTINPUT_SCOPE" HintGDKTextInputTitle = "SDL_GDK_TEXTINPUT_TITLE" HintHidApiLibUSB = "SDL_HIDAPI_LIBUSB" HintHidapiLibusbGamecube = "SDL_HIDAPI_LIBUSB_GAMECUBE" // Available since SDL 3.4.0. HintHidApiLibUSBWhitelist = "SDL_HIDAPI_LIBUSB_WHITELIST" HintHidApiUdev = "SDL_HIDAPI_UDEV" HintGPUDriver = "SDL_GPU_DRIVER" HintHidApiEnumerateOnlyControllers = "SDL_HIDAPI_ENUMERATE_ONLY_CONTROLLERS" HintHidApiIgnoreDevices = "SDL_HIDAPI_IGNORE_DEVICES" HintImeImplementedUi = "SDL_IME_IMPLEMENTED_UI" HintIOSHideHomeIndicator = "SDL_IOS_HIDE_HOME_INDICATOR" HintJoystickAllowBackgroundEvents = "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" HintJoystickArcadeStickDevices = "SDL_JOYSTICK_ARCADESTICK_DEVICES" HintJoystickArcadeStickDevicesExcluded = "SDL_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED" HintJoystickBlacklistDevices = "SDL_JOYSTICK_BLACKLIST_DEVICES" HintJoystickBlacklistDevicesExcluded = "SDL_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED" HintJoystickDevice = "SDL_JOYSTICK_DEVICE" HintJoystickEnhancedReports = "SDL_JOYSTICK_ENHANCED_REPORTS" HintJoystickFlightStickDevices = "SDL_JOYSTICK_FLIGHTSTICK_DEVICES" HintJoystickFlightStickDevicesExcluded = "SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED" HintJoystickGameInput = "SDL_JOYSTICK_GAMEINPUT" HintJoystickGameInputRaw = "SDL_JOYSTICK_GAMEINPUT_RAW" // Available since SDL 3.4.4. HintJoystickGameCubeDevices = "SDL_JOYSTICK_GAMECUBE_DEVICES" HintJoystickGameCubeDevicesExcluded = "SDL_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED" HintJoystickHidApi = "SDL_JOYSTICK_HIDAPI" HintJoystickHidApiCombineJoyCons = "SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS" HintJoystickHidApiGameCube = "SDL_JOYSTICK_HIDAPI_GAMECUBE" HintJoystickHidApiGameCubeRumbleBrake = "SDL_JOYSTICK_HIDAPI_GAMECUBE_RUMBLE_BRAKE" HintJoystickHidApiJoyCons = "SDL_JOYSTICK_HIDAPI_JOY_CONS" HintJoystickHidApiJoyConHomeLED = "SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED" HintJoystickHidApiLuna = "SDL_JOYSTICK_HIDAPI_LUNA" HintJoystickHidApiNintendoClassic = "SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC" HintJoystickHidApiPS3 = "SDL_JOYSTICK_HIDAPI_PS3" HintJoystickHidApiPS3SixaxisDriver = "SDL_JOYSTICK_HIDAPI_PS3_SIXAXIS_DRIVER" HintJoystickHidApiPS4 = "SDL_JOYSTICK_HIDAPI_PS4" HintJoystickHidApiPS4ReportInterval = "SDL_JOYSTICK_HIDAPI_PS4_REPORT_INTERVAL" HintJoystickHidApiPS5 = "SDL_JOYSTICK_HIDAPI_PS5" HintJoystickHidApiPS5PlayerLED = "SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED" HintJoystickHidApiShield = "SDL_JOYSTICK_HIDAPI_SHIELD" HintJoystickHidApiStadia = "SDL_JOYSTICK_HIDAPI_STADIA" HintJoystickHidApiSteam = "SDL_JOYSTICK_HIDAPI_STEAM" HintJoystickHidApiSteamHomeLED = "SDL_JOYSTICK_HIDAPI_STEAM_HOME_LED" HintJoystickHidApiSteamDeck = "SDL_JOYSTICK_HIDAPI_STEAMDECK" HintJoystickHidApiSteamHori = "SDL_JOYSTICK_HIDAPI_STEAM_HORI" HintJoystickHidapiLg4ff = "SDL_JOYSTICK_HIDAPI_LG4FF" // Available since SDL 3.4.0. HintJoystickHidapi8bitdo = "SDL_JOYSTICK_HIDAPI_8BITDO" // Available since SDL 3.4.0. HintJoystickHidapiSinput = "SDL_JOYSTICK_HIDAPI_SINPUT" // Available since SDL 3.4.0. HintJoystickHidapiZuiki = "SDL_JOYSTICK_HIDAPI_ZUIKI" // Available since SDL 3.4.0. HintJoystickHidapiFlydigi = "SDL_JOYSTICK_HIDAPI_FLYDIGI" // Available since SDL 3.4.0. HintJoystickHidApiSwitch = "SDL_JOYSTICK_HIDAPI_SWITCH" HintJoystickHidApiSwitchHomeLED = "SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED" HintJoystickHidApiSwitchPlayerLED = "SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED" HintJoystickHidapiSwitch2 = "SDL_JOYSTICK_HIDAPI_SWITCH2" // Available since SDL 3.4.0. HintJoystickHidApiVerticalJoyCons = "SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS" HintJoystickHidApiWii = "SDL_JOYSTICK_HIDAPI_WII" HintJoystickHidApiWiiPlayerLED = "SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED" HintJoystickHidApiXbox = "SDL_JOYSTICK_HIDAPI_XBOX" HintJoystickHidApiXbox360 = "SDL_JOYSTICK_HIDAPI_XBOX_360" HintJoystickHidApiXbox360PlayerLED = "SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED" HintJoystickHidApiXbox360Wireless = "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" HintJoystickHidApiXboxOne = "SDL_JOYSTICK_HIDAPI_XBOX_ONE" HintJoystickHidApiXboxOneHomeLED = "SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED" HintJoystickHidapiGip = "SDL_JOYSTICK_HIDAPI_GIP" // Available since SDL 3.4.0. HintJoystickHidapiGipResetForMetadata = "SDL_JOYSTICK_HIDAPI_GIP_RESET_FOR_METADATA" // Available since SDL 3.4.0. HintJoystickIOKit = "SDL_JOYSTICK_IOKIT" HintJoystickLinuxClassic = "SDL_JOYSTICK_LINUX_CLASSIC" HintJoystickLinuxDeadzones = "SDL_JOYSTICK_LINUX_DEADZONES" HintJoystickLinuxDigitalHats = "SDL_JOYSTICK_LINUX_DIGITAL_HATS" HintJoystickLinuxHatDeadzones = "SDL_JOYSTICK_LINUX_HAT_DEADZONES" HintJoystickMfi = "SDL_JOYSTICK_MFI" HintJoystickRawinput = "SDL_JOYSTICK_RAWINPUT" HintJoystickRawinputCorrelateXinput = "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" HintJoystickRogChakram = "SDL_JOYSTICK_ROG_CHAKRAM" HintJoystickThread = "SDL_JOYSTICK_THREAD" HintJoystickThrottleDevices = "SDL_JOYSTICK_THROTTLE_DEVICES" HintJoystickThrottleDevicesExcluded = "SDL_JOYSTICK_THROTTLE_DEVICES_EXCLUDED" HintJoystickWgi = "SDL_JOYSTICK_WGI" HintJoystickWheelDevices = "SDL_JOYSTICK_WHEEL_DEVICES" HintJoystickWheelDevicesExcluded = "SDL_JOYSTICK_WHEEL_DEVICES_EXCLUDED" HintJoystickZeroCenteredDevices = "SDL_JOYSTICK_ZERO_CENTERED_DEVICES" HintJoystickHapticAxes = "SDL_JOYSTICK_HAPTIC_AXES" HintKeycodeOptions = "SDL_KEYCODE_OPTIONS" HintKmsDrmDeviceIndex = "SDL_KMSDRM_DEVICE_INDEX" HintKmsDrmRequireDrmMaster = "SDL_KMSDRM_REQUIRE_DRM_MASTER" HintKmsDrmAtomic = "SDL_KMSDRM_ATOMIC" // Available since SDL 3.4.0. HintLogging = "SDL_LOGGING" HintMacBackgroundApp = "SDL_MAC_BACKGROUND_APP" HintMacCtrlClickEmulateRightClick = "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK" HintMacOpenGLAsyncDispatch = "SDL_MAC_OPENGL_ASYNC_DISPATCH" HintMacOptionAsAlt = "SDL_MAC_OPTION_AS_ALT" HintMacScrollMomentum = "SDL_MAC_SCROLL_MOMENTUM" HintMacPressAndHold = "SDL_MAC_PRESS_AND_HOLD" // Available since SDL 3.4.0. HintMainCallbackRate = "SDL_MAIN_CALLBACK_RATE" HintMouseAutoCapture = "SDL_MOUSE_AUTO_CAPTURE" HintMouseDoubleClickRadius = "SDL_MOUSE_DOUBLE_CLICK_RADIUS" HintMouseDoubleClickTime = "SDL_MOUSE_DOUBLE_CLICK_TIME" HintMouseDefaultSystemCursor = "SDL_MOUSE_DEFAULT_SYSTEM_CURSOR" HintMouseDpiScaleCursors = "SDL_MOUSE_DPI_SCALE_CURSORS" // Available since SDL 3.4.0. HintMouseEmulateWarpWithRelative = "SDL_MOUSE_EMULATE_WARP_WITH_RELATIVE" HintMouseFocusClickThrough = "SDL_MOUSE_FOCUS_CLICKTHROUGH" HintMouseNormalSpeedScale = "SDL_MOUSE_NORMAL_SPEED_SCALE" HintMouseRelativeModeCenter = "SDL_MOUSE_RELATIVE_MODE_CENTER" HintMouseRelativeSpeedScale = "SDL_MOUSE_RELATIVE_SPEED_SCALE" HintMouseRelativeSystemScale = "SDL_MOUSE_RELATIVE_SYSTEM_SCALE" HintMouseRelativeWarpMotion = "SDL_MOUSE_RELATIVE_WARP_MOTION" HintMouseRelativeCursorVisible = "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" HintMouseTouchEvents = "SDL_MOUSE_TOUCH_EVENTS" HintMuteConsoleKeyboard = "SDL_MUTE_CONSOLE_KEYBOARD" HintNoSignalHandlers = "SDL_NO_SIGNAL_HANDLERS" HintOpenGLLibrary = "SDL_OPENGL_LIBRARY" HintEGLLibrary = "SDL_EGL_LIBRARY" HintOpenGLESDriver = "SDL_OPENGL_ES_DRIVER" HintOpenglForceSrgbFramebuffer = "SDL_OPENGL_FORCE_SRGB_FRAMEBUFFER" // Available since SDL 3.4.2. HintOpenVRLibrary = "SDL_OPENVR_LIBRARY" HintOrientations = "SDL_ORIENTATIONS" HintPollSentinel = "SDL_POLL_SENTINEL" HintPreferredLocales = "SDL_PREFERRED_LOCALES" HintQuitOnLastWindowClose = "SDL_QUIT_ON_LAST_WINDOW_CLOSE" HintRenderDirect3DThreadSafe = "SDL_RENDER_DIRECT3D_THREADSAFE" HintRenderDirect3D11Debug = "SDL_RENDER_DIRECT3D11_DEBUG" HintRenderDirect3d11Warp = "SDL_RENDER_DIRECT3D11_WARP" // Available since SDL 3.4.0. HintRenderVulkanDebug = "SDL_RENDER_VULKAN_DEBUG" HintRenderGPUDebug = "SDL_RENDER_GPU_DEBUG" HintRenderGPULowPower = "SDL_RENDER_GPU_LOW_POWER" HintRenderDriver = "SDL_RENDER_DRIVER" HintRenderLineMethod = "SDL_RENDER_LINE_METHOD" HintRenderMetalPreferLowPowerDevice = "SDL_RENDER_METAL_PREFER_LOW_POWER_DEVICE" HintRenderVSync = "SDL_RENDER_VSYNC" HintReturnKeyHidesIme = "SDL_RETURN_KEY_HIDES_IME" HintRogGamepadMice = "SDL_ROG_GAMEPAD_MICE" HintRogGamepadMiceExcluded = "SDL_ROG_GAMEPAD_MICE_EXCLUDED" HintPS2GSWidth = "SDL_PS2_GS_WIDTH" // Available since SDL 3.4.0. HintPS2GSHeight = "SDL_PS2_GS_HEIGHT" // Available since SDL 3.4.0. HintPS2GSProgressive = "SDL_PS2_GS_PROGRESSIVE" // Available since SDL 3.4.0. HintPS2GSMode = "SDL_PS2_GS_MODE" // Available since SDL 3.4.0. HintRpiVideoLayer = "SDL_RPI_VIDEO_LAYER" HintScreensaverInhibitActivityName = "SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME" HintShutdownDBusOnQuit = "SDL_SHUTDOWN_DBUS_ON_QUIT" HintStorageTitleDriver = "SDL_STORAGE_TITLE_DRIVER" HintStorageUserDriver = "SDL_STORAGE_USER_DRIVER" HintThreadForceRealtimeTimeCritical = "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL" HintThreadPriorityPolicy = "SDL_THREAD_PRIORITY_POLICY" HintTimerResolution = "SDL_TIMER_RESOLUTION" HintTouchMouseEvents = "SDL_TOUCH_MOUSE_EVENTS" HintTrackpadIsTouchOnly = "SDL_TRACKPAD_IS_TOUCH_ONLY" HintTVRemoteAsJoystick = "SDL_TV_REMOTE_AS_JOYSTICK" HintVideoAllowScreensaver = "SDL_VIDEO_ALLOW_SCREENSAVER" HintVideoDisplayPriority = "SDL_VIDEO_DISPLAY_PRIORITY" HintVideoDoubleBuffer = "SDL_VIDEO_DOUBLE_BUFFER" HintVideoDriver = "SDL_VIDEO_DRIVER" HintVideoDummySaveFrames = "SDL_VIDEO_DUMMY_SAVE_FRAMES" HintVideoEGLAllowGetDisplayFallback = "SDL_VIDEO_EGL_ALLOW_GETDISPLAY_FALLBACK" HintVideoForceEGL = "SDL_VIDEO_FORCE_EGL" HintVideoMacFullscreenSpaces = "SDL_VIDEO_MAC_FULLSCREEN_SPACES" HintVideoMacFullscreenMenuVisibility = "SDL_VIDEO_MAC_FULLSCREEN_MENU_VISIBILITY" HintVideoMetalAutoResizeDrawable = "SDL_VIDEO_METAL_AUTO_RESIZE_DRAWABLE" // Available since SDL 3.4.0. HintVideoMatchExclusiveModeOnMove = "SDL_VIDEO_MATCH_EXCLUSIVE_MODE_ON_MOVE" // Available since SDL 3.4.0. HintVideoMinimizeOnFocusLoss = "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" HintVideoOffscreenSaveFrames = "SDL_VIDEO_OFFSCREEN_SAVE_FRAMES" HintVideoSyncWindowOperations = "SDL_VIDEO_SYNC_WINDOW_OPERATIONS" HintVideoWaylandAllowLibdecor = "SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR" HintVideoWaylandModeEmulation = "SDL_VIDEO_WAYLAND_MODE_EMULATION" HintVideoWaylandModeScaling = "SDL_VIDEO_WAYLAND_MODE_SCALING" HintVideoWaylandPreferLibdecor = "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR" HintVideoWaylandScaleToDisplay = "SDL_VIDEO_WAYLAND_SCALE_TO_DISPLAY" HintVideoWinD3DCompiler = "SDL_VIDEO_WIN_D3DCOMPILER" HintVideoX11ExternalWindowInput = "SDL_VIDEO_X11_EXTERNAL_WINDOW_INPUT" HintVideoX11NetWmBypassCompositor = "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR" HintVideoX11NetWmPing = "SDL_VIDEO_X11_NET_WM_PING" HintVideoX11NoDirectColor = "SDL_VIDEO_X11_NODIRECTCOLOR" HintVideoX11ScalingFactor = "SDL_VIDEO_X11_SCALING_FACTOR" HintVideoX11VisualID = "SDL_VIDEO_X11_VISUALID" HintVideoX11WindowVisualID = "SDL_VIDEO_X11_WINDOW_VISUALID" HintVideoX11Xrandr = "SDL_VIDEO_X11_XRANDR" HintVitaEnableBackTouch = "SDL_VITA_ENABLE_BACK_TOUCH" HintVitaEnableFrontTouch = "SDL_VITA_ENABLE_FRONT_TOUCH" HintVitaModulePath = "SDL_VITA_MODULE_PATH" HintVitaPVRInit = "SDL_VITA_PVR_INIT" HintVitaResolution = "SDL_VITA_RESOLUTION" HintVitaPVROpenGL = "SDL_VITA_PVR_OPENGL" HintVitaTouchMouseDevice = "SDL_VITA_TOUCH_MOUSE_DEVICE" HintVulkanDisplay = "SDL_VULKAN_DISPLAY" HintVulkanLibrary = "SDL_VULKAN_LIBRARY" HintWaveFactChunk = "SDL_WAVE_FACT_CHUNK" HintWaveChunkLimit = "SDL_WAVE_CHUNK_LIMIT" HintWaveRiffChunkSize = "SDL_WAVE_RIFF_CHUNK_SIZE" HintWaveTruncation = "SDL_WAVE_TRUNCATION" HintWindowActivateWhenRaised = "SDL_WINDOW_ACTIVATE_WHEN_RAISED" HintWindowActivateWhenShown = "SDL_WINDOW_ACTIVATE_WHEN_SHOWN" HintWindowAllowTopmost = "SDL_WINDOW_ALLOW_TOPMOST" HintWindowFrameUsableWhileCursorHidden = "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" HintWindowsCloseOnAltF4 = "SDL_WINDOWS_CLOSE_ON_ALT_F4" HintWindowsEnableMenuMnemonics = "SDL_WINDOWS_ENABLE_MENU_MNEMONICS" HintWindowsEnableMessageloop = "SDL_WINDOWS_ENABLE_MESSAGELOOP" HintWindowsGameInput = "SDL_WINDOWS_GAMEINPUT" HintWindowsRawKeyboard = "SDL_WINDOWS_RAW_KEYBOARD" HintWindowsRawKeyboardExcludeHotkeys = "SDL_WINDOWS_RAW_KEYBOARD_EXCLUDE_HOTKEYS" // Available since SDL 3.4.0. HintWindowsRawKeyboardInputSink = "SDL_WINDOWS_RAW_KEYBOARD_INPUTSINK" // Available since SDL 3.4.4. HintWindowsForceSemaphoreKernel = "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL" HintWindowsIntresourceIcon = "SDL_WINDOWS_INTRESOURCE_ICON" HintWindowsIntresourceIconSmall = "SDL_WINDOWS_INTRESOURCE_ICON_SMALL" HintWindowsUseD3D9Ex = "SDL_WINDOWS_USE_D3D9EX" HintWindowsEraseBackgroundMode = "SDL_WINDOWS_ERASE_BACKGROUND_MODE" HintX11ForceOverrideRedirect = "SDL_X11_FORCE_OVERRIDE_REDIRECT" HintX11WindowType = "SDL_X11_WINDOW_TYPE" HintX11XcbLibrary = "SDL_X11_XCB_LIBRARY" HintXinputEnabled = "SDL_XINPUT_ENABLED" HintAssert = "SDL_ASSERT" HintPenMouseEvents = "SDL_PEN_MOUSE_EVENTS" HintPenTouchEvents = "SDL_PEN_TOUCH_EVENTS" )
const ( PropIOStreamWindowsHandlePointer = "SDL.iostream.windows.handle" PropIOStreamStdioFilePointer = "SDL.iostream.stdio.file" PropIOStreamFileDescriptorNumber = "SDL.iostream.file_descriptor" PropIOStreamAndroidAassetPointer = "SDL.iostream.android.aasset" PropIOStreamMemoryPointer = "SDL.iostream.memory.base" PropIOStreamMemorySizeNumber = "SDL.iostream.memory.size" PropIOStreamMemoryFreeFuncPointer = "SDL.iostream.memory.free" PropIOStreamDynamicMemoryPointer = "SDL.iostream.dynamic.memory" PropIOStreamDynamicChunksizeNumber = "SDL.iostream.dynamic.chunksize" )
const ( PropJoystickCapMonoLEDBoolean = "SDL.joystick.cap.mono_led" PropJoystickCapRGBLEDBoolean = "SDL.joystick.cap.rgb_led" PropJoystickCapPlayerLEDBoolean = "SDL.joystick.cap.player_led" PropJoystickCapRumbleBoolean = "SDL.joystick.cap.rumble" PropJoystickCapTriggerRumbleBoolean = "SDL.joystick.cap.trigger_rumble" )
const ( HatCentered = 0x00 HatUp = 0x01 HatRight = 0x02 HatDown = 0x04 HatLeft = 0x08 HatRightUp = HatRight | HatUp HatRightDown = HatRight | HatDown HatLeftUp = HatLeft | HatUp HatLeftDown = HatLeft | HatDown )
const ( PropTextInputTypeNumber = "SDL.textinput.type" PropTextInputCapitalizationNumber = "SDL.textinput.capitalization" PropTextInputAutocorrectBoolean = "SDL.textinput.autocorrect" PropTextInputMultilineBoolean = "SDL.textinput.multiline" PropTextInputAndroidInputTypeNumber = "SDL.textinput.android.inputtype" )
const ( AlphaOpaque = 255 AlphaOpaqueFloat = 1.0 AlphaTransparent = 0 AlphaTransparentFloat = 0.0 )
const ( PropProcessCreateArgsPointer = "SDL.process.create.args" PropProcessCreateEnvironmentPointer = "SDL.process.create.environment" PropProcessCreateWorkingDirectoryString = "SDL.process.create.working_directory" PropProcessCreateStdinNumber = "SDL.process.create.stdin_option" PropProcessCreateStdinPointer = "SDL.process.create.stdin_source" PropProcessCreateStdoutNumber = "SDL.process.create.stdout_option" PropProcessCreateStdoutPointer = "SDL.process.create.stdout_source" PropProcessCreateStderrNumber = "SDL.process.create.stderr_option" PropProcessCreateStderrPointer = "SDL.process.create.stderr_source" PropProcessCreateStderrToStdoutBoolean = "SDL.process.create.stderr_to_stdout" PropProcessCreateBackgroundBoolean = "SDL.process.create.background" PropProcessCreateCmdlineString = "SDL.process.create.cmdline" PropProcessPidNumber = "SDL.process.pid" PropProcessStdinPointer = "SDL.process.stdin" PropProcessStdoutPointer = "SDL.process.stdout" PropProcessStderrPointer = "SDL.process.stderr" PropProcessBackgroundBoolean = "SDL.process.background" )
const ( SoftwareRenderer = "software" GPURenderer = "gpu" )
const ( PropRendererCreateNameString = "SDL.renderer.create.name" PropRendererCreateWindowPointer = "SDL.renderer.create.window" PropRendererCreateSurfacePointer = "SDL.renderer.create.surface" PropRendererCreateOutputColorspaceNumber = "SDL.renderer.create.output_colorspace" PropRendererCreatePresentVSyncNumber = "SDL.renderer.create.present_vsync" PropRendererCreateGpuDevicePointer = "SDL.renderer.create.gpu.device" PropRendererCreateGpuShadersSpirvBoolean = "SDL.renderer.create.gpu.shaders_spirv" PropRendererCreateGpuShadersDxilBoolean = "SDL.renderer.create.gpu.shaders_dxil" PropRendererCreateGpuShadersMslBoolean = "SDL.renderer.create.gpu.shaders_msl" PropRendererCreateVulkanInstancePointer = "SDL.renderer.create.vulkan.instance" PropRendererCreateVulkanSurfaceNumber = "SDL.renderer.create.vulkan.surface" PropRendererCreateVulkanPhysicalDevicePointer = "SDL.renderer.create.vulkan.physical_device" PropRendererCreateVulkanDevicePointer = "SDL.renderer.create.vulkan.device" PropRendererCreateVulkanGraphicsQueueFamilyIndexNumber = "SDL.renderer.create.vulkan.graphics_queue_family_index" PropRendererCreateVulkanPresentQueueFamilyIndexNumber = "SDL.renderer.create.vulkan.present_queue_family_index" PropRendererNameString = "SDL.renderer.name" PropRendererWindowPointer = "SDL.renderer.window" PropRendererSurfacePointer = "SDL.renderer.surface" PropRendererVSyncNumber = "SDL.renderer.vsync" PropRendererMaxTextureSizeNumber = "SDL.renderer.max_texture_size" PropRendererTextureFormatsPointer = "SDL.renderer.texture_formats" PropRendererTextureWrappingBoolean = "SDL.renderer.texture_wrapping" PropRendererOutputColorspaceNumber = "SDL.renderer.output_colorspace" PropRendererHDREnabledBoolean = "SDL.renderer.HDR_enabled" PropRendererSDRWhitePointFloat = "SDL.renderer.SDR_white_point" PropRendererHDRHeadroomFloat = "SDL.renderer.HDR_headroom" PropRendererD3D9DevicePointer = "SDL.renderer.d3d9.device" PropRendererD3D11DevicePointer = "SDL.renderer.d3d11.device" PropRendererD3D11SwapchainPointer = "SDL.renderer.d3d11.swap_chain" PropRendererD3D12DevicePointer = "SDL.renderer.d3d12.device" PropRendererD3D12SwapchainPointer = "SDL.renderer.d3d12.swap_chain" PropRendererD3D12CommandQueuePointer = "SDL.renderer.d3d12.command_queue" PropRendererVulkanInstancePointer = "SDL.renderer.vulkan.instance" PropRendererVulkanSurfaceNumber = "SDL.renderer.vulkan.surface" PropRendererVulkanPhysicalDevicePointer = "SDL.renderer.vulkan.physical_device" PropRendererVulkanDevicePointer = "SDL.renderer.vulkan.device" PropRendererVulkanGraphicsQueueFamilyIndexNumber = "SDL.renderer.vulkan.graphics_queue_family_index" PropRendererVulkanPresentQueueFamilyIndexNumber = "SDL.renderer.vulkan.present_queue_family_index" PropRendererVulkanSwapchainImageCountNumber = "SDL.renderer.vulkan.swapchain_image_count" PropRendererGPUDevicePointer = "SDL.renderer.gpu.device" PropTextureCreateColorspaceNumber = "SDL.texture.create.colorspace" PropTextureCreateFormatNumber = "SDL.texture.create.format" PropTextureCreateAccessNumber = "SDL.texture.create.access" PropTextureCreateWidthNumber = "SDL.texture.create.width" PropTextureCreateHeightNumber = "SDL.texture.create.height" PropTextureCreatePalettePointer = "SDL.texture.create.palette" PropTextureCreateSDRWhitePointFloat = "SDL.texture.create.SDR_white_point" PropTextureCreateHDRHeadroomFloat = "SDL.texture.create.HDR_headroom" PropTextureCreateD3D11TexturePointer = "SDL.texture.create.d3d11.texture" PropTextureCreateD3D11TextureUPointer = "SDL.texture.create.d3d11.texture_u" PropTextureCreateD3D11TextureVPointer = "SDL.texture.create.d3d11.texture_v" PropTextureCreateD3D12TexturePointer = "SDL.texture.create.d3d12.texture" PropTextureCreateD3D12TextureUPointer = "SDL.texture.create.d3d12.texture_u" PropTextureCreateD3D12TextureVPointer = "SDL.texture.create.d3d12.texture_v" PropTextureCreateMetalPixelbufferPointer = "SDL.texture.create.metal.pixelbuffer" PropTextureCreateOpenGLTextureNumber = "SDL.texture.create.opengl.texture" PropTextureCreateOpenGLTextureUvNumber = "SDL.texture.create.opengl.texture_uv" PropTextureCreateOpenGLTextureUNumber = "SDL.texture.create.opengl.texture_u" PropTextureCreateOpenGLTextureVNumber = "SDL.texture.create.opengl.texture_v" PropTextureCreateOpenGLES2TextureNumber = "SDL.texture.create.opengles2.texture" PropTextureCreateOpenGLES2TextureUvNumber = "SDL.texture.create.opengles2.texture_uv" PropTextureCreateOpenGLES2TextureUNumber = "SDL.texture.create.opengles2.texture_u" PropTextureCreateOpenGLES2TextureVNumber = "SDL.texture.create.opengles2.texture_v" PropTextureCreateVulkanTextureNumber = "SDL.texture.create.vulkan.texture" PropTextureCreateVulkanLayoutNumber = "SDL.texture.create.vulkan.layout" PropTextureCreateGPUTexturePointer = "SDL.texture.create.gpu.texture" PropTextureCreateGPUTextureUvPointer = "SDL.texture.create.gpu.texture_uv" PropTextureCreateGPUTextureUPointer = "SDL.texture.create.gpu.texture_u" PropTextureCreateGPUTextureVPointer = "SDL.texture.create.gpu.texture_v" PropTextureColorspaceNumber = "SDL.texture.colorspace" PropTextureFormatNumber = "SDL.texture.format" PropTextureAccessNumber = "SDL.texture.access" PropTextureWidthNumber = "SDL.texture.width" PropTextureHeightNumber = "SDL.texture.height" PropTextureSDRWhitePointFloat = "SDL.texture.SDR_white_point" PropTextureHDRHeadroomFloat = "SDL.texture.HDR_headroom" PropTextureD3D11TexturePointer = "SDL.texture.d3d11.texture" PropTextureD3D11TextureUPointer = "SDL.texture.d3d11.texture_u" PropTextureD3D11TextureVPointer = "SDL.texture.d3d11.texture_v" PropTextureD3D12TexturePointer = "SDL.texture.d3d12.texture" PropTextureD3D12TextureUPointer = "SDL.texture.d3d12.texture_u" PropTextureD3D12TextureVPointer = "SDL.texture.d3d12.texture_v" PropTextureOpenGLTextureNumber = "SDL.texture.opengl.texture" PropTextureOpenGLTextureUvNumber = "SDL.texture.opengl.texture_uv" PropTextureOpenGLTextureUNumber = "SDL.texture.opengl.texture_u" PropTextureOpenGLTextureVNumber = "SDL.texture.opengl.texture_v" PropTextureOpenGLTextureTargetNumber = "SDL.texture.opengl.target" PropTextureOpenGLTexWFloat = "SDL.texture.opengl.tex_w" PropTextureOpenGLTexHFloat = "SDL.texture.opengl.tex_h" PropTextureOpenGLES2TextureNumber = "SDL.texture.opengles2.texture" PropTextureOpenGLES2TextureUvNumber = "SDL.texture.opengles2.texture_uv" PropTextureOpenGLES2TextureUNumber = "SDL.texture.opengles2.texture_u" PropTextureOpenGLES2TextureVNumber = "SDL.texture.opengles2.texture_v" PropTextureOpenGLES2TextureTargetNumber = "SDL.texture.opengles2.target" PropTextureVulkanTextureNumber = "SDL.texture.vulkan.texture" PropTextureGPUTexturePointer = "SDL.texture.gpu.texture" PropTextureGPUTextureUVPointer = "SDL.texture.gpu.texture_uv" PropTextureGPUTextureUPointer = "SDL.texture.gpu.texture_u" PropTextureGPUTextureVPointer = "SDL.texture.gpu.texture_v" )
const ( RendererVSyncDisabled = 0 RendererVSyncAdaptive = -1 )
const ( PropSurfaceSDRWhitePointFloat = "SDL.surface.SDR_white_point" PropSurfaceHDRHeadroomFloat = "SDL.surface.HDR_headroom" PropSurfaceToneMapOperatorString = "SDL.surface.tonemap" PropSurfaceHotspotXNumber = "SDL.surface.hotspot.x" PropSurfaceHotspotYNumber = "SDL.surface.hotspot.y" PropSurfaceRotationFloat = "SDL.surface.rotation" )
const ( PropGlobalVideoWaylandWlDisplayPointer = "SDL.video.wayland.wl_display" PropDisplayHdrEnabledBoolean = "SDL.display.HDR_enabled" PropDisplayKmsdrmPanelOrientationNumber = "SDL.display.KMSDRM.panel_orientation" PropDisplayWaylandWlOutputPointer = "SDL.display.wayland.wl_output" PropDisplayWindowsHmonitorPointer = "SDL.display.windows.hmonitor" PropWindowCreateAlwaysOnTopBoolean = "SDL.window.create.always_on_top" PropWindowCreateBorderlessBoolean = "SDL.window.create.borderless" PropWindowCreateConstrainPopupBoolean = "SDL.window.create.constrain_popup" PropWindowCreateFocusableBoolean = "SDL.window.create.focusable" PropWindowCreateExternalGraphicsContextBoolean = "SDL.window.create.external_graphics_context" PropWindowCreateFlagsNumber = "SDL.window.create.flags" PropWindowCreateFullscreenBoolean = "SDL.window.create.fullscreen" PropWindowCreateHeightNumber = "SDL.window.create.height" PropWindowCreateHiddenBoolean = "SDL.window.create.hidden" PropWindowCreateHighPixelDensityBoolean = "SDL.window.create.high_pixel_density" PropWindowCreateMaximizedBoolean = "SDL.window.create.maximized" PropWindowCreateMenuBoolean = "SDL.window.create.menu" PropWindowCreateMetalBoolean = "SDL.window.create.metal" PropWindowCreateMinimizedBoolean = "SDL.window.create.minimized" PropWindowCreateModalBoolean = "SDL.window.create.modal" PropWindowCreateMouseGrabbedBoolean = "SDL.window.create.mouse_grabbed" PropWindowCreateOpenglBoolean = "SDL.window.create.opengl" PropWindowCreateParentPointer = "SDL.window.create.parent" PropWindowCreateResizableBoolean = "SDL.window.create.resizable" PropWindowCreateTitleString = "SDL.window.create.title" PropWindowCreateTransparentBoolean = "SDL.window.create.transparent" PropWindowCreateTooltipBoolean = "SDL.window.create.tooltip" PropWindowCreateUtilityBoolean = "SDL.window.create.utility" PropWindowCreateVulkanBoolean = "SDL.window.create.vulkan" PropWindowCreateWidthNumber = "SDL.window.create.width" PropWindowCreateXNumber = "SDL.window.create.x" PropWindowCreateYNumber = "SDL.window.create.y" PropWindowCreateCocoaWindowPointer = "SDL.window.create.cocoa.window" PropWindowCreateCocoaViewPointer = "SDL.window.create.cocoa.view" PropWindowCreateWindowscenePointer = "SDL.window.create.uikit.windowscene" PropWindowCreateWaylandSurfaceRoleCustomBoolean = "SDL.window.create.wayland.surface_role_custom" PropWindowCreateWaylandCreateEglWindowBoolean = "SDL.window.create.wayland.create_egl_window" PropWindowCreateWaylandWlSurfacePointer = "SDL.window.create.wayland.wl_surface" PropWindowCreateWin32HwndPointer = "SDL.window.create.win32.hwnd" PropWindowCreateWin32PixelFormatHwndPointer = "SDL.window.create.win32.pixel_format_hwnd" PropWindowCreateX11WindowNumber = "SDL.window.create.x11.window" PropWindowCreateEmscriptenCanvasIdString = "SDL.window.create.emscripten.canvas_id" PropWindowCreateEmscriptenKeyboardElementString = "SDL.window.create.emscripten.keyboard_element" PropWindowShapePointer = "SDL.window.shape" PropWindowHDREnabledBoolean = "SDL.window.HDR_enabled" PropWindowSDRWhiteLevelFloat = "SDL.window.SDR_white_level" PropWindowHDRHeadroomFloat = "SDL.window.HDR_headroom" PropWindowAndroidWindowPointer = "SDL.window.android.window" PropWindowAndroidSurfacePointer = "SDL.window.android.surface" PropWindowUiKitWindowPointer = "SDL.window.uikit.window" PropWindowUiKitMetalViewTagNumber = "SDL.window.uikit.metal_view_tag" PropWindowUiKitOpenGLFramebufferNumber = "SDL.window.uikit.opengl.framebuffer" PropWindowUiKitOpenGLRenderbufferNumber = "SDL.window.uikit.opengl.renderbuffer" PropWindowUiKitOpenGLResolveFramebufferNumber = "SDL.window.uikit.opengl.resolve_framebuffer" PropWindowKmsDrmDeviceIndexNumber = "SDL.window.kmsdrm.dev_index" PropWindowKmsDrmDrmFdNumber = "SDL.window.kmsdrm.drm_fd" PropWindowKmsDrmGbmDevicePointer = "SDL.window.kmsdrm.gbm_dev" PropWindowCocoaWindowPointer = "SDL.window.cocoa.window" PropWindowCocoaMetalViewTagNumber = "SDL.window.cocoa.metal_view_tag" PropWindowOpenVROverlayID = "SDL.window.openvr.overlay_id" PropWindowVivanteDisplayPointer = "SDL.window.vivante.display" PropWindowVivanteWindowPointer = "SDL.window.vivante.window" PropWindowVivanteSurfacePointer = "SDL.window.vivante.surface" PropWindowWin32HwndPointer = "SDL.window.win32.hwnd" PropWindowWin32HdcPointer = "SDL.window.win32.hdc" PropWindowWin32InstancePointer = "SDL.window.win32.instance" PropWindowWaylandDisplayPointer = "SDL.window.wayland.display" PropWindowWaylandSurfacePointer = "SDL.window.wayland.surface" PropWindowWaylandViewportPointer = "SDL.window.wayland.viewport" PropWindowWaylandEGLWindowPointer = "SDL.window.wayland.egl_window" PropWindowWaylandXDGSurfacePointer = "SDL.window.wayland.xdg_surface" PropWindowWaylandXDGToplevelPointer = "SDL.window.wayland.xdg_toplevel" PropWindowWaylandXDGToplevelExportHandleString = "SDL.window.wayland.xdg_toplevel_export_handle" PropWindowWaylandXDGPopupPointer = "SDL.window.wayland.xdg_popup" PropWindowWaylandXDGPositionerPointer = "SDL.window.wayland.xdg_positioner" PropWindowX11DisplayPointer = "SDL.window.x11.display" PropWindowX11ScreenNumber = "SDL.window.x11.screen" PropWindowX11WindowNumber = "SDL.window.x11.window" PropWindowEmscriptenCanvasIdString = "SDL.window.emscripten.canvas_id" PropWindowEmscriptenKeyboardElementString = "SDL.window.emscripten.keyboard_element" )
const ( WindowSurfaceVsyncDisabled int32 = 0 WindowSurfaceVsyncAdaptive int32 = (-1) )
const ( WindowPosUndefinedMask uint32 = 0x1FFF0000 WindowPosUndefined = WindowPosUndefinedMask WindowPosCenteredMask uint32 = 0x2FFF0000 WindowPosCentered = WindowPosCenteredMask )
const (
DebugTextFontCharacterSize = 8
)
const FltEpsilon = 0x0.000002p0
const HapticInfinity = 4294967295 // Used to play a device an infinite number of times.
const PropAudiostreamAutoCleanupBoolean = "SDL.audiostream.auto_cleanup"
const PropGPUBufferCreateNameString = "SDL.gpu.buffer.create.name"
const PropGPUSamplerCreateNameString = "SDL.gpu.sampler.create.name"
const PropGPUShaderCreateNameString = "SDL.gpu.shader.create.name"
const PropGPUTransferbufferCreateNameString = "SDL.gpu.transferbuffer.create.name"
const PropHidapiLibusbDeviceHandlePointer = "SDL.hidapi.libusb.device.handle"
Variables ¶
This section is empty.
Functions ¶
func AcquireGPUSwapchainTexture ¶
func AcquireGPUSwapchainTexture(commandBuffer *GPUCommandBuffer, window *Window, swapchainTexture **GPUTexture, swapchainTextureWidth *uint32, swapchainTextureHeight *uint32) bool
AcquireGPUSwapchainTexture acquires a texture to use in presentation.
func AddEventWatch ¶
func AddEventWatch(filter EventFilter, userdata unsafe.Pointer) bool
AddEventWatch adds a callback to be triggered when an event is added to the event queue.
func AddHintCallback ¶
func AddHintCallback(name string, callback HintCallback, userdata unsafe.Pointer) bool
AddHintCallback adds a function to watch a particular hint.
func AddSurfaceAlternateImage ¶
AddSurfaceAlternateImage adds an alternate version of a surface.
func AddVulkanRenderSemaphores ¶
func AddVulkanRenderSemaphores(renderer *Renderer, waitStageMask uint32, waitSemaphore int64, signalSemaphore int64) bool
AddVulkanRenderSemaphores adds a set of synchronization semaphores for the current frame.
func AudioStreamDevicePaused ¶
func AudioStreamDevicePaused(stream *AudioStream) bool
AudioStreamDevicePaused queries if an audio device associated with a stream is paused.
func BindGPUFragmentSamplers ¶
func BindGPUFragmentSamplers(renderPass *GPURenderPass, firstSlot uint32, textureSamplerBindings *GPUTextureSamplerBinding, numBindings uint32)
BindGPUFragmentSamplers binds texture-sampler pairs for use on the fragment shader.
func BindGPUFragmentStorageBuffers ¶
func BindGPUFragmentStorageBuffers(renderPass *GPURenderPass, firstSlot uint32, storageBuffers **GPUBuffer, numBindings uint32)
BindGPUFragmentStorageBuffers binds storage buffers for use on the fragment shader.
func BindGPUGraphicsPipeline ¶
func BindGPUGraphicsPipeline(renderPass *GPURenderPass, graphicsPipeline *GPUGraphicsPipeline)
BindGPUGraphicsPipeline binds a graphics pipeline on a render pass to be used in rendering.
func BindGPUIndexBuffer ¶
func BindGPUIndexBuffer(renderPass *GPURenderPass, binding *GPUBufferBinding, indexElementSize GPUIndexElementSize)
BindGPUIndexBuffer binds an index buffer on a command buffer for use with subsequent draw calls.
func BindGPUVertexBuffers ¶
func BindGPUVertexBuffers(renderPass *GPURenderPass, firstSlot uint32, bindings *GPUBufferBinding, numBindings uint32)
BindGPUVertexBuffers binds vertex buffers on a command buffer for use with subsequent draw calls.
func BindGPUVertexStorageBuffers ¶
func BindGPUVertexStorageBuffers(renderPass *GPURenderPass, firstSlot uint32, storageBuffers **GPUBuffer, numBindings uint32)
BindGPUVertexStorageBuffers binds storage buffers for use on the vertex shader.
func BlitSurface ¶
BlitSurface performs a fast blit from the source surface to the destination surface with clipping.
func CaptureMouse ¶
CaptureMouse captures the mouse and to track input outside an SDL window.
func ClaimWindowForGPUDevice ¶
ClaimWindowForGPUDevice claims a window, creating a swapchain structure for it.
func ClearAudioStream ¶
func ClearAudioStream(stream *AudioStream) bool
ClearAudioStream clears any pending data in the stream.
func ClearComposition ¶
ClearComposition dismisses the composition window/IME without disabling the subsystem.
func ClearError ¶
func ClearError() bool
ClearError clears any previous error message for this thread.
func ClearProperty ¶
func ClearProperty(props PropertiesID, name string) bool
ClearProperty clears a property from a group of properties.
func CloseCamera ¶
func CloseCamera(camera *Camera)
CloseCamera shuts down camera processing and close the camera device.
func CloseGamepad ¶
func CloseGamepad(gamepad *Gamepad)
CloseGamepad closes a gamepad previously opened with OpenGamepad.
func CloseJoystick ¶
func CloseJoystick(joystick *Joystick)
CloseJoystick closes a joystick previously opened with OpenJoystick.
func ConvertEventToRenderCoordinates ¶
ConvertEventToRenderCoordinates converts the coordinates in an event to render coordinates.
func ConvertPixels ¶
func ConvertPixels(width int32, height int32, srcFormat PixelFormat, src unsafe.Pointer, srcPitch int32, dstFormat PixelFormat, dst unsafe.Pointer, dstPitch int32) bool
ConvertPixels copies a block of pixels of one format to another format.
func ConvertPixelsAndColorspace ¶
func ConvertPixelsAndColorspace(width int32, height int32, srcFormat PixelFormat, srcColorspace Colorspace, srcProperties PropertiesID, src unsafe.Pointer, srcPitch int32, dstFormat PixelFormat, dstColorspace Colorspace, dstProperties PropertiesID, dst unsafe.Pointer, dstPitch int32) bool
ConvertPixelsAndColorspace copies a block of pixels of one format and colorspace to another format and colorspace.
func CopyProperties ¶
func CopyProperties(src PropertiesID, dst PropertiesID) bool
CopyProperties copies a group of properties.
func CreateWindowAndRenderer ¶
func CreateWindowAndRenderer(title string, width, height int32, flags WindowFlags, window **Window, renderer **Renderer) bool
CreateWindowAndRenderer creates a window and default renderer.
func CursorVisible ¶
func CursorVisible() bool
CursorVisible returns true if the cursor is being shown, or false if the cursor is hidden.
func DelayNS ¶
func DelayNS(ns uint64)
DelayNS waits a specified number of nanoseconds before returning.
func DestroyAudioStream ¶
func DestroyAudioStream(stream *AudioStream)
DestroyAudioStream frees an audio stream.
func DestroyCursor ¶
func DestroyCursor(cursor *Cursor)
DestroyCursor frees a previously-created cursor.
func DestroyGPUDevice ¶
func DestroyGPUDevice(device *GPUDevice)
DestroyGPUDevice destroys a GPU context previously returned by CreateGPUDevice.
func DestroyPalette ¶
func DestroyPalette(palette *Palette)
DestroyPalette frees a palette created with CreatePalette.
func DestroyProperties ¶
func DestroyProperties(props PropertiesID)
DestroyProperties destroys a group of properties.
func DestroyRenderer ¶
func DestroyRenderer(renderer *Renderer)
DestroyRenderer destroys the rendering context for a window and free all associated textures.
func DestroyTexture ¶
func DestroyTexture(texture *Texture)
DestroyTexture destroys the specified texture.
func DestroyWindowSurface ¶
DestroyWindowSurface destroys the surface associated with the window.
func DisableScreenSaver ¶
func DisableScreenSaver() bool
DisableScreenSaver prevents the screen from being blanked by a screen saver.
func DrawGPUIndexedPrimitives ¶
func DrawGPUIndexedPrimitives(renderPass *GPURenderPass, numIndices uint32, numInstances uint32, firstIndex uint32, vertexOffset int32, firstInstance uint32)
DrawGPUIndexedPrimitives draws data using bound graphics state with an index buffer and instancing enabled.
func DrawGPUPrimitives ¶
func DrawGPUPrimitives(renderPass *GPURenderPass, numVertices uint32, numInstances uint32, firstVertex uint32, firstInstance uint32)
DrawGPUPrimitives draws data using bound graphics state.
func EnableScreenSaver ¶
func EnableScreenSaver() bool
EnableScreenSaver allows the screen to be blanked by a screen saver.
func EndGPUCopyPass ¶
func EndGPUCopyPass(copyPass *GPUCopyPass)
EndGPUCopyPass ends the current copy pass.
func EndGPURenderPass ¶
func EndGPURenderPass(renderPass *GPURenderPass)
EndGPURenderPass ends the given render pass.
func EnumerateProperties ¶
func EnumerateProperties(props PropertiesID, callback EnumeratePropertiesCallback, userdata unsafe.Pointer) bool
EnumerateProperties enumerates the properties contained in a group of properties.
func EventEnabled ¶
EventEnabled returns true if the event is being processed, false otherwise.
func FillSurfaceRect ¶
FillSurfaceRect performs a fast fill of a rectangle with a specific color.
func FilterEvents ¶
func FilterEvents(filter EventFilter, userdata unsafe.Pointer)
FilterEvents runs a specific filter function on the current event queue, removing any events for which the filter returns false.
func FlashWindow ¶
func FlashWindow(window *Window, operation FlashOperation) bool
FlashWindow requests a window to demand attention from the user.
func FlipSurface ¶
FlipSurface flips a surface vertically or horizontally.
func FlushAudioStream ¶
func FlushAudioStream(stream *AudioStream) bool
FlushAudioStream tells the stream that you're done sending data, and anything being buffered should be converted/resampled and made available immediately.
func FlushEvent ¶
func FlushEvent(eventType EventType)
FlushEvent clears events of a specific type from the event queue.
func FlushEvents ¶
func FlushEvents(minType, maxType EventType)
FlushEvents clears events of a range of types from the event queue.
func FlushRenderer ¶
FlushRenderer forces the rendering context to flush any pending commands and state.
func GLDestroyContext ¶
GLDestroyContext deletes an OpenGL context.
func GLGetAttribute ¶
GLGetAttribute gets the actual value for an attribute from the current context.
func GLSetAttribute ¶
GLSetAttribute sets the OpenGL attribute attr to value. The requested attributes should be set before creating an OpenGL window.
You should use GLGetAttribute to check the values after creating the OpenGL context, since the values obtained can differ from the requested ones.
func GLSetSwapInterval ¶
GLSetSwapInterval sets the swap interval for the current OpenGL context.
func GLSwapWindow ¶
GLSwapWindow updates a window with OpenGL rendering.
func GetAppMetadataProperty ¶
GetAppMetadataProperty gets metadata about your app.
func GetAudioDriver ¶
GetAudioDriver gets the name of a built in audio driver.
func GetAudioStreamFormat ¶
func GetAudioStreamFormat(stream *AudioStream, srcSpec *AudioSpec, dstSpec *AudioSpec) bool
GetAudioStreamFormat queries the current format of an audio stream.
func GetAudioStreamFrequencyRatio ¶
func GetAudioStreamFrequencyRatio(stream *AudioStream) float32
GetAudioStreamFrequencyRatio gets the frequency ratio of an audio stream.
func GetAudioStreamGain ¶
func GetAudioStreamGain(stream *AudioStream) float32
GetAudioStreamGain gets the gain of an audio stream.
func GetAudioStreamQueued ¶
func GetAudioStreamQueued(stream *AudioStream) int32
GetAudioStreamQueued gets the number of bytes currently queued.
func GetBasePath ¶
func GetBasePath() string
GetBasePath gets the directory where the application was run from.
func GetBooleanProperty ¶
func GetBooleanProperty(props PropertiesID, name string, defaultValue bool) bool
GetBooleanProperty gets a boolean property from a group of properties.
func GetCPUCacheLineSize ¶
func GetCPUCacheLineSize() int32
GetCPUCacheLineSize determines the L1 cache line size of the CPU.
func GetCameraDriver ¶
GetCameraDriver returns the name of the camera driver at the requested index, or "" if an invalid index was specified.
func GetCameraFormat ¶
func GetCameraFormat(camera *Camera, spec *CameraSpec) bool
GetCameraFormat gets the spec that a camera is using when generating images.
func GetCameraName ¶
GetCameraName returns a human-readable device name or "" on failure.
func GetClipboardText ¶
func GetClipboardText() string
GetClipboardText gets UTF-8 text from the clipboard.
func GetClosestFullscreenDisplayMode ¶
func GetClosestFullscreenDisplayMode(displayID DisplayID, w int32, h int32, refreshRate float32, includeHighDensityModes bool, closest *DisplayMode) bool
GetClosestFullscreenDisplayMode gets the closest match to the requested display mode.
func GetCurrentAudioDriver ¶
func GetCurrentAudioDriver() string
GetCurrentAudioDriver gets the name of the current audio driver.
func GetCurrentCameraDriver ¶
func GetCurrentCameraDriver() string
GetCurrentCameraDriver returns the name of the current camera driver or "" if no driver has been initialized.
func GetCurrentDirectory ¶
func GetCurrentDirectory() string
GetCurrentDirectory gets what the system believes is the "current working directory".
func GetCurrentRenderOutputSize ¶
GetCurrentRenderOutputSize gets the current output size in pixels of a rendering context.
func GetCurrentVideoDriver ¶
func GetCurrentVideoDriver() string
GetCurrentVideoDriver gets the name of the currently initialized video driver.
func GetDefaultTextureScaleMode ¶
GetDefaultTextureScaleMode gets default scale mode for new textures for given renderer.
Available since SDL 3.4.0.
func GetDisplayBounds ¶
GetDisplayBounds gets the desktop area represented by a display.
func GetDisplayContentScale ¶
GetDisplayContentScale gets the content scale of a display.
func GetDisplayName ¶
GetDisplayName gets the name of a display in UTF-8 encoding.
func GetDisplayUsableBounds ¶
GetDisplayUsableBounds gets the usable desktop area represented by a display, in screen coordinates.
func GetError ¶
func GetError() string
GetError retrieves a message about the last error that occurred on the current thread.
func GetEventFilter ¶
func GetEventFilter(filter *EventFilter, userdata *unsafe.Pointer) bool
GetEventFilter queries the current event filter.
func GetFloatProperty ¶
func GetFloatProperty(props PropertiesID, name string, defaultValue float32) float32
GetFloatProperty gets a floating point property from a group of properties.
func GetGPUDeviceDriver ¶
GetGPUDeviceDriver returns the name of the backend used to create this GPU context.
func GetGPUDriver ¶
GetGPUDriver gets the name of a built in GPU driver.
func GetGamepadName ¶
GetGamepadName gets the implementation-dependent name for an opened gamepad.
func GetGamepadNameForID ¶
func GetGamepadNameForID(instanceId JoystickID) string
GetGamepadNameForID gets the implementation dependent name of a gamepad.
func GetGamepadSerial ¶
GetGamepadSerial returns the serial number of an opened gamepad, or "" if unavailable.
func GetGamepadStringForButton ¶
func GetGamepadStringForButton(button GamepadButton) string
GetGamepadStringForButton returns the name for the given button.
func GetGamepadStringForType ¶
func GetGamepadStringForType(gamepadType GamepadType) string
GetGamepadStringForType converts from an GamepadType enum to a string.
func GetHintBoolean ¶
GetHintBoolean gets the boolean value of a hint variable.
func GetJoystickAxis ¶
GetJoystickAxis gets the current state of an axis control on a joystick.
func GetJoystickAxisInitialState ¶
GetJoystickAxisInitialState gets the initial state of an axis control on a joystick.
func GetJoystickBall ¶
GetJoystickBall gets the ball axis change since the last poll.
func GetJoystickButton ¶
GetJoystickButton gets the current state of a button on a joystick.
func GetJoystickFirmwareVersion ¶
GetJoystickFirmwareVersion gets the firmware version of an opened joystick, if available.
func GetJoystickHat ¶
GetJoystickHat gets the current state of a POV hat on a joystick.
func GetJoystickName ¶
GetJoystickName gets the implementation dependent name of a joystick.
func GetJoystickNameForID ¶
func GetJoystickNameForID(instanceId JoystickID) string
GetJoystickNameForID gets the implementation dependent name of a joystick.
func GetJoystickPath ¶
GetJoystickPath gets the implementation dependent path of a joystick.
func GetJoystickPathForID ¶
func GetJoystickPathForID(instanceId JoystickID) string
GetJoystickPathForID gets the implementation dependent path of a joystick.
func GetJoystickPlayerIndex ¶
GetJoystickPlayerIndex gets the player index of an opened joystick.
func GetJoystickPlayerIndexForID ¶
func GetJoystickPlayerIndexForID(instanceId JoystickID) int32
GetJoystickPlayerIndexForID gets the player index of a joystick.
func GetJoystickProduct ¶
GetJoystickProduct gets the USB product ID of an opened joystick, if available.
func GetJoystickProductForID ¶
func GetJoystickProductForID(instanceId JoystickID) uint16
GetJoystickProductForID gets the USB product ID of a joystick, if available.
func GetJoystickProductVersion ¶
GetJoystickProductVersion gets the product version of an opened joystick, if available.
func GetJoystickProductVersionForID ¶
func GetJoystickProductVersionForID(instanceId JoystickID) uint16
GetJoystickProductVersionForID gets the product version of a joystick, if available.
func GetJoystickSerial ¶
GetJoystickSerial gets the serial number of an opened joystick, if available.
func GetJoystickVendor ¶
GetJoystickVendor gets the USB vendor ID of an opened joystick, if available.
func GetJoystickVendorForID ¶
func GetJoystickVendorForID(instanceId JoystickID) uint16
GetJoystickVendorForID gets the USB vendor ID of a joystick, if available.
func GetKeyName ¶
GetKeyName gets a human-readable name for a key.
func GetKeyboardNameForID ¶
func GetKeyboardNameForID(instanceId KeyboardID) string
GetKeyboardNameForID gets the name of a keyboard.
func GetKeyboardState ¶
func GetKeyboardState() []bool
GetKeyboardState gets a snapshot of the current state of the keyboard.
func GetMouseNameForID ¶
GetMouseNameForID returns the name of the selected mouse.
On failure or if the mouse doesn't have a name, this function returns "".
func GetNumAudioDrivers ¶
func GetNumAudioDrivers() int32
GetNumAudioDrivers gets the number of built-in audio drivers.
func GetNumCameraDrivers ¶
func GetNumCameraDrivers() int32
GetNumCameraDrivers gets the number of built-in camera drivers.
func GetNumGPUDrivers ¶
func GetNumGPUDrivers() int32
GetNumGPUDrivers gets the number of GPU drivers compiled into SDL.
func GetNumJoystickAxes ¶
GetNumJoystickAxes gets the number of general axis controls on a joystick.
func GetNumJoystickBalls ¶
GetNumJoystickBalls gets the number of trackballs on a joystick.
func GetNumJoystickButtons ¶
GetNumJoystickButtons gets the number of buttons on a joystick.
func GetNumJoystickHats ¶
GetNumJoystickHats gets the number of POV hats on a joystick.
func GetNumLogicalCPUCores ¶
func GetNumLogicalCPUCores() int32
GetNumLogicalCPUCores gets the number of logical CPU cores available.
func GetNumRenderDrivers ¶
func GetNumRenderDrivers() int32
GetNumRenderDrivers gets the number of 2D rendering drivers available for the current display.
func GetNumVideoDrivers ¶
func GetNumVideoDrivers() int32
GetNumVideoDrivers gets the number of video drivers compiled into SDL.
func GetNumberProperty ¶
func GetNumberProperty(props PropertiesID, name string, defaultValue int64) int64
GetNumberProperty gets a number property from a group of properties.
func GetPerformanceCounter ¶
func GetPerformanceCounter() uint64
GetPerformanceCounter returns the current value of the high resolution counter.
func GetPerformanceFrequency ¶
func GetPerformanceFrequency() uint64
GetPerformanceFrequency returns the count per second of the high resolution counter.
func GetPointerProperty ¶
func GetPointerProperty(props PropertiesID, name string, defaultValue unsafe.Pointer) unsafe.Pointer
GetPointerProperty gets a pointer property from a group of properties.
func GetPrefPath ¶
GetPrefPath gets the user-and-app-specific path where files can be written.
func GetRectAndLineIntersection ¶
GetRectAndLineIntersection calculates the intersection of a rectangle and line segment.
func GetRectAndLineIntersectionFloat ¶
GetRectAndLineIntersectionFloat calculates the intersection of a rectangle and line segment with float precision.
func GetRenderClipRect ¶
GetRenderClipRect gets the clip rectangle for the current target.
func GetRenderColorScale ¶
GetRenderColorScale gets the color scale used for render operations.
func GetRenderDrawBlendMode ¶
GetRenderDrawBlendMode gets the blend mode used for drawing operations.
func GetRenderDrawColor ¶
GetRenderDrawColor gets the color used for drawing operations (Rect, Line and Clear).
func GetRenderDrawColorFloat ¶
func GetRenderDrawColorFloat(renderer *Renderer, r *float32, g *float32, b *float32, a *float32) bool
GetRenderDrawColorFloat gets the color used for drawing operations (Rect, Line and Clear).
func GetRenderDriver ¶
GetRenderDriver gets the name of a built in 2D rendering driver.
func GetRenderLogicalPresentation ¶
func GetRenderLogicalPresentation(renderer *Renderer, w *int32, h *int32, mode *RendererLogicalPresentation) bool
GetRenderLogicalPresentation gets device independent resolution and presentation mode for rendering.
func GetRenderLogicalPresentationRect ¶
GetRenderLogicalPresentationRect gets the final presentation rectangle for rendering.
func GetRenderMetalCommandEncoder ¶
GetRenderMetalCommandEncoder gets the Metal command encoder for the current frame.
func GetRenderMetalLayer ¶
GetRenderMetalLayer gets the CAMetalLayer associated with the given Metal renderer.
func GetRenderOutputSize ¶
GetRenderOutputSize gets the output size in pixels of a rendering context.
func GetRenderSafeArea ¶
GetRenderSafeArea gets the safe area for rendering within the current viewport.
func GetRenderScale ¶
GetRenderScale gets the drawing scale for the current target.
func GetRenderTextureAddressMode ¶
func GetRenderTextureAddressMode(renderer *Renderer, uMode, vMode *TextureAddressMode) bool
GetRenderTextureAddressMode gets the texture addressing mode used in RenderGeometry.
Available since SDL 3.4.0.
func GetRenderVSync ¶
GetRenderVSync gets VSync of the given renderer.
func GetRenderViewport ¶
GetRenderViewport gets the drawing area for the current target.
func GetRendererName ¶
GetRendererName returns the name of the selected renderer, or "" on failure.
func GetRevision ¶
func GetRevision() string
GetRevision returns an arbitrary string, uniquely identifying the exact revision of the SDL library in use.
func GetSIMDAlignment ¶
func GetSIMDAlignment() uint64
GetSIMDAlignment reports the alignment this system needs for SIMD allocations.
func GetScancodeName ¶
GetScancodeName gets a human-readable name for a scancode.
func GetStringProperty ¶
func GetStringProperty(props PropertiesID, name string, defaultValue string) string
GetStringProperty gets a string property from a group of properties.
func GetSurfaceAlphaMod ¶
GetSurfaceAlphaMod gets the additional alpha value used in blit operations.
func GetSurfaceBlendMode ¶
GetSurfaceBlendMode gets the blend mode used for blit operations.
func GetSurfaceClipRect ¶
GetSurfaceClipRect gets the clipping rectangle for a surface.
func GetSurfaceColorKey ¶
GetSurfaceColorKey gets the color key (transparent pixel) for a surface.
func GetSurfaceColorMod ¶
GetSurfaceColorMod gets the additional color value multiplied into blit operations.
func GetSystemPageSize ¶
func GetSystemPageSize() int32
GetSystemPageSize reports the size of a page of memory.
Available since SDL 3.4.0.
func GetSystemRAM ¶
func GetSystemRAM() int32
GetSystemRAM gets the amount of RAM configured in the system.
func GetTextInputArea ¶
GetTextInputArea gets the area used to type Unicode text input.
func GetTextureAlphaMod ¶
GetTextureAlphaMod gets the additional alpha value multiplied into render copy operations.
func GetTextureAlphaModFloat ¶
GetTextureAlphaModFloat gets the additional alpha value multiplied into render copy operations.
func GetTextureBlendMode ¶
GetTextureBlendMode gets the blend mode used for texture copy operations.
func GetTextureColorMod ¶
GetTextureColorMod gets the additional color value multiplied into render copy operations.
func GetTextureColorModFloat ¶
GetTextureColorModFloat gets the additional color value multiplied into render copy operations.
func GetTextureScaleMode ¶
GetTextureScaleMode gets the scale mode used for texture scale operations.
func GetTextureSize ¶
GetTextureSize gets the size of a texture, as floating point values.
func GetTicks ¶
func GetTicks() uint64
GetTicks returns the number of milliseconds that have elapsed since the SDL library initialization.
func GetTicksNS ¶
func GetTicksNS() uint64
GetTicksNS returns the number of nanoseconds since SDL library initialization.
func GetVersion ¶
func GetVersion() (major, minor, patch int32)
GetVersion gets the version of SDL that is linked against your program.
func GetVideoDriver ¶
GetVideoDriver gets the name of a built in video driver.
func GetWindowAspectRatio ¶
GetWindowAspectRatio gets the aspect ratio of a window's client area.
func GetWindowBordersSize ¶
GetWindowBordersSize gets the size of a window's borders (decorations) around the client area.
func GetWindowDisplayScale ¶
GetWindowDisplayScale gets the content display scale relative to a window's pixel size.
func GetWindowKeyboardGrab ¶
GetWindowKeyboardGrab returns true if keyboard is grabbed, and false otherwise.
func GetWindowMaximumSize ¶
GetWindowMaximumSize gets the maximum size of a window's client area.
func GetWindowMinimumSize ¶
GetWindowMinimumSize gets the minimum size of a window's client area.
func GetWindowMouseGrab ¶
GetWindowMouseGrab returns true if mouse is grabbed, and false otherwise.
func GetWindowOpacity ¶
GetWindowOpacity gets the opacity of a window.
func GetWindowPixelDensity ¶
GetWindowPixelDensity gets the pixel density of a window.
func GetWindowPosition ¶
GetWindowPosition gets the position of a window.
func GetWindowProgressValue ¶
GetWindowProgressValue gets the value of the progress bar for the given window’s taskbar icon.
Available since SDL 3.4.0.
func GetWindowRelativeMouseMode ¶
GetWindowRelativeMouseMode queries whether relative mouse mode is enabled for a window.
func GetWindowSafeArea ¶
GetWindowSafeArea gets the safe area for this window.
func GetWindowSize ¶
GetWindowSize gets the size of a window's client area.
func GetWindowSizeInPixels ¶
GetWindowSizeInPixels gets the size of a window's client area, in pixels.
func GetWindowSurfaceVSync ¶
GetWindowSurfaceVSync gets VSync for the window surface.
func GetWindowTitle ¶
GetWindowTitle gets the title of a window.
func HasARMSIMD ¶
func HasARMSIMD() bool
HasARMSIMD determines whether the CPU has ARM SIMD (ARMv6) features.
func HasAVX512F ¶
func HasAVX512F() bool
HasAVX512F determines whether the CPU has AVX-512F (foundation) features.
func HasAltiVec ¶
func HasAltiVec() bool
HasAltiVec determines whether the CPU has AltiVec features.
func HasEvents ¶
HasEvents checks for the existence of certain event types in the event queue.
Returns true if events with type >= minType and <= maxType are present, or false if not.
func HasJoystick ¶
func HasJoystick() bool
HasJoystick returns whether a joystick is currently connected.
func HasKeyboard ¶
func HasKeyboard() bool
HasKeyboard returns whether a keyboard is currently connected.
func HasLASX ¶
func HasLASX() bool
HasLASX determines whether the CPU has LASX (LOONGARCH SIMD) features.
func HasLSX ¶
func HasLSX() bool
HasLSX determines whether the CPU has LSX (LOONGARCH SIMD) features.
func HasProperty ¶
func HasProperty(props PropertiesID, name string) bool
HasProperty returns whether a property exists in a group of properties.
func HasRectIntersection ¶
HasRectIntersection determines whether two rectangles intersect.
func HasRectIntersectionFloat ¶
HasRectIntersectionFloat determines whether two rectangles intersect with float precision.
func HasScreenKeyboardSupport ¶
func HasScreenKeyboardSupport() bool
HasScreenKeyboardSupport checks whether the platform has screen keyboard support.
func InitSubSystem ¶
InitSubSystem is a compatibility function to initialize the SDL library.
This function and Init are interchangeable.
func InvalidParamError ¶
InvalidParamError sets the SDL error message, standardizes error reporting on unsupported operations.
func JoystickConnected ¶
JoystickConnected gets the status of a specified joystick.
func JoystickEventsEnabled ¶
func JoystickEventsEnabled() bool
JoystickEventsEnabled queries the state of joystick event processing.
func LoadWAV ¶
LoadWAV loads a WAV from a file path. The data returned in audioBuf should be disposed with Free when it is no longer needed.
func LoadWAVIO ¶
func LoadWAVIO(src *IOStream, closeio bool, spec *AudioSpec, audioBuf **uint8, audioLen *uint32) bool
LoadWAVIO loads the audio data of a WAVE file into memory and returns true on success. The data returned in audioBuf should be disposed with Free when it is no longer needed.
func LockJoysticks ¶
func LockJoysticks()
LockJoysticks locks for atomic access to the joystick API.
func LockProperties ¶
func LockProperties(props PropertiesID) bool
LockProperties locks a group of properties.
func LockSurface ¶
LockSurface sets up a surface for directly accessing the pixels.
func LockTexture ¶
LockTexture locks a portion of the texture for write-only pixel access.
func LockTextureToSurface ¶
LockTextureToSurface locks a portion of the texture for write-only pixel access, and expose it as a SDL surface.
func LogError ¶
func LogError(category LogCategory, format string, a ...any)
LogError logs a message with [LOG_PRIORITY_ERROR].
func LogMessage ¶
func LogMessage(category LogCategory, priority LogPriority, format string, a ...any)
LogMessage logs a message with the specified category and priority.
func MapGPUTransferBuffer ¶
func MapGPUTransferBuffer(device *GPUDevice, transferBuffer *GPUTransferBuffer, cycle bool) unsafe.Pointer
MapGPUTransferBuffer maps a transfer buffer into application address space.
func MapSurfaceRGB ¶
MapSurfaceRGB maps an RGB triple to an opaque pixel value for a surface.
func MaximizeWindow ¶
MaximizeWindow requests that the window be made as large as possible.
func MinimizeWindow ¶
MinimizeWindow requests that the window be minimized to an iconic representation.
func PauseAudioStreamDevice ¶
func PauseAudioStreamDevice(stream *AudioStream) bool
PauseAudioStreamDevice pauses audio playback on the audio device associated with an audio stream.
func PeepEvents ¶
func PeepEvents(events *Event, numevents int32, action EventAction, minType, maxType EventType) int32
PeepEvents checks the event queue for messages and optionally returns them.
Example:
sdl.PumpEvents() var events [2]sdl.Event sdl.PeepEvents(&events[0], 2, sdl.PeekEvent, sdl.EventFirst, sdl.EventLast)
func PointInRect ¶
PointInRect determines whether a point resides inside a rectangle.
func PointInRectFloat ¶
PointInRectFloat determines whether a point resides inside a floating point rectangle.
func PumpEvents ¶
func PumpEvents()
PumpEvents updates the event queue and internal input device state.
func PushGPUFragmentUniformData ¶
func PushGPUFragmentUniformData(commandBuffer *GPUCommandBuffer, slotIndex uint32, data unsafe.Pointer, length uint32)
PushGPUFragmentUniformData pushes data to a fragment uniform slot on the command buffer.
func PushGPUVertexUniformData ¶
func PushGPUVertexUniformData(commandBuffer *GPUCommandBuffer, slotIndex uint32, data unsafe.Pointer, length uint32)
PushGPUVertexUniformData pushes data to a vertex uniform slot on the command buffer.
func PutAudioStreamData ¶
func PutAudioStreamData(stream *AudioStream, buf *uint8, len int32) bool
PutAudioStreamData adds data to the stream.
func QuitSubSystem ¶
func QuitSubSystem(flags InitFlags)
QuitSubSystem shuts down specific SDL subsystems.
You still need to call Quit even if you close all open subsystems with this function.
func RaiseWindow ¶
RaiseWindow requests that a window be raised above other windows and gain the input focus.
func RectEmptyFloat ¶
RectEmptyFloat determines whether a floating point rectangle takes no space.
func RectsEqual ¶
RectsEqual determines whether two rectangles are equal.
func RectsEqualEpsilon ¶
RectsEqualEpsilon determines whether two floating point rectangles are equal, within some given epsilon.
func RectsEqualFloat ¶
RectsEqualFloat determines whether two floating point rectangles are equal, within a default epsilon.
func RegisterEvents ¶
RegisterEvents allocates a set of user-defined events, and return the beginning event number for that set of events.
func ReleaseCameraFrame ¶
ReleaseCameraFrame releases a frame of video acquired from a camera.
func ReleaseGPUBuffer ¶
ReleaseGPUBuffer frees the given buffer as soon as it is safe to do so.
func ReleaseGPUGraphicsPipeline ¶
func ReleaseGPUGraphicsPipeline(device *GPUDevice, graphicsPipeline *GPUGraphicsPipeline)
ReleaseGPUGraphicsPipeline frees the given graphics pipeline as soon as it is safe to do so.
func ReleaseGPUSampler ¶
func ReleaseGPUSampler(device *GPUDevice, sampler *GPUSampler)
ReleaseGPUSampler frees the given sampler as soon as it is safe to do so.
func ReleaseGPUShader ¶
ReleaseGPUShader frees the given shader as soon as it is safe to do so.
func ReleaseGPUTexture ¶
func ReleaseGPUTexture(device *GPUDevice, texture *GPUTexture)
ReleaseGPUTexture Frees the given texture as soon as it is safe to do so.
func ReleaseGPUTransferBuffer ¶
func ReleaseGPUTransferBuffer(device *GPUDevice, transferBuffer *GPUTransferBuffer)
ReleaseGPUTransferBuffer frees the given transfer buffer as soon as it is safe to do so.
func ReleaseWindowFromGPUDevice ¶
ReleaseWindowFromGPUDevice unclaims a window, destroying its swapchain structure.
func RemoveEventWatch ¶
func RemoveEventWatch(filter EventFilter, userdata unsafe.Pointer)
RemoveEventWatch removes an event watch callback added with AddEventWatch.
This function takes the same input as AddEventWatch to identify and delete the corresponding callback.
func RemoveHintCallback ¶
func RemoveHintCallback(name string, callback HintCallback, userdata unsafe.Pointer)
RemoveHintCallback removes a function watching a particular hint.
func RemoveSurfaceAlternateImages ¶
func RemoveSurfaceAlternateImages(surface *Surface)
RemoveSurfaceAlternateImages removes all alternate versions of a surface.
func RenderClear ¶
RenderClear clears the current rendering target with the drawing color.
func RenderClipEnabled ¶
RenderClipEnabled gets whether clipping is enabled on the given render target.
func RenderCoordinatesFromWindow ¶
func RenderCoordinatesFromWindow(renderer *Renderer, windowX float32, windowY float32, x *float32, y *float32) bool
RenderCoordinatesFromWindow gets a point in render coordinates when given a point in window coordinates.
func RenderCoordinatesToWindow ¶
func RenderCoordinatesToWindow(renderer *Renderer, x float32, y float32, windowX *float32, windowY *float32) bool
RenderCoordinatesToWindow gets a point in window coordinates when given a point in render coordinates.
func RenderDebugText ¶
RenderDebugText draws debug text to a Renderer.
func RenderDebugTextFormat ¶
RenderDebugTextFormat draws debug text to an Renderer.
func RenderFillRect ¶
RenderFillRect fills a rectangle on the current rendering target with the drawing color at subpixel precision.
func RenderFillRects ¶
RenderFillRects fills some number of rectangles on the current rendering target with the drawing color at subpixel precision.
func RenderGeometry ¶
RenderGeometry renders a list of triangles, optionally using a texture and indices into the vertex array Color and alpha modulation is done per vertex (SetTextureColorMod and SetTextureAlphaMod are ignored).
func RenderGeometryRaw ¶
func RenderGeometryRaw(renderer *Renderer, texture *Texture, xy []FPoint, color []FColor, uv []FPoint, indices []int32) bool
RenderGeometryRaw renders a list of triangles, optionally using a texture and indices into the vertex arrays Color and alpha modulation is done per vertex (SetTextureColorMod and SetTextureAlphaMod are ignored).
func RenderLine ¶
RenderLine draws a line on the current rendering target at subpixel precision.
func RenderLines ¶
RenderLines draws a series of connected lines on the current rendering target at subpixel precision.
func RenderPoint ¶
RenderPoint draws a point on the current rendering target at subpixel precision.
func RenderPoints ¶
RenderPoints draws multiple points on the current rendering target at subpixel precision.
func RenderPresent ¶
RenderPresent updates the screen with any rendering performed since the previous call.
func RenderRect ¶
RenderRect draws a rectangle on the current rendering target at subpixel precision.
func RenderRects ¶
RenderRects draws some number of rectangles on the current rendering target at subpixel precision.
func RenderTexture ¶
RenderTexture copies a portion of the texture to the current rendering target at subpixel precision.
func RenderTexture9Grid ¶
func RenderTexture9Grid(renderer *Renderer, texture *Texture, srcrect *FRect, leftWidth, rightWidth, topHeight, bottomHeight, scale float32, dstrect *FRect) bool
RenderTexture9Grid performs a scaled copy using the 9-grid algorithm to the current rendering target at subpixel precision.
func RenderTexture9GridTiled ¶
func RenderTexture9GridTiled(renderer *Renderer, texture *Texture, srcrect *FRect, leftWidth, rightWidth, topHeight, bottomHeight, scale float32, dstrect *FRect, tileScale float32) bool
RenderTexture9GridTiled performs a scaled copy using the 9-grid algorithm to the current rendering target at subpixel precision.
Available since SDL 3.4.0.
func RenderTextureAffine ¶
func RenderTextureAffine(renderer *Renderer, texture *Texture, srcrect *FRect, origin *FPoint, right *FPoint, down *FPoint) bool
RenderTextureAffine copies a portion of the source texture to the current rendering target, with affine transform, at subpixel precision.
func RenderTextureRotated ¶
func RenderTextureRotated(renderer *Renderer, texture *Texture, srcrect *FRect, dstrect *FRect, angle float64, center *FPoint, flip FlipMode) bool
RenderTextureRotated copies a portion of the source texture to the current rendering target, with rotation and flipping, at subpixel precision.
func RenderTextureTiled ¶
func RenderTextureTiled(renderer *Renderer, texture *Texture, srcrect *FRect, scale float32, dstrect *FRect) bool
RenderTextureTiled tiles a portion of the texture to the current rendering target at subpixel precision.
func RenderViewportSet ¶
RenderViewportSet returns whether an explicit rectangle was set as the viewport.
func ResetLogPriorities ¶
func ResetLogPriorities()
ResetLogPriorities resets all priorities to default.
func RestoreWindow ¶
RestoreWindow requests that the size and position of a minimized or maximized window be restored.
func ResumeAudioStreamDevice ¶
func ResumeAudioStreamDevice(stream *AudioStream) bool
ResumeAudioStreamDevice unpauses audio playback on the audio device associated with an audio stream.
func RumbleJoystick ¶
func RumbleJoystick(joystick *Joystick, lowFrequencyRumble uint16, highFrequencyRumble uint16, durationMs uint32) bool
RumbleJoystick starts a rumble effect.
func RumbleJoystickTriggers ¶
func RumbleJoystickTriggers(joystick *Joystick, leftRumble uint16, rightRumble uint16, durationMs uint32) bool
RumbleJoystickTriggers starts a rumble effect in the joystick's triggers.
func ScreenKeyboardShown ¶
ScreenKeyboardShown checks whether the screen keyboard is shown for given window.
func ScreenSaverEnabled ¶
func ScreenSaverEnabled() bool
ScreenSaverEnabled checks whether the screensaver is currently enabled.
func SendJoystickEffect ¶
SendJoystickEffect sends a joystick specific effect packet.
func SetAudioStreamFormat ¶
func SetAudioStreamFormat(stream *AudioStream, srcSpec *AudioSpec, dstSpec *AudioSpec) bool
SetAudioStreamFormat changes the input and output formats of an audio stream.
func SetAudioStreamFrequencyRatio ¶
func SetAudioStreamFrequencyRatio(stream *AudioStream, ratio float32) bool
SetAudioStreamFrequencyRatio changes the frequency ratio of an audio stream.
func SetAudioStreamGain ¶
func SetAudioStreamGain(stream *AudioStream, gain float32) bool
SetAudioStreamGain changes the gain of an audio stream.
func SetBooleanProperty ¶
func SetBooleanProperty(props PropertiesID, name string, value bool) bool
SetBooleanProperty sets a boolean property in a group of properties.
func SetDefaultTextureScaleMode ¶
SetDefaultTextureScaleMode sets default scale mode for new textures for given renderer.
Available since SDL 3.4.0.
func SetEventEnabled ¶
SetEventEnabled sets the state of processing events by type.
func SetEventFilter ¶
func SetEventFilter(filter EventFilter, userdata unsafe.Pointer)
SetEventFilter sets up a filter to process all events before they are added to the internal event queue.
func SetFloatProperty ¶
func SetFloatProperty(props PropertiesID, name string, value float32) bool
SetFloatProperty sets a floating point property in a group of properties.
func SetGPUBufferName ¶
SetGPUBufferName sets an arbitrary string constant to label a buffer.
func SetGPUScissor ¶
func SetGPUScissor(renderPass *GPURenderPass, scissor *Rect)
SetGPUScissor sets the current scissor state on a command buffer.
func SetGPUSwapchainParameters ¶
func SetGPUSwapchainParameters(device *GPUDevice, window *Window, swapchainComposition GPUSwapchainComposition, presentMode GPUPresentMode) bool
SetGPUSwapchainParameters changes the swapchain parameters for the given claimed window.
func SetGPUViewport ¶
func SetGPUViewport(renderass *GPURenderPass, viewport *GPUViewport)
SetGPUViewport sets the current viewport state on a command buffer.
func SetHintWithPriority ¶
func SetHintWithPriority(name string, value string, priority HintPriority) bool
SetHintWithPriority sets a hint with a specific priority.
func SetJoystickEventsEnabled ¶
func SetJoystickEventsEnabled(enabled bool)
SetJoystickEventsEnabled sets the state of joystick event processing.
func SetJoystickLED ¶
SetJoystickLED updates a joystick's LED color.
func SetJoystickPlayerIndex ¶
SetJoystickPlayerIndex sets the player index of an opened joystick.
func SetLogOutputFunction ¶
func SetLogOutputFunction(callback LogOutputFunction, userdata unsafe.Pointer)
SetLogOutputFunction replaces the default log output function with one of your own.
func SetLogPriorities ¶
func SetLogPriorities(priority LogPriority)
SetLogPriorities sets the priority of all log categories.
func SetLogPriority ¶
func SetLogPriority(category int32, priority LogPriority)
SetLogPriority sets the priority of a particular log category.
func SetModState ¶
func SetModState(modstate Keymod)
SetModState sets the current key modifier state for the keyboard.
func SetNumberProperty ¶
func SetNumberProperty(props PropertiesID, name string, value int64) bool
SetNumberProperty sets an integer property in a group of properties.
func SetPaletteColors ¶
SetPaletteColors sets a range of colors in a palette.
func SetPointerProperty ¶
func SetPointerProperty(props PropertiesID, name string, value unsafe.Pointer) bool
SetPointerProperty sets a pointer property in a group of properties.
func SetPointerPropertyWithCleanup ¶
func SetPointerPropertyWithCleanup(props PropertiesID, name string, value unsafe.Pointer, cleanup CleanupPropertyCallback, userdata unsafe.Pointer) bool
SetPointerPropertyWithCleanup sets a pointer property in a group of properties with a cleanup function that is called when the property is deleted.
func SetRenderClipRect ¶
SetRenderClipRect sets the clip rectangle for rendering on the specified target.
func SetRenderColorScale ¶
SetRenderColorScale sets the color scale used for render operations.
func SetRenderDrawBlendMode ¶
SetRenderDrawBlendMode sets the blend mode used for drawing operations (Fill and Line).
func SetRenderDrawColor ¶
SetRenderDrawColor sets the color used for drawing operations.
func SetRenderDrawColorFloat ¶
SetRenderDrawColorFloat sets the color used for drawing operations (Rect, Line and Clear).
func SetRenderLogicalPresentation ¶
func SetRenderLogicalPresentation(renderer *Renderer, w int32, h int32, mode RendererLogicalPresentation) bool
SetRenderLogicalPresentation sets a device-independent resolution and presentation mode for rendering.
func SetRenderScale ¶
SetRenderScale sets the drawing scale for rendering on the current target.
func SetRenderTarget ¶
SetRenderTarget sets a texture as the current rendering target.
func SetRenderTextureAddressMode ¶
func SetRenderTextureAddressMode(renderer *Renderer, uMode, vMode TextureAddressMode) bool
SetRenderTextureAddressMode sets the texture addressing mode used in RenderGeometry.
Available since SDL 3.4.0.
func SetRenderVSync ¶
SetRenderVSync sets VSync of the given renderer.
func SetRenderViewport ¶
SetRenderViewport sets the drawing area for rendering on the current target.
func SetScancodeName ¶
SetScancodeName sets a human-readable name for a scancode.
func SetStringProperty ¶
func SetStringProperty(props PropertiesID, name string, value string) bool
SetStringProperty sets a string property in a group of properties.
func SetSurfaceAlphaMod ¶
SetSurfaceAlphaMod sets an additional alpha value used in blit operations.
func SetSurfaceBlendMode ¶
SetSurfaceBlendMode sets the blend mode used for blit operations.
func SetSurfaceClipRect ¶
SetSurfaceClipRect sets the clipping rectangle for a surface.
func SetSurfaceColorKey ¶
SetSurfaceColorKey sets the color key (transparent pixel) in a surface.
func SetSurfaceColorMod ¶
SetSurfaceColorMod sets an additional color value multiplied into blit operations.
func SetSurfaceColorspace ¶
func SetSurfaceColorspace(surface *Surface, colorspace Colorspace) bool
SetSurfaceColorspace sets the colorspace used by a surface.
func SetSurfacePalette ¶
SetSurfacePalette sets the palette used by a surface.
func SetSurfaceRLE ¶
SetSurfaceRLE sets the RLE acceleration hint for a surface.
func SetTextInputArea ¶
SetTextInputArea sets the area used to type Unicode text input.
func SetTextureAlphaMod ¶
SetTextureAlphaMod sets an additional alpha value multiplied into render copy operations.
func SetTextureAlphaModFloat ¶
SetTextureAlphaModFloat sets an additional alpha value multiplied into render copy operations.
func SetTextureBlendMode ¶
SetTextureBlendMode sets the blend mode for a texture, used by [RenderTexture()].
func SetTextureColorMod ¶
SetTextureColorMod sets an additional color value multiplied into render copy operations.
func SetTextureColorModFloat ¶
SetTextureColorModFloat sets an additional color value multiplied into render copy operations.
func SetTexturePalette ¶
SetTexturePalette sets the palette used by a texture.
Available since SDL 3.4.0.
func SetTextureScaleMode ¶
SetTextureScaleMode sets the scale mode used for texture scale operations.
func SetWindowAlwaysOnTop ¶
SetWindowAlwaysOnTop sets the window to always be above the others.
func SetWindowAspectRatio ¶
SetWindowAspectRatio requests that the aspect ratio of a window's client area be set.
func SetWindowBordered ¶
SetWindowBordered sets the border state of a window.
func SetWindowFocusable ¶
SetWindowFocusable sets whether the window may have input focus.
func SetWindowFullscreen ¶
SetWindowFullscreen requests that the window's fullscreen state be changed.
func SetWindowFullscreenMode ¶
func SetWindowFullscreenMode(window *Window, mode *DisplayMode) bool
SetWindowFullscreenMode sets the display mode to use when a window is visible and fullscreen.
func SetWindowHitTest ¶
SetWindowHitTest provide a callback that decides if a window region has special properties.
func SetWindowIcon ¶
SetWindowIcon sets the icon for a window.
func SetWindowKeyboardGrab ¶
SetWindowKeyboardGrab enables capture of system keyboard shortcuts like Alt+Tab or the Meta/Super key. Note that not all system keyboard shortcuts can be captured by applications (one example is Ctrl+Alt+Del on Windows).
func SetWindowMaximumSize ¶
SetWindowMaximumSize sets the maximum size of a window's client area.
func SetWindowMinimumSize ¶
SetWindowMinimumSize sets the minimum size of a window's client area.
func SetWindowModal ¶
SetWindowModal toggles the state of the window as modal.
func SetWindowMouseGrab ¶
SetWindowMouseGrab enables restriction of the mouse cursor to the window.
func SetWindowMouseRect ¶
SetWindowMouseRect confines the cursor to the specified area of a window.
func SetWindowOpacity ¶
SetWindowOpacity sets the opacity for a window.
func SetWindowParent ¶
SetWindowParent sets the window as a child of a parent window.
func SetWindowPosition ¶
SetWindowPosition requests that the window's position be set.
func SetWindowProgressState ¶
func SetWindowProgressState(window *Window, state ProgressState) bool
SetWindowProgressState sets the state of the progress bar for the given window’s taskbar icon.
Available since SDL 3.4.0.
func SetWindowProgressValue ¶
SetWindowProgressValue sets the value of the progress bar for the given window’s taskbar icon.
Available since SDL 3.4.0.
func SetWindowRelativeMouseMode ¶
SetWindowRelativeMouseMode sets relative mouse mode for a window.
func SetWindowResizable ¶
SetWindowResizable sets the user-resizable state of a window.
func SetWindowSize ¶
SetWindowSize requests that the size of a window's client area be set.
func SetWindowSurfaceVSync ¶
SetWindowSurfaceVSync toggles VSync for the window surface.
func SetWindowTitle ¶
SetWindowTitle requests that the size of a window's client area be set.
func ShowFileDialogWithProperties ¶
func ShowFileDialogWithProperties(dialogType FileDialogType, callback DialogFileCallback, userdata unsafe.Pointer, props PropertiesID)
ShowFileDialogWithProperties creates and launches a file dialog with the specified properties.
func ShowMessageBox ¶
func ShowMessageBox(messageboxdata *MessageBoxData, buttonid *int32) bool
ShowMessageBox creates a modal message box.
func ShowOpenFileDialog ¶
func ShowOpenFileDialog(callback DialogFileCallback, userdata unsafe.Pointer, window *Window, filters []DialogFileFilter, defaultLocation string, allowMany bool)
ShowOpenFileDialog displays a dialog that lets the user select a file on their filesystem.
func ShowOpenFolderDialog ¶
func ShowOpenFolderDialog(callback DialogFileCallback, userdata unsafe.Pointer, window *Window, defaultLocation string, allowMany bool)
ShowOpenFolderDialog displays a dialog that lets the user select a folder on their filesystem.
func ShowSaveFileDialog ¶
func ShowSaveFileDialog(callback DialogFileCallback, userdata unsafe.Pointer, window *Window, filters []DialogFileFilter, defaultLocation string)
ShowSaveFileDialog displays a dialog that lets the user choose a new or existing file on their filesystem.
func ShowSimpleMessageBox ¶
func ShowSimpleMessageBox(flags MessageBoxFlags, title string, message string, window *Window) bool
ShowSimpleMessageBox displays a simple modal message box.
func ShowWindowSystemMenu ¶
ShowWindowSystemMenu displays the system-level window menu.
func StartTextInput ¶
StartTextInput starts accepting Unicode text input events in a window.
func StartTextInputWithProperties ¶
func StartTextInputWithProperties(window *Window, props PropertiesID) bool
StartTextInputWithProperties starts accepting Unicode text input events in a window, with properties describing the input.
func StopTextInput ¶
StopTextInput stops receiving any text input events in a window.
func StretchSurface ¶
func StretchSurface(src *Surface, srcrect *Rect, dst *Surface, dstrect *Rect, scaleMode ScaleMode) bool
StretchSurface performs a stretched pixel copy from one surface to another.
Available since SDL 3.4.0.
func SubmitGPUCommandBuffer ¶
func SubmitGPUCommandBuffer(commandBuffer *GPUCommandBuffer) bool
SubmitGPUCommandBuffer submits a command buffer so its commands can be processed on the GPU.
func SurfaceHasAlternateImages ¶
SurfaceHasAlternateImages returns whether a surface has alternate versions available.
func SurfaceHasColorKey ¶
SurfaceHasColorKey returns whether the surface has a color key.
func SurfaceHasRLE ¶
SurfaceHasRLE returns whether the surface is RLE enabled.
func SyncWindow ¶
SyncWindow blocks until any pending window state is finalized.
func TextInputActive ¶
TextInputActive checks whether or not Unicode text input events are enabled for a window.
func UnlockJoysticks ¶
func UnlockJoysticks()
UnlockJoysticks unlocks for atomic access to the joystick API.
func UnlockProperties ¶
func UnlockProperties(props PropertiesID)
UnlockProperties unlocks a group of properties.
func UnlockSurface ¶
func UnlockSurface(surface *Surface)
UnlockSurface releases a surface after directly accessing the pixels.
func UnlockTexture ¶
func UnlockTexture(texture *Texture)
UnlockTexture unlocks a texture, uploading the changes to video memory, if needed.
func UnmapGPUTransferBuffer ¶
func UnmapGPUTransferBuffer(device *GPUDevice, transferBuffer *GPUTransferBuffer)
UnmapGPUTransferBuffer unmaps a previously mapped transfer buffer.
func UpdateJoysticks ¶
func UpdateJoysticks()
UpdateJoysticks updates the current state of the open joysticks.
func UpdateNVTexture ¶
func UpdateNVTexture(texture *Texture, rect *Rect, yPlane *uint8, yPitch int32, uvPlane *uint8, uvPitch int32) bool
UpdateNVTexture updates a rectangle within a planar NV12 or NV21 texture with new pixels.
func UpdateTexture ¶
UpdateTexture updates the given texture rectangle with new pixel data.
func UpdateWindowSurface ¶
UpdateWindowSurface copies the window surface to the screen.
func UpdateYUVTexture ¶
func UpdateYUVTexture(texture *Texture, rect *Rect, yPlane *uint8, yPitch int32, uPlane *uint8, uPitch int32, vPlane *uint8, vPitch int32) bool
UpdateYUVTexture updates a rectangle within a planar YV12 or IYUV texture with new pixel data.
func UploadToGPUBuffer ¶
func UploadToGPUBuffer(copyPass *GPUCopyPass, source *GPUTransferBufferLocation, destination *GPUBufferRegion, cycle bool)
UploadToGPUBuffer uploads data from a transfer buffer to a buffer.
func UploadToGPUTexture ¶
func UploadToGPUTexture(copyPass *GPUCopyPass, source *GPUTextureTransferInfo, destination *GPUTextureRegion, cycle bool)
UploadToGPUTexture uploads data from a transfer buffer to a texture.
func WaitAndAcquireGPUSwapchainTexture ¶
func WaitAndAcquireGPUSwapchainTexture(commandBuffer *GPUCommandBuffer, window *Window, swapchainTexture **GPUTexture, swapchainTextureWidth *uint32, swapchainTextureHeight *uint32) bool
WaitAndAcquireGPUSwapchainTexture blocks the thread until a swapchain texture is available to be acquired, and then acquires it.
func WaitEventTimeout ¶
WaitEventTimeout waits until the specified timeout (in milliseconds) for the next available event.
func WarpMouseGlobal ¶
WarpMouseGlobal moves the mouse to the given position in global screen space.
func WarpMouseInWindow ¶
WarpMouseInWindow moves the mouse cursor to the given position within the window.
func WindowHasSurface ¶
WindowHasSurface returns whether the window has a surface associated with it.
func WindowSupportsGPUPresentMode ¶
func WindowSupportsGPUPresentMode(device *GPUDevice, window *Window, presentMode GPUPresentMode) bool
WindowSupportsGPUPresentMode determines whether a presentation mode is supported by the window.
Types ¶
type AppResult ¶
type AppResult uint32
AppResult defines the return values for optional main callbacks.
type ArrayOrder ¶
type ArrayOrder uint32
ArrayOrder defines the array component order, low byte -> high byte.
const ( ArrayOrderNone ArrayOrder = iota ArrayOrderRGB ArrayOrderRGBA ArrayOrderARGB ArrayOrderBGR ArrayOrderBGRA ArrayOrderABGR )
type AssertState ¶
type AssertState uint32
AssertState defines the possible outcomes from a triggered assertion.
const ( AssertionRetry AssertState = iota // Retry the assert immediately. AssertionBreak // Make the debugger trigger a breakpoint. AssertionAbort // Terminate the program. AssertionIgnore // Ignore the assert. AssertionAlwaysIgnore // Ignore the assert from now on. )
type AsyncIOResult ¶
type AsyncIOResult uint32
AsyncIOResult defines the possible outcomes of an asynchronous I/O task.
const ( AsyncIOComplete AsyncIOResult = iota // Request was completed without error. AsyncIOFailure // Request failed for some reason, check [GetError]! AsyncIOCanceled // Request was canceled before completing. )
type AsyncIOTaskType ¶
type AsyncIOTaskType uint32
AsyncIOTaskType defines the types of asynchronous I/O tasks.
const ( AsyncIOTaskRead AsyncIOTaskType = iota // A read operation. AsyncIOTaskWrite // A write operation. AsyncIOTaskClose // A close operation. )
type AtomicInt ¶
type AtomicInt struct {
Value int32
}
AtomicInt is a structure representing an atomic integer value.
type AtomicU32 ¶
type AtomicU32 struct {
Value uint32
}
AtomicU32 is a structure representing an atomic unsigned 32-bit value.
type AudioDeviceEvent ¶
type AudioDeviceEvent struct {
CommonEvent
Which AudioDeviceID // [AudioDeviceID] for the device being added or removed or changing.
Recording bool // False if a playback device, true if a recording device.
// contains filtered or unexported fields
}
AudioDeviceEvent defines the audio device event structure (event.adevice.*).
type AudioDeviceID ¶
type AudioDeviceID uint32
AudioDeviceID defines the SDL Audio Device instance IDs.
const ( AudioDeviceDefaultPlayback AudioDeviceID = 0xFFFFFFFF AudioDeviceDefaultRecording AudioDeviceID = 0xFFFFFFFE )
func GetAudioStreamDevice ¶
func GetAudioStreamDevice(stream *AudioStream) AudioDeviceID
GetAudioStreamDevice queries an audio stream for its currently-bound device.
type AudioFormat ¶
type AudioFormat uint32
AudioFormat defines the audio format.
const ( AudioUnknown AudioFormat = 0x0000 // Unspecified audio format. AudioU8 AudioFormat = 0x0008 // Unsigned 8-bit samples. AudioS8 AudioFormat = 0x8008 // Signed 8-bit samples. AudioS16Le AudioFormat = 0x8010 // Signed 16-bit samples. AudioS16Be AudioFormat = 0x9010 // Signed 16-bit samples, big-endian byte order. AudioS32Le AudioFormat = 0x8020 // 32-bit integer samples. AudioS32Be AudioFormat = 0x9020 // 32-bit integer samples, big-endian byte order. AudioF32Le AudioFormat = 0x8120 // 32-bit floating point samples. AudioF32Be AudioFormat = 0x9120 // 32-bit floating, big-endian byte order. AudioS16 AudioFormat = AudioS16Le AudioS32 AudioFormat = AudioS32Le AudioF32 AudioFormat = AudioF32Le )
type AudioSpec ¶
type AudioSpec struct {
Format AudioFormat // Audio data format.
Channels int32 // Number of channels: 1 mono, 2 stereo, etc.
Freq int32 // Sample rate: sample frames per second.
}
AudioSpec defines the format specifier for audio data.
type AudioStream ¶
type AudioStream struct{}
AudioStream is a structure specifying the opaque handle that represents an audio streams.
func OpenAudioDeviceStream ¶
func OpenAudioDeviceStream(devid AudioDeviceID, spec *AudioSpec, callback AudioStreamCallback, userdata unsafe.Pointer) *AudioStream
OpenAudioDeviceStream returns an audio stream on success, ready to use, or nil on failure. When done with this stream, call DestroyAudioStream to free resources and close the device.
type AudioStreamCallback ¶
type AudioStreamCallback uintptr
AudioStreamCallback is a callback that fires when data passes through an AudioStream.
func NewAudioStreamCallback ¶
func NewAudioStreamCallback(callback func(userdata unsafe.Pointer, stream *AudioStream, additionalAmount, totalAmount int32)) AudioStreamCallback
type AudioStreamDataCompleteCallback ¶
type AudioStreamDataCompleteCallback uintptr
AudioStreamDataCompleteCallback is a callback that fires for completed [PutAudioStreamDataNoCopy] data.
Available since SDL 3.4.0.
type BitmapOrder ¶
type BitmapOrder uint32
BitmapOrder defines the bitmap pixel order, high bit -> low bit.
const ( BitmapOrderNone BitmapOrder = iota BitmapOrder4321 BitmapOrder1234 )
type BlendFactor ¶
type BlendFactor uint32
BlendFactor is a structure specifying the normalized factor used to multiply pixel components.
const ( BlendFactorZero BlendFactor = iota + 1 // 0, 0, 0, 0. BlendFactorOne // 1, 1, 1, 1. BlendFactorSrcColor // srcR, srcG, srcB, srcA. BlendFactorOneMinusSrcColor // 1-srcR, 1-srcG, 1-srcB, 1-srcA. BlendFactorSrcAlpha // srcA, srcA, srcA, srcA. BlendFactorOneMinusSrcAlpha // 1-srcA, 1-srcA, 1-srcA, 1-srcA. BlendFactorDstColor // dstR, dstG, dstB, dstA. BlendFactorOneMinusDstColor // 1-dstR, 1-dstG, 1-dstB, 1-dstA. BlendFactorDstAlpha // dstA, dstA, dstA, dstA. BlendFactorOneMinusDstAlpha // 1-dstA, 1-dstA, 1-dstA, 1-dstA. )
type BlendMode ¶
type BlendMode uint32
BlendMode is a set of blend modes used in drawing operations.
type BlendOperation ¶
type BlendOperation uint32
BlendOperation is a structure specifying the blend operation used when combining source and destination pixel components.
const ( BlendOperationAdd BlendOperation = iota + 1 // dst + src: supported by all renderers. BlendOperationSubtract // src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan. BlendOperationRevSubtract // dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan. BlendOperationMinimum // min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan. BlendOperationMaximum // max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan. )
type Camera ¶
type Camera struct{}
Camera is a structure specifying the opaque structure used to identify an opened SDL cameras.
func OpenCamera ¶
func OpenCamera(instanceId CameraID, spec *CameraSpec) *Camera
OpenCamera opens a video recording device (a "camera").
type CameraDeviceEvent ¶
type CameraDeviceEvent struct {
CommonEvent
Which CameraID // [CameraID] for the device being added or removed or changing.
}
CameraDeviceEvent defines the camera device event structure (event.cdevice.*).
type CameraID ¶
type CameraID uint32
CameraID is a unique ID for a camera device for the time it is connected to the system, and is never reused for the lifetime of the application.
func GetCameraID ¶
GetCameraID gets the instance ID of an opened camera.
func GetCameras ¶
func GetCameras() []CameraID
GetCameras gets a list of currently connected camera devices.
type CameraPermissionState ¶
type CameraPermissionState int32
CameraPermissionState is a structure specifying the current state of a request for camera access.
Available since SDL 3.4.0.
const ( CameraPermissionStateDenied CameraPermissionState = iota - 1 CameraPermissionStatePending CameraPermissionStateApproved )
func GetCameraPermissionState ¶
func GetCameraPermissionState(camera *Camera) CameraPermissionState
GetCameraPermissionState queries if camera access has been approved by the user.
type CameraPosition ¶
type CameraPosition uint32
CameraPosition is a structure specifying the position of camera in relation to system devices.
const ( CameraPositionUnknown CameraPosition = iota CameraPositionFrontFacing CameraPositionBackFacing )
func GetCameraPosition ¶
func GetCameraPosition(instanceId CameraID) CameraPosition
GetCameraPosition gets the position of the camera in relation to the system.
type CameraSpec ¶
type CameraSpec struct {
Format PixelFormat // Frame format.
Colorspace Colorspace // Frame colorspace.
Width int32 // Frame width.
Height int32 // Frame height.
FramerateNumerator int32 // Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds).
FramerateDenominator int32 // Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds).
}
CameraSpec is a structure specifying the details of an output format for a camera devices.
func GetCameraSupportedFormats ¶
func GetCameraSupportedFormats(instanceId CameraID) []*CameraSpec
GetCameraSupportedFormats gets the list of native formats/sizes a camera supports.
type Capitalization ¶
type Capitalization uint32
Capitalization defines the auto capitalization type.
const ( CapitalizeNone Capitalization = iota // No auto-capitalization will be done. CapitalizeSentences // The first letter of sentences will be capitalized. CapitalizeWords // The first letter of words will be capitalized. CapitalizeLetters // All letters will be capitalized. )
type ChromaLocation ¶
type ChromaLocation uint32
ChromaLocation defines the colorspace chroma sample location.
const ( ChromaLocationNone ChromaLocation = iota // RGB, no chroma sampling. ChromaLocationLeft // In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square. In other words, they have the same horizontal location as the top-left pixel, but is shifted one-half pixel down vertically. ChromaLocationCenter // In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square. In other words, they are offset one-half pixel to the right and one-half pixel down compared to the top-left pixel. ChromaLocationTopLeft )
type CleanupPropertyCallback ¶
type CleanupPropertyCallback uintptr
CleanupPropertyCallback is a callback used to free resources when a property is deleted.
func NewCleanupPropertyCallback ¶
func NewCleanupPropertyCallback(callback func(userdata, value unsafe.Pointer)) CleanupPropertyCallback
type ClipboardEvent ¶
type ClipboardEvent struct {
CommonEvent
Owner bool // Are we owning the clipboard (internal update).
NumMimeTypes int32 // Number of mime types.
// contains filtered or unexported fields
}
ClipboardEvent is an event triggered when the clipboard contents have changed (event.clipboard.*).
func (*ClipboardEvent) MimeTypes ¶
func (c *ClipboardEvent) MimeTypes() []string
MimeTypes returns current mime types.
type Color ¶
type Color struct {
R, G, B, A uint8
}
Color is a structure that represents a color as RGBA components.
type ColorPrimaries ¶
type ColorPrimaries uint32
ColorPrimaries defines the colorspace color primaries, as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en.
const ( ColorPrimariesUnknown ColorPrimaries = 0 ColorPrimariesBT709 ColorPrimaries = 1 // ITU-R BT.709-6. ColorPrimariesUnspecified ColorPrimaries = 2 ColorPrimariesBT470M ColorPrimaries = 4 // ITU-R BT.470-6 System M. ColorPrimariesBT470BG ColorPrimaries = 5 // ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625. ColorPrimariesBT601 ColorPrimaries = 6 // ITU-R BT.601-7 525, SMPTE 170M. ColorPrimariesSMPTE240 ColorPrimaries = 7 // SMPTE 240M, functionally the same as SDL_COLOR_PRIMARIES_BT601. ColorPrimariesGenericFilm ColorPrimaries = 8 // Generic film (color filters using Illuminant C). ColorPrimariesBT2020 ColorPrimaries = 9 // ITU-R BT.2020-2 / ITU-R BT.2100-0. ColorPrimariesXYZ ColorPrimaries = 10 // SMPTE ST 428-1. ColorPrimariesSMPTE431 ColorPrimaries = 11 // SMPTE RP 431-2. ColorPrimariesSMPTE432 ColorPrimaries = 12 // SMPTE EG 432-1 / DCI P3. ColorPrimariesEBU3213 ColorPrimaries = 22 // EBU Tech. 3213-E. ColorPrimariesCustom ColorPrimaries = 31 )
type ColorRange ¶
type ColorRange uint32
ColorRange defines the colorspace color range, as described by https://www.itu.int/rec/R-REC-BT.2100-2-201807-I/en.
const ( ColorRangeUnknown ColorRange = iota ColorRangeLimited // Narrow range, e.g. 16-235 for 8-bit RGB and luma, and 16-240 for 8-bit chroma. ColorRangeFull // Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma. )
type Colorspace ¶
type Colorspace uint32
Colorspace defines the colorspace definitions.
const ( ColorspaceUnknown Colorspace = 0 // sRGB is a gamma corrected colorspace, and the default colorspace for SDL rendering and 8-bit RGB surfaces. // // Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 // SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB, // SDL_COLOR_RANGE_FULL, // SDL_COLOR_PRIMARIES_BT709, // SDL_TRANSFER_CHARACTERISTICS_SRGB, // SDL_MATRIX_COEFFICIENTS_IDENTITY, // SDL_CHROMA_LOCATION_NONE), ColorspaceSRGB Colorspace = 0x120005a0 // This is a linear colorspace and the default colorspace for floating point surfaces. On Windows this is the scRGB colorspace, and on Apple platforms this is kCGColorSpaceExtendedLinearSRGB for EDR content. // // Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 // SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB, // SDL_COLOR_RANGE_FULL, // SDL_COLOR_PRIMARIES_BT709, // SDL_TRANSFER_CHARACTERISTICS_LINEAR, // SDL_MATRIX_COEFFICIENTS_IDENTITY, // SDL_CHROMA_LOCATION_NONE) ColorspaceSRGBLinear Colorspace = 0x12000500 // HDR10 is a non-linear HDR colorspace and the default colorspace for 10-bit surfaces. // // Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 // SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB, // SDL_COLOR_RANGE_FULL, // SDL_COLOR_PRIMARIES_BT2020, // SDL_TRANSFER_CHARACTERISTICS_PQ, // SDL_MATRIX_COEFFICIENTS_IDENTITY, // SDL_CHROMA_LOCATION_NONE) ColorspaceHDR10 Colorspace = 0x12002600 // Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 // SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, // SDL_COLOR_RANGE_FULL, // SDL_COLOR_PRIMARIES_BT709, // SDL_TRANSFER_CHARACTERISTICS_BT601, // SDL_MATRIX_COEFFICIENTS_BT601, // SDL_CHROMA_LOCATION_NONE) ColorspaceJPEG Colorspace = 0x220004c6 // Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 // SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, // SDL_COLOR_RANGE_LIMITED, // SDL_COLOR_PRIMARIES_BT601, // SDL_TRANSFER_CHARACTERISTICS_BT601, // SDL_MATRIX_COEFFICIENTS_BT601, // SDL_CHROMA_LOCATION_LEFT) ColorspaceBT601Limited Colorspace = 0x211018c6 // Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 // SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, // SDL_COLOR_RANGE_FULL, // SDL_COLOR_PRIMARIES_BT601, // SDL_TRANSFER_CHARACTERISTICS_BT601, // SDL_MATRIX_COEFFICIENTS_BT601, // SDL_CHROMA_LOCATION_LEFT) ColorspaceBT601Full Colorspace = 0x221018c6 // Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 // SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, // SDL_COLOR_RANGE_LIMITED, // SDL_COLOR_PRIMARIES_BT709, // SDL_TRANSFER_CHARACTERISTICS_BT709, // SDL_MATRIX_COEFFICIENTS_BT709, // SDL_CHROMA_LOCATION_LEFT) ColorspaceBT709Limited Colorspace = 0x21100421 // Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 // SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, // SDL_COLOR_RANGE_FULL, // SDL_COLOR_PRIMARIES_BT709, // SDL_TRANSFER_CHARACTERISTICS_BT709, // SDL_MATRIX_COEFFICIENTS_BT709, // SDL_CHROMA_LOCATION_LEFT) ColorspaceBT709Full Colorspace = 0x22100421 // Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 // SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, // SDL_COLOR_RANGE_LIMITED, // SDL_COLOR_PRIMARIES_BT2020, // SDL_TRANSFER_CHARACTERISTICS_PQ, // SDL_MATRIX_COEFFICIENTS_BT2020_NCL, // SDL_CHROMA_LOCATION_LEFT) ColorspaceBT2020Limited Colorspace = 0x21102609 //Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 // SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, // SDL_COLOR_RANGE_FULL, // SDL_COLOR_PRIMARIES_BT2020, // SDL_TRANSFER_CHARACTERISTICS_PQ, // SDL_MATRIX_COEFFICIENTS_BT2020_NCL, // SDL_CHROMA_LOCATION_LEFT) ColorspaceBT2020Full Colorspace = 0x22102609 // The default colorspace for RGB surfaces if no colorspace is specified. ColorspaceRGBDefault Colorspace = ColorspaceSRGB // The default colorspace for YUV surfaces if no colorspace is specified. ColorspaceYUVDefault Colorspace = ColorspaceBT601Limited )
func GetSurfaceColorspace ¶
func GetSurfaceColorspace(surface *Surface) Colorspace
GetSurfaceColorspace gets the colorspace used by a surface.
type CommonEvent ¶
type CommonEvent struct {
Type EventType // Event type, shared with all events, uint32 to cover user events which are not in the [EventType] enumeration.
Timestamp uint64 // Timestamp in nanoseconds, populated using [GetTicksNS].
// contains filtered or unexported fields
}
CommonEvent defines the fields shared by every event.
type Condition ¶
type Condition struct{}
Condition defines a means to block multiple threads until a condition is satisfied.
type Cursor ¶
type Cursor struct{}
Cursor is a structure specifying the structure used to identify an SDL cursors.
func CreateAnimatedCursor ¶
func CreateAnimatedCursor(frames *CursorFrameInfo, frameCount, hotX, hotY int32) *Cursor
CreateAnimatedCursor creates an animated color cursor.
Available since SDL 3.4.0.
func CreateColorCursor ¶
CreateColorCursor creates a color cursor.
func CreateCursor ¶
CreateCursor creates a cursor using the specified bitmap data and mask (in MSB format).
func CreateSystemCursor ¶
func CreateSystemCursor(id SystemCursor) *Cursor
CreateSystemCursor creates a system cursor.
type CursorFrameInfo ¶
type CursorFrameInfo struct {
Surface *Surface // The surface data for this frame.
Duration uint32 // The frame duration in milliseconds (a duration of 0 is infinite).
}
CursorFrameInfo describes animated cursor frame info.
Available since SDL 3.4.0.
type DateFormat ¶
type DateFormat uint32
DateFormat is a structure specifying the preferred date format of the current system locales.
const ( DateFormatYYYYMMDD DateFormat = iota // Year/Month/Day. DateFormatDDMMYYYY // Day/Month/Year. DateFormatMMDDYYYY // Month/Day/Year. )
type DateTime ¶
type DateTime struct {
Year int32 // Year.
Month int32 // Month [01-12].
Day int32 // Day of the month [01-31].
Hour int32 // Hour [0-23].
Minute int32 // Minute [0-59].
Second int32 // Seconds [0-60].
Nanosecond int32 // Nanoseconds [0-999999999].
DayOfWeek int32 // Day of the week [0-6] (0 being Sunday).
UtcOffset int32 // Seconds east of UTC.
}
DateTime is a structure holding a calendar date and time broken down into its components.
type DialogFileCallback ¶
type DialogFileCallback uintptr
DialogFileCallback defines the callback used by file dialog functions.
func NewDialogFileCallback ¶
func NewDialogFileCallback(callback func(userdata unsafe.Pointer, filelist []string, filter int32)) DialogFileCallback
type DialogFileFilter ¶
type DialogFileFilter struct {
// contains filtered or unexported fields
}
DialogFileFilter is an entry for filters for file dialogs.
func NewDialogFileFilter ¶
func NewDialogFileFilter(name, pattern string) DialogFileFilter
func (DialogFileFilter) Name ¶
func (d DialogFileFilter) Name() string
func (DialogFileFilter) Pattern ¶
func (d DialogFileFilter) Pattern() string
type DisplayEvent ¶
type DisplayEvent struct {
CommonEvent
DisplayID DisplayID // The associated display.
Data1 int32 // Event dependent data.
Data2 int32 // Event dependent data.
}
DisplayEvent defines the display state change event data (event.display.*).
type DisplayID ¶
type DisplayID uint32
DisplayID is a unique ID for a display for the time it is connected to the system, and is never reused for the lifetime of the application.
func GetDisplayForPoint ¶
GetDisplayForPoint gets the display containing a point.
func GetDisplayForRect ¶
GetDisplayForRect gets the display primarily containing a rect.
func GetDisplayForWindow ¶
GetDisplayForWindow gets the display associated with a window.
func GetDisplays ¶
func GetDisplays() []DisplayID
GetDisplays gets a list of currently connected displays.
func GetPrimaryDisplay ¶
func GetPrimaryDisplay() DisplayID
GetPrimaryDisplay returns the primary display.
type DisplayMode ¶
type DisplayMode struct {
DisplayID DisplayID // The display this mode is associated with
Format PixelFormat // Pixel format
W int32 // Width
H int32 // Height
PixelDensity float32 // Scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels)
RefreshRate float32 // Refresh rate (or 0.0f for unspecified)
RefreshRateNumerator int32 // Precise refresh rate numerator (or 0 for unspecified)
RefreshRateDenominator int32 // Precise refresh rate denominator
Internal *DisplayModeData // Private
}
DisplayMode defines a display mode.
func GetCurrentDisplayMode ¶
func GetCurrentDisplayMode(displayID DisplayID) *DisplayMode
GetCurrentDisplayMode gets information about the current display mode.
func GetDesktopDisplayMode ¶
func GetDesktopDisplayMode(displayID DisplayID) *DisplayMode
GetDesktopDisplayMode gets information about the desktop's display mode.
func GetFullscreenDisplayModes ¶
func GetFullscreenDisplayModes(displayID DisplayID) []*DisplayMode
GetFullscreenDisplayModes gets a list of fullscreen display modes available on a display, or nil on error.
func GetWindowFullscreenMode ¶
func GetWindowFullscreenMode(window *Window) *DisplayMode
GetWindowFullscreenMode queries the display mode to use when a window is visible at fullscreen.
type DisplayOrientation ¶
type DisplayOrientation uint32
DisplayOrientation describes the way a display is rotated.
const ( OrientationUnknown DisplayOrientation = iota // The display orientation can't be determined OrientationLandscape // The display is in landscape mode, with the right side up, relative to portrait mode OrientationLandscapeFlipped // The display is in landscape mode, with the left side up, relative to portrait mode OrientationPortrait // The display is in portrait mode OrientationPortraitFlipped // The display is in portrait mode, upside down )
func GetCurrentDisplayOrientation ¶
func GetCurrentDisplayOrientation(displayID DisplayID) DisplayOrientation
GetCurrentDisplayOrientation gets the orientation of a display.
func GetNaturalDisplayOrientation ¶
func GetNaturalDisplayOrientation(displayID DisplayID) DisplayOrientation
GetNaturalDisplayOrientation gets the orientation of a display when it is unrotated.
type DropEvent ¶
type DropEvent struct {
CommonEvent
WindowID WindowID // The window that was dropped on, if any.
X float32 // X coordinate, relative to window (not on begin).
Y float32 // Y coordinate, relative to window (not on begin).
// contains filtered or unexported fields
}
DropEvent is an event used to drop text or request a file open by the system (event.drop.*).
type EnumerateDirectoryCallback ¶
type EnumerateDirectoryCallback uintptr
EnumerateDirectoryCallback is a callback for directory enumeration.
type EnumeratePropertiesCallback ¶
type EnumeratePropertiesCallback uintptr
EnumeratePropertiesCallback is a callback used to enumerate all the properties in a group of properties.
func NewEnumeratePropertiesCallback ¶
func NewEnumeratePropertiesCallback(callback func(userdata unsafe.Pointer, props PropertiesID, name string)) EnumeratePropertiesCallback
type EnumerationResult ¶
type EnumerationResult uint32
EnumerationResult defines the possible results from an enumeration callback.
const ( EnumContinue EnumerationResult = iota // Value that requests that enumeration continue. EnumSuccess // Value that requests that enumeration stop, successfully. EnumFailure // Value that requests that enumeration stop, as a failure. )
type Environment ¶
type Environment struct{}
Environment is a thread-safe set of environment variables.
type Event ¶
type Event [128]byte
Event is a structure specifying the structure for all events in SDLs.
func (*Event) ADevice ¶
func (e *Event) ADevice() AudioDeviceEvent
ADevice returns audio device event data (event.adevice.*).
func (*Event) Button ¶
func (e *Event) Button() MouseButtonEvent
Button returns mouse button event data (event.button.*).
func (*Event) CDevice ¶
func (e *Event) CDevice() CameraDeviceEvent
CDevice returns camera device event data (event.cdevice.*).
func (*Event) Clipboard ¶
func (e *Event) Clipboard() ClipboardEvent
Clipboard returns clipboard contents have changed event data (event.clipboard.*).
func (*Event) Common ¶
func (e *Event) Common() CommonEvent
Common returns common fields shared by every event.
func (*Event) Display ¶
func (e *Event) Display() DisplayEvent
Display returns display state change event data (event.display.*)
func (*Event) Drop ¶
Drop returns event data related to dropped text or a file open request by the system (event.drop.*).
func (*Event) Edit ¶
func (e *Event) Edit() TextEditingEvent
Edit returns keyboard text editing event data (event.edit.*).
func (*Event) EditCandidates ¶
func (e *Event) EditCandidates() TextEditingCandidatesEvent
EditCandidates returns keyboard IME candidates event data (event.edit_candidates.*).
func (*Event) GAxis ¶
func (e *Event) GAxis() GamepadAxisEvent
GAxis returns gamepad axis motion event data (event.gaxis.*).
func (*Event) GButton ¶
func (e *Event) GButton() GamepadButtonEvent
GButton returns gamepad button event data (event.gbutton.*).
func (*Event) GDevice ¶
func (e *Event) GDevice() GamepadDeviceEvent
GDevice returns gamepad device event data (event.gdevice.*).
func (*Event) GSensor ¶
func (e *Event) GSensor() GamepadSensorEvent
GSensor returns gamepad sensor event data (event.gsensor.*).
func (*Event) GTouchpad ¶
func (e *Event) GTouchpad() GamepadTouchpadEvent
GTouchpad returns gamepad touchpad event data (event.gtouchpad.*).
func (*Event) JAxis ¶
func (e *Event) JAxis() JoyAxisEvent
JAxis returns joystick axis motion event data (event.jaxis.*).
func (*Event) JBall ¶
func (e *Event) JBall() JoyBallEvent
JBall returns joystick trackball motion event data (event.jball.*).
func (*Event) JBattery ¶
func (e *Event) JBattery() JoyBatteryEvent
JBattery returns joystick battery level change event data (event.jbattery.*).
func (*Event) JButton ¶
func (e *Event) JButton() JoyButtonEvent
JButton returns joystick button event data (event.jbutton.*).
func (*Event) JDevice ¶
func (e *Event) JDevice() JoyDeviceEvent
JDevice returns joystick device event data (event.jdevice.*).
func (*Event) JHat ¶
func (e *Event) JHat() JoyHatEvent
JHat returns joystick hat position change event data (event.jhat.*).
func (*Event) KDevice ¶
func (e *Event) KDevice() KeyboardDeviceEvent
KDevice returns keyboard device event data (event.kdevice.*).
func (*Event) Key ¶
func (e *Event) Key() KeyboardEvent
Key returns keyboard button event data (event.key.*).
func (*Event) MDevice ¶
func (e *Event) MDevice() MouseDeviceEvent
MDevice returns mouse device event data (event.mdevice.*).
func (*Event) Motion ¶
func (e *Event) Motion() MouseMotionEvent
Motion returns mouse motion event data (event.motion.*).
func (*Event) PAxis ¶
func (e *Event) PAxis() PenAxisEvent
PAxis returns pressure-sensitive pen pressure / angle event data (event.paxis.*).
func (*Event) PButton ¶
func (e *Event) PButton() PenButtonEvent
PButton returns pressure-sensitive pen button event data (event.pbutton.*).
func (*Event) PMotion ¶
func (e *Event) PMotion() PenMotionEvent
PMotion returns pressure-sensitive pen motion event data (event.pmotion.*).
func (*Event) PProximity ¶
func (e *Event) PProximity() PenProximityEvent
PProximity returns pressure-sensitive pen proximity event data (event.pproximity.*).
func (*Event) PTouch ¶
func (e *Event) PTouch() PenTouchEvent
PTouch returns pressure-sensitive pen touched event data (event.ptouch.*).
func (*Event) Render ¶
func (e *Event) Render() RenderEvent
Render returns renderer event data (event.render.*).
func (*Event) Sensor ¶
func (e *Event) Sensor() SensorEvent
Sensor returns sensor event data (event.sensor.*).
func (*Event) TFinger ¶
func (e *Event) TFinger() TouchFingerEvent
TFinger returns touch finger event data (event.tfinger.*).
func (*Event) Text ¶
func (e *Event) Text() TextInputEvent
Text returns keyboard text input event data (event.text.*).
func (*Event) Wheel ¶
func (e *Event) Wheel() MouseWheelEvent
Wheel returns mouse wheel event data (event.wheel.*).
func (*Event) Window ¶
func (e *Event) Window() WindowEvent
Window returns window state change event data (event.window.*)
type EventAction ¶
type EventAction uint32
EventAction is a structure specifying the type of action to request from PeepEvents.
const ( AddEvent EventAction = iota // Add events to the back of the queue. PeekEvent // Check but don't remove events from the queue front. GetEvent // Retrieve/remove events from the front of the queue. )
type EventFilter ¶
type EventFilter uintptr
EventFilter is a C function pointer used for callbacks that watch the event queue. Use NewEventFilter for creation.
func NewEventFilter ¶
func NewEventFilter(filter func(userdata unsafe.Pointer, event *Event) bool) EventFilter
NewEventFilter converts the Go function to a C function pointer.
type EventType ¶
type EventType uint32
EventType is a structure specifying the types of events that can be delivered.
const ( EventFirst EventType = 0x0 // Unused (do not remove). EventQuit EventType = 0x100 // User-requested quit. EventTerminating EventType = 0x101 // The application is being terminated by the OS. This event must be handled in a callback set with [AddEventWatch]. Called on iOS in applicationWillTerminate(). Called on Android in onDestroy(). EventLowMemory EventType = 0x102 // The application is low on memory, free memory if possible. This event must be handled in a callback set with [AddEventWatch]. Called on iOS in applicationDidReceiveMemoryWarning(). Called on Android in onTrimMemory(). EventWillEnterBackground EventType = 0x103 // The application is about to enter the background. This event must be handled in a callback set with [AddEventWatch]. Called on iOS in applicationWillResignActive(). Called on Android in onPause(). EventDidEnterBackground EventType = 0x104 // The application did enter the background and may not get CPU for some time. This event must be handled in a callback set with [AddEventWatch]. Called on iOS in applicationDidEnterBackground(). Called on Android in onPause(). EventWillEnterForeground EventType = 0x105 // The application is about to enter the foreground. This event must be handled in a callback set with [AddEventWatch]. Called on iOS in applicationWillEnterForeground(). Called on Android in onResume(). EventDidEnterForeground EventType = 0x106 // The application is now interactive. This event must be handled in a callback set with [AddEventWatch]. Called on iOS in applicationDidBecomeActive(). Called on Android in onResume(). EventLocaleChanged EventType = 0x107 // The user's locale preferences have changed. EventSystemThemeChanged EventType = 0x108 // The system theme changed. EventDisplayOrientation EventType = 0x151 // Display orientation has changed to data1. EventDisplayFirst = EventDisplayOrientation EventDisplayAdded EventType = 0x152 // Display has been added to the system. EventDisplayRemoved EventType = 0x153 // Display has been removed from the system. EventDisplayMoved EventType = 0x154 // Display has changed position. EventDisplayDesktopModeChanged EventType = 0x155 // Display has changed desktop mode. EventDisplayCurrentModeChanged EventType = 0x156 // Display has changed current mode. EventDisplayContentScaleChanged EventType = 0x157 // Display has changed content scale. EventDisplayUsableBoundsChanged EventType = 0x158 // Display has changed usable bounds. EventDisplayLast = EventDisplayUsableBoundsChanged EventWindowShown EventType = 0x202 // Window has been shown. EventWindowFirst = EventWindowShown EventWindowHidden EventType = 0x203 // Window has been hidden. EventWindowExposed EventType = 0x204 // Window has been exposed and should be redrawn, and can be redrawn directly from event watchers for this event. data1 is 1 for live-resize expose events, 0 otherwise. EventWindowMoved EventType = 0x205 // Window has been moved to data1, data2. EventWindowResized EventType = 0x206 // Window has been resized to data1xdata2. EventWindowPixelSizeChanged EventType = 0x207 // The pixel size of the window has changed to data1xdata2. EventWindowMetalViewResized EventType = 0x208 // The pixel size of a Metal view associated with the window has changed. EventWindowMinimized EventType = 0x209 // Window has been minimized. EventWindowMaximized EventType = 0x20A // Window has been maximized. EventWindowRestored EventType = 0x20B // Window has been restored to normal size and position. EventWindowMouseEnter EventType = 0x20C // Window has gained mouse focus. EventWindowMouseLeave EventType = 0x20D // Window has lost mouse focus. EventWindowFocusGained EventType = 0x20E // Window has gained keyboard focus. EventWindowFocusLost EventType = 0x20F // Window has lost keyboard focus. EventWindowCloseRequested EventType = 0x210 // The window manager requests that the window be closed. EventWindowHitTest EventType = 0x211 // Window had a hit test that wasn't [HITTEST_NORMAL]. EventWindowICCProfChanged EventType = 0x212 // The ICC profile of the window's display has changed. EventWindowDisplayChanged EventType = 0x213 // Window has been moved to display data1. EventWindowDisplayScaleChanged EventType = 0x214 // Window display scale has been changed. EventWindowSafeAreaChanged EventType = 0x215 // The window safe area has been changed. EventWindowOccluded EventType = 0x216 // The window has been occluded. EventWindowEnterFullscreen EventType = 0x217 // The window has entered fullscreen mode. EventWindowLeaveFullscreen EventType = 0x218 // The window has left fullscreen mode. EventWindowDestroyed EventType = 0x219 // The window with the associated ID is being or has been destroyed. If this message is being handled in an event watcher, the window handle is still valid and can still be used to retrieve any properties associated with the window. Otherwise, the handle has already been destroyed and all resources associated with it are invalid. EventWindowHDRStateChanged EventType = 0x21A // Window HDR properties have changed. EventWindowLast = EventWindowHDRStateChanged EventKeyDown EventType = 0x300 // Key pressed. EventKeyUp EventType = 0x301 // Key released. EventTextEditing EventType = 0x302 // Keyboard text editing (composition). EventTextInput EventType = 0x303 // Keyboard text input. EventKeymapChanged EventType = 0x304 // Keymap changed due to a system event such as an input language or keyboard layout change. EventKeyboardAdded EventType = 0x305 // A new keyboard has been inserted into the system. EventKeyboardRemoved EventType = 0x306 // A keyboard has been removed. EventTextEditingCandidates EventType = 0x307 // Keyboard text editing candidates. EventScreenKeyboardShown EventType = 0x308 // The on-screen keyboard has been shown. EventScreenKeyboardHidden EventType = 0x309 // The on-screen keyboard has been hidden EventMouseMotion EventType = 0x400 // Mouse moved. EventMouseButtonDown EventType = 0x401 // Mouse button pressed. EventMouseButtonUp EventType = 0x402 // Mouse button released. EventMouseWheel EventType = 0x403 // Mouse wheel motion. EventMouseAdded EventType = 0x404 // A new mouse has been inserted into the system. EventMouseRemoved EventType = 0x405 // A mouse has been removed. EventJoystickAxisMotion EventType = 0x600 // Joystick axis motion. EventJoystickBallMotion EventType = 0x601 // Joystick trackball motion. EventJoystickHatMotion EventType = 0x602 // Joystick hat position change. EventJoystickButtonDown EventType = 0x603 // Joystick button pressed. EventJoystickButtonUp EventType = 0x604 // Joystick button released. EventJoystickAdded EventType = 0x605 // A new joystick has been inserted into the system. EventJoystickRemoved EventType = 0x606 // An opened joystick has been removed. EventJoystickBatteryUpdated EventType = 0x607 // Joystick battery level change. EventJoystickUpdateComplete EventType = 0x608 // Joystick update is complete. EventGamepadAxisMotion EventType = 0x650 // Gamepad axis motion. EventGamepadButtonDown EventType = 0x651 // Gamepad button pressed. EventGamepadButtonUp EventType = 0x652 // Gamepad button released. EventGamepadAdded EventType = 0x653 // A new gamepad has been inserted into the system. EventGamepadRemoved EventType = 0x654 // A gamepad has been removed. EventGamepadRemapped EventType = 0x655 // The gamepad mapping was updated. EventGamepadTouchpadDown EventType = 0x656 // Gamepad touchpad was touched. EventGamepadTouchpadMotion EventType = 0x657 // Gamepad touchpad finger was moved. EventGamepadTouchpadUp EventType = 0x658 // Gamepad touchpad finger was lifted. EventGamepadSensorUpdate EventType = 0x659 // Gamepad sensor was updated. EventGamepadUpdateComplete EventType = 0x65A // Gamepad update is complete. EventGamepadSteamHandleUpdated EventType = 0x65B // Gamepad Steam handle has changed. EventFingerDown EventType = 0x700 EventFingerUp EventType = 0x701 EventFingerMotion EventType = 0x702 EventFingerCanceled EventType = 0x703 EventPinchBegin EventType = 0x710 // Pinch gesture started. EventPinchUpdate EventType = 0x711 // Pinch gesture updated. EventPinchEnd EventType = 0x712 // Pinch gesture ended. EventClipboardUpdate EventType = 0x900 // The clipboard changed. EventDropFile EventType = 0x1000 // The system requests a file open. EventDropText EventType = 0x1001 // Text/plain drag-and-drop event. EventDropBegin EventType = 0x1002 // A new set of drops is beginning (nil filename). EventDropComplete EventType = 0x1003 // Current set of drops is now complete (nil filename). EventDropPosition EventType = 0x1004 // Position while moving over the window. EventAudioDeviceAdded EventType = 0x1100 // A new audio device is available. EventAudioDeviceRemoved EventType = 0x1101 // An audio device has been removed. EventAudioDeviceFormatChanged EventType = 0x1102 // An audio device's format has been changed by the system. EventSensorUpdate EventType = 0x1200 // A sensor was updated. EventPenProximityIn EventType = 0x1300 // Pressure-sensitive pen has become available. EventPenProximityOut EventType = 0x1301 // Pressure-sensitive pen has become unavailable. EventPenDown EventType = 0x1302 // Pressure-sensitive pen touched drawing surface. EventPenUp EventType = 0x1303 // Pressure-sensitive pen stopped touching drawing surface. EventPenButtonDown EventType = 0x1304 // Pressure-sensitive pen button pressed. EventPenButtonUp EventType = 0x1305 // Pressure-sensitive pen button released. EventPenMotion EventType = 0x1306 // Pressure-sensitive pen is moving on the tablet. EventPenAxis EventType = 0x1307 // Pressure-sensitive pen angle/pressure/etc changed. EventCameraDeviceAdded EventType = 0x1400 // A new camera device is available. EventCameraDeviceRemoved EventType = 0x1401 // A camera device has been removed. EventCameraDeviceApproved EventType = 0x1402 // A camera device has been approved for use by the user. EventCameraDeviceDenied EventType = 0x1403 // A camera device has been denied for use by the user. EventRenderTargetsReset EventType = 0x2000 // The render targets have been reset and their contents need to be updated. EventRenderDeviceReset EventType = 0x2001 // The device has been reset and all textures need to be recreated. EventRenderDeviceLost EventType = 0x2002 // The device has been lost and can't be recovered. EventPrivate0 EventType = 0x4000 EventPrivate1 EventType = 0x4001 EventPrivate2 EventType = 0x4002 EventPrivate3 EventType = 0x4003 EventPollSentinel EventType = 0x7F00 // Signals the end of an event poll cycle. EventUser EventType = 0x8000 // Events [EVENT_USER] through [EVENT_LAST] are for your use, and should be allocated with [RegisterEvents]. EventLast EventType = 0xFFFF // Events [EVENT_USER] through [EVENT_LAST] are for your use, and should be allocated with [RegisterEvents]. This last event is only for bounding internal arrays. EventEnumPadding EventType = 0x7FFFFFFF // This just makes sure the enum is the size of Uint32. )
type FColor ¶
type FColor struct {
R, G, B, A float32
}
FColor is a structure specifying the bits of this structure can be directly reinterpreted as a float-packed color which uses the [PIXELFORMAT_RGBA128_FLOAT] formas.
type FPoint ¶
type FPoint struct {
X, Y float32
}
FPoint is a structure specifying the structure that defines a point (using floating point values)s.
type FRect ¶
type FRect struct {
X, Y, W, H float32
}
FRect is a rectangle, with the origin at the upper left (using floating point values).
func GetRectEnclosingPointsFloat ¶
GetRectEnclosingPointsFloat calculates a minimal rectangle enclosing a set of points with float precision.
func GetRectIntersectionFloat ¶
GetRectIntersectionFloat calculates the intersection of two rectangles with float precision.
func GetRectUnionFloat ¶
GetRectUnionFloat calculates the union of two rectangles.
type FileDialogType ¶
type FileDialogType uint32
FileDialogType defines the various types of file dialogs.
const ( FileDialogOpenFile FileDialogType = iota FileDialogSaveFile FileDialogOpenFolder )
type Finger ¶
type Finger struct {
ID FingerID // The finger ID.
X float32 // The x-axis location of the touch event, normalized (0...1).
Y float32 // The y-axis location of the touch event, normalized (0...1).
Pressure float32 // The quantity of pressure applied, normalized (0...1).
}
Finger is a structure storing data about a single finger in a multitouch event.
type FlashOperation ¶
type FlashOperation uint32
FlashOperation window flash operation.
const ( FlashCancel FlashOperation = iota // Cancel any window flash state FlashBriefly // Flash the window briefly to get attention FlashUntilFocused // Flash the window until it gets focus )
type FlipMode ¶
type FlipMode uint32
FlipMode is a structure specifying the flip modes.
const ( FlipNone FlipMode = iota // Do not flip. FlipHorizontal // Flip horizontally. FlipVertical // Flip vertically. FlipHorizontalAndVertical = FlipHorizontal | FlipVertical // Flip horizontally and vertically (not a diagonal flip). )
type Folder ¶
type Folder uint32
Folder is a structure specifying the type of the OS-provided default folder for a specific purposes.
const ( FolderHome Folder = iota // The folder which contains all of the current user's data, preferences, and documents. It usually contains most of the other folders. If a requested folder does not exist, the home folder can be considered a safe fallback to store a user's documents. FolderDesktop // The folder of files that are displayed on the desktop. Note that the existence of a desktop folder does not guarantee that the system does show icons on its desktop; certain GNU/Linux distros with a graphical environment may not have desktop icons. FolderDocuments // User document files, possibly application-specific. This is a good place to save a user's projects. FolderDownloads // Standard folder for user files downloaded from the internet. FolderMusic // Music files that can be played using a standard music player (mp3, ogg...). FolderPictures // Image files that can be displayed using a standard viewer (png, jpg...). FolderSavedGames // Save files for games. FolderScreenshots // Application screenshots. FolderTemplates // Template files to be used when the user requests the desktop environment to create a new file in a certain folder, such as "New Text File.txt". Any file in the Templates folder can be used as a starting point for a new file. FolderVideos // Video files that can be played using a standard video player (mp4, webm...). FolderCount // Total number of types in this enum, not a folder type by itself. )
type GLAttr ¶
type GLAttr uint32
GLAttr an enumeration of OpenGL configuration attributes.
const ( GLRedSize GLAttr = iota // The minimum number of bits for the red channel of the color buffer; defaults to 8. GLGreenSize // The minimum number of bits for the green channel of the color buffer; defaults to 8. GLBlueSize // The minimum number of bits for the blue channel of the color buffer; defaults to 8. GLAlphaSize // The minimum number of bits for the alpha channel of the color buffer; defaults to 8. GLBufferSize // The minimum number of bits for frame buffer size; defaults to 0. GLDoubleBuffer // Whether the output is single or double buffered; defaults to double buffering on. GLDepthSize // The minimum number of bits in the depth buffer; defaults to 16. GLStencilSize // The minimum number of bits in the stencil buffer; defaults to 0. GLAccumRedSize // The minimum number of bits for the red channel of the accumulation buffer; defaults to 0. GLAccumGreenSize // The minimum number of bits for the green channel of the accumulation buffer; defaults to 0. GLAccumBlueSize // The minimum number of bits for the blue channel of the accumulation buffer; defaults to 0. GLAccumAlphaSize // The minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0. GLStereo // Whether the output is stereo 3D; defaults to off. GLMultisampleBuffers // The number of buffers used for multisample anti-aliasing; defaults to 0. GLMultisampleSamples // The number of samples used around the current pixel used for multisample anti-aliasing. GLAcceleratedVisual // Set to 1 to require hardware acceleration, set to 0 to force software rendering; defaults to allow either. GLRetainedBacking // Not used (deprecated). GLContextMajorVersion // OpenGL context major version. GLContextMinorVersion // OpenGL context minor version. GLContextFlags // Some combination of 0 or more of elements of the SDL_GLContextFlag enumeration; defaults to 0. GLContextProfileMask // Type of GL context (Core, Compatibility, ES). See SDL_GLProfile; default value depends on platform. GLFramebufferSRGBCapable // Requests sRGB capable visual; defaults to 0. GLContextReleaseBehavior // Sets context the release behavior. See SDL_GLContextReleaseFlag; defaults to FLUSH. GLContextResetNotification // Set context reset notification. See SDL_GLContextResetNotification; defaults to NO_NOTIFICATION. GLContextNoError GLFloatBuffers GLEGLPlatform )
type GLContext ¶
type GLContext *GLContextState
GLContext is an opaque handle to an OpenGL context.
func GLCreateContext ¶
GLCreateContext creates an OpenGL context for an OpenGL window, and makes it current.
func GLGetCurrentContext ¶
func GLGetCurrentContext() GLContext
GLGetCurrentContext returns the currently active OpenGL context or nil on failure.
type GLContextFlag ¶
type GLContextFlag uint32
GLContextFlag defines possible flags to be set for the GLContextFlags attribute.
const ( GLContextDebugFlag GLContextFlag = 0x0001 GLContextForwardCompatibleFlag GLContextFlag = 0x0002 GLContextRobustAccessFlag GLContextFlag = 0x0004 GLContextResetIsolationFlag GLContextFlag = 0x0008 )
type GLContextReleaseFlag ¶
type GLContextReleaseFlag uint32
GLContextReleaseFlag defines possible values to be set for the GLContextReleaseBehavior attribute.
const ( GLContextReleaseBehaviorNone GLContextReleaseFlag = 0x0000 GLContextReleaseBehaviorFlush GLContextReleaseFlag = 0x0001 )
type GLContextResetNotification_ ¶
type GLContextResetNotification_ uint32
GLContextResetNotification_ defines possible values to be set GLContextResetNotification attribute.
const ( GLContextResetNoNotification GLContextResetNotification_ = 0x0000 GLContextResetLoseContext GLContextResetNotification_ = 0x0001 )
type GLContextState ¶
type GLContextState struct{}
type GLProfile ¶
type GLProfile uint32
GLProfile defines possible values to be set for the GLContextProfileMask attribute.
type GPUBlendFactor ¶
type GPUBlendFactor uint32
GPUBlendFactor is a structure specifying a blending factor to be used when pixels in a render target are blended with existing pixels in the texture.
const ( GPUBlendFactorInvalid GPUBlendFactor = iota GPUBlendFactorZero // 0 GPUBlendFactorOne // 1 GPUBlendFactorSrcColor // source color GPUBlendFactorOneMinusSrcColor // 1 - source color GPUBlendFactorDstColor // destination color GPUBlendFactorOneMinusDstColor // 1 - destination color GPUBlendFactorSrcAlpha // source alpha GPUBlendFactorOneMinusSrcAlpha // 1 - source alpha GPUBlendFactorDstAlpha // destination alpha GPUBlendFactorOneMinusDstAlpha // 1 - destination alpha GPUBlendFactorConstantColor // blend constant GPUBlendFactorOneMinusConstantColor // 1 - blend constant GPUBlendFactorSrcAlphaSaturate // min(source alpha, 1 - destination alpha) )
type GPUBlendOp ¶
type GPUBlendOp uint32
GPUBlendOp is a structure specifying the operator to be used when pixels in a render target are blended with existing pixels in the texture.
const ( GPUBlendOpInvalid GPUBlendOp = iota GPUBlendOpAdd // (source * source_factor) + (destination * destination_factor) GPUBlendOpSubtract // (source * source_factor) - (destination * destination_factor) GPUBlendOpReverseSubtract // (destination * destination_factor) - (source * source_factor) GPUBlendOpMin // min(source, destination) GPUBlendOpMax // max(source, destination) )
type GPUBlitInfo ¶
type GPUBlitInfo struct {
Source GPUBlitRegion // The source region for the blit.
Destination GPUBlitRegion // The destination region for the blit.
LoadOp GPULoadOp // What is done with the contents of the destination before the blit.
ClearColor FColor // The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR.
FlipMode FlipMode // The flip mode for the source region.
Filter GPUFilter // The filter mode used when blitting.
Cycle bool // True cycles the destination texture if it is already bound.
// contains filtered or unexported fields
}
GPUBlitInfo is a structure containing parameters for a blit command.
type GPUBlitRegion ¶
type GPUBlitRegion struct {
Texture *GPUTexture // The texture.
MipLevel uint32 // The mip level index of the region.
LayerOrDepthPlane uint32 // The layer index or depth plane of the region. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures.
X uint32 // The left offset of the region.
Y uint32 // The top offset of the region.
W uint32 // The width of the region.
H uint32 // The height of the region.
}
GPUBlitRegion is a structure specifying a region of a texture used in the blit operation.
type GPUBuffer ¶
type GPUBuffer struct{}
GPUBuffer is an opaque handle representing a buffer.
func CreateGPUBuffer ¶
func CreateGPUBuffer(device *GPUDevice, createinfo *GPUBufferCreateInfo) *GPUBuffer
CreateGPUBuffer creates a buffer object to be used in graphics or compute workflows.
type GPUBufferBinding ¶
type GPUBufferBinding struct {
Buffer *GPUBuffer // The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer.
Offset uint32 // The starting byte of the data to bind in the buffer.
}
GPUBufferBinding is a structure specifying parameters in a buffer binding call.
type GPUBufferCreateInfo ¶
type GPUBufferCreateInfo struct {
Usage GPUBufferUsageFlags // How the buffer is intended to be used by the client.
Size uint32 // The size in bytes of the buffer.
Props PropertiesID // A properties ID for extensions. Should be 0 if no extensions are needed.
}
GPUBufferCreateInfo is a structure specifying the parameters of a buffer.
type GPUBufferLocation ¶
type GPUBufferLocation struct {
Buffer *GPUBuffer // The buffer.
Offset uint32 // The starting byte within the buffer.
}
GPUBufferLocation is a structure specifying a location in a buffer.
type GPUBufferRegion ¶
type GPUBufferRegion struct {
Buffer *GPUBuffer // The buffer.
Offset uint32 // The starting byte within the buffer.
Size uint32 // The size in bytes of the region.
}
GPUBufferRegion is a structure specifying a region of a buffer.
type GPUBufferUsageFlags ¶
type GPUBufferUsageFlags uint32
GPUBufferUsageFlags is a structure specifying how a buffer is intended to be used by the client.
const ( GPUBufferUsageVertex GPUBufferUsageFlags = 1 << 0 // Buffer is a vertex buffer. GPUBufferUsageIndex GPUBufferUsageFlags = 1 << 1 // Buffer is an index buffer. GPUBufferUsageIndirect GPUBufferUsageFlags = 1 << 2 // Buffer is an indirect buffer. GPUBufferUsageGraphicsStorageRead GPUBufferUsageFlags = 1 << 3 // Buffer supports storage reads in graphics stages. GPUBufferUsageComputeStorageRead GPUBufferUsageFlags = 1 << 4 // Buffer supports storage reads in the compute stage. GPUBufferUsageComputeStorageWrite GPUBufferUsageFlags = 1 << 5 // Buffer supports storage writes in the compute stage. )
type GPUColorComponentFlags ¶
type GPUColorComponentFlags uint8
GPUColorComponentFlags is a structure specifying which color components are written in a graphics pipeline.
const ( GPUColorComponentR GPUColorComponentFlags = 1 << 0 // The red component GPUColorComponentG GPUColorComponentFlags = 1 << 1 // The green component GPUColorComponentB GPUColorComponentFlags = 1 << 2 // The blue component GPUColorComponentA GPUColorComponentFlags = 1 << 3 // The alpha component )
type GPUColorTargetBlendState ¶
type GPUColorTargetBlendState struct {
SrcColorBlendFactor GPUBlendFactor // The value to be multiplied by the source RGB value.
DstColorBlendFactor GPUBlendFactor // The value to be multiplied by the destination RGB value.
ColorBlendOp GPUBlendOp // The blend operation for the RGB components.
SrcAlphaBlendFactor GPUBlendFactor // The value to be multiplied by the source alpha.
DstAlphaBlendFactor GPUBlendFactor // The value to be multiplied by the destination alpha.
AlphaBlendOp GPUBlendOp // The blend operation for the alpha component.
ColorWriteMask GPUColorComponentFlags // A bitmask specifying which of the RGBA components are enabled for writing. Writes to all channels if enable_color_write_mask is false.
EnableBlend bool // Whether blending is enabled for the color target.
EnableColorWriteMask bool // Whether the color write mask is enabled.
// contains filtered or unexported fields
}
GPUColorTargetBlendState is a structure specifying the blend state of a color target.
type GPUColorTargetDescription ¶
type GPUColorTargetDescription struct {
Format GPUTextureFormat // The pixel format of the texture to be used as a color target.
BlendState GPUColorTargetBlendState // The blend state to be used for the color target.
}
GPUColorTargetDescription is a structure specifying the parameters of color targets used in a graphics pipeline.
type GPUColorTargetInfo ¶
type GPUColorTargetInfo struct {
Texture *GPUTexture // The texture that will be used as a color target by a render pass.
MipLevel uint32 // The mip level to use as a color target.
LayerOrDepthPlane uint32 // The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures.
ClearColor FColor // The color to clear the color target to at the start of the render pass. Ignored if GPULoadOpClear is not used.
LoadOp GPULoadOp // What is done with the contents of the color target at the beginning of the render pass.
StoreOp GPUStoreOp // What is done with the results of the render pass.
ResolveTexture *GPUTexture // The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used.
ResolveMipLevel uint32 // The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used.
ResolveLayer uint32 // The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used.
Cycle bool // true cycles the texture if the texture is bound and load_op is not LOAD
CycleResolveTexture bool // true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used.
// contains filtered or unexported fields
}
GPUColorTargetInfo is a structure specifying the parameters of a color target used by a render pass.
type GPUCommandBuffer ¶
type GPUCommandBuffer struct{}
GPUCommandBuffer is an opaque handle representing a command buffer.
func AcquireGPUCommandBuffer ¶
func AcquireGPUCommandBuffer(device *GPUDevice) *GPUCommandBuffer
AcquireGPUCommandBuffer acquires a command buffer.
type GPUCompareOp ¶
type GPUCompareOp uint32
GPUCompareOp is a structure specifying a comparison operator for depth, stencil and sampler operations.
const ( GPUCompareOpInvalid GPUCompareOp = iota GPUCompareOpNever // The comparison always evaluates false. GPUCompareOpLess // The comparison evaluates reference < test. GPUCompareOpEqual // The comparison evaluates reference == test. GPUCompareOpLessOrEqual // The comparison evaluates reference <= test. GPUCompareOpGreater // The comparison evaluates reference > test. GPUCompareOpNotEqual // The comparison evaluates reference != test. GPUCompareOpGreaterOrEqual // The comparison evaluates reference >= test. GPUCompareOpAlways // The comparison always evaluates true. )
type GPUComputePass ¶
type GPUComputePass struct{}
GPUComputePass is an opaque handle representing a compute pass.
type GPUComputePipeline ¶
type GPUComputePipeline struct{}
GPUComputePipeline is an opaque handle representing a compute pipeline.
type GPUComputePipelineCreateInfo ¶
type GPUComputePipelineCreateInfo struct {
CodeSize uintptr // The size in bytes of the compute shader code pointed to.
Code *byte // A pointer to compute shader code.
Entrypoint *byte // A pointer to a null-terminated UTF-8 string specifying the entry point function name for the shader.
Format GPUShaderFormat // The format of the compute shader code.
NumSamplers uint32 // The number of samplers defined in the shader.
NumReadonlyStorageTextures uint32 // The number of readonly storage textures defined in the shader.
NumReadonlyStorageBuffers uint32 // The number of readonly storage buffers defined in the shader.
NumReadwriteStorageTextures uint32 // The number of read-write storage textures defined in the shader.
NumReadwriteStorageBuffers uint32 // The number of read-write storage buffers defined in the shader.
NumUniformBuffers uint32 // The number of uniform buffers defined in the shader.
ThreadcountX uint32 // The number of threads in the X dimension. This should match the value in the shader.
ThreadcountY uint32 // The number of threads in the Y dimension. This should match the value in the shader.
ThreadcountZ uint32 // The number of threads in the Z dimension. This should match the value in the shader.
Props PropertiesID // A properties ID for extensions. Should be 0 if no extensions are needed.
}
GPUComputePipelineCreateInfo is a structure specifying the parameters of a compute pipeline state.
type GPUCopyPass ¶
type GPUCopyPass struct{}
GPUCopyPass is an opaque handle representing a copy pass.
func BeginGPUCopyPass ¶
func BeginGPUCopyPass(commandBuffer *GPUCommandBuffer) *GPUCopyPass
BeginGPUCopyPass begins a copy pass on a command buffer.
type GPUCubeMapFace ¶
type GPUCubeMapFace uint32
GPUCubeMapFace is a structure specifying the face of a cube map.
const ( GPUCubeMapFacePositiveX GPUCubeMapFace = iota GPUCubeMapFaceNegativeX GPUCubeMapFacePositiveY GPUCubeMapFaceNegativeY GPUCubeMapFacePositiveZ GPUCubeMapFaceNegativeZ )
type GPUCullMode ¶
type GPUCullMode uint32
GPUCullMode is a structure specifying the facing direction in which triangle faces will be culled.
const ( GPUCullModeNone GPUCullMode = iota // No triangles are culled. GPUCullModeFront // Front-facing triangles are culled. GPUCullModeBack // Back-facing triangles are culled. )
type GPUDepthStencilState ¶
type GPUDepthStencilState struct {
CompareOp GPUCompareOp // The comparison operator used for depth testing.
BackStencilState GPUStencilOpState // The stencil op state for back-facing triangles.
FrontStencilState GPUStencilOpState // The stencil op state for front-facing triangles.
CompareMask uint8 // Selects the bits of the stencil values participating in the stencil test.
WriteMask uint8 // Selects the bits of the stencil values updated by the stencil test.
EnableDepthTest bool // true enables the depth test.
EnableDepthWrite bool // true enables depth writes. Depth writes are always disabled when enable_depth_test is false.
EnableStencilTest bool // true enables the stencil test.
// contains filtered or unexported fields
}
GPUDepthStencilState is a structure specifying the parameters of the graphics pipeline depth stencil state.
type GPUDepthStencilTargetInfo ¶
type GPUDepthStencilTargetInfo struct {
Texture *GPUTexture // The texture that will be used as the depth stencil target by the render pass.
ClearDepth float32 // The value to clear the depth component to at the beginning of the render pass. Ignored if GPU_LOADOP_CLEAR is not used.
LoadOp GPULoadOp // What is done with the depth contents at the beginning of the render pass.
StoreOp GPUStoreOp // What is done with the depth results of the render pass.
StencilLoadOp GPULoadOp // What is done with the stencil contents at the beginning of the render pass.
StencilStoreOp GPUStoreOp // What is done with the stencil results of the render pass.
Cycle bool // true cycles the texture if the texture is bound and any load ops are not LOAD
ClearStencil uint8 // The value to clear the stencil component to at the beginning of the render pass. Ignored if GPU_LOADOP_CLEAR is not used.
MipLevel uint8 // The mip level to use as the depth stencil target.
Layer uint8 // The layer index to use as the depth stencil target.
}
GPUDepthStencilTargetInfo is a structure specifying the parameters of a depth-stencil target used by a render pass.
type GPUDevice ¶
type GPUDevice struct{}
GPUDevice is an opaque handle representing the SDL_GPU context.
func CreateGPUDevice ¶
func CreateGPUDevice(formatFlags GPUShaderFormat, debugMode bool, name string) *GPUDevice
CreateGPUDevice creates a GPU context.
func GetGPURendererDevice ¶
GetGPURendererDevice returns the GPU device used by a renderer.
Available since SDL 3.4.0.
type GPUFillMode ¶
type GPUFillMode uint32
GPUFillMode is a structure specifying the fill mode of the graphics pipeline.
const ( GPUFillModeFill GPUFillMode = iota // Polygons will be rendered via rasterization. GPUFillModeLine // Polygon edges will be drawn as line segments. )
type GPUFilter ¶
type GPUFilter uint32
GPUFilter is a structure specifying a filter operation used by a sampler.
type GPUFrontFace ¶
type GPUFrontFace uint32
GPUFrontFace is a structure specifying the vertex winding that will cause a triangle to be determined to be front-facing.
const ( GPUFrontFaceCounterClockwise GPUFrontFace = iota // A triangle with counter-clockwise vertex winding will be considered front-facing. GPUFrontFaceClockwise // A triangle with clockwise vertex winding will be considered front-facing. )
type GPUGraphicsPipeline ¶
type GPUGraphicsPipeline struct{}
GPUGraphicsPipeline is an opaque handle representing a graphics pipeline.
func CreateGPUGraphicsPipeline ¶
func CreateGPUGraphicsPipeline(device *GPUDevice, createInfo *GPUGraphicsPipelineCreateInfo) *GPUGraphicsPipeline
CreateGPUGraphicsPipeline creates a pipeline object to be used in a graphics workflow.
type GPUGraphicsPipelineCreateInfo ¶
type GPUGraphicsPipelineCreateInfo struct {
VertexShader *GPUShader // The vertex shader used by the graphics pipeline.
FragmentShader *GPUShader // The fragment shader used by the graphics pipeline.
VertexInputState GPUVertexInputState // The vertex layout of the graphics pipeline.
PrimitiveType GPUPrimitiveType // The primitive topology of the graphics pipeline.
RasterizerState GPURasterizerState // The rasterizer state of the graphics pipeline.
MultisampleState GPUMultisampleState // The multisample state of the graphics pipeline.
DepthStencilState GPUDepthStencilState // The depth-stencil state of the graphics pipeline.
TargetInfo GPUGraphicsPipelineTargetInfo // Formats and blend modes for the render targets of the graphics pipeline.
Props PropertiesID // A properties ID for extensions. Should be 0 if no extensions are needed.
}
GPUGraphicsPipelineCreateInfo is a structure specifying the parameters of a graphics pipeline state.
type GPUGraphicsPipelineTargetInfo ¶
type GPUGraphicsPipelineTargetInfo struct {
ColorTargetDescriptions *GPUColorTargetDescription // A pointer to an array of color target descriptions.
NumColorTargets uint32 // The number of color target descriptions in the above array.
DepthStencilFormat GPUTextureFormat // The pixel format of the depth-stencil target. Ignored if HasDepthStencilTarget is false.
HasDepthStencilTarget bool // true specifies that the pipeline uses a depth-stencil target.
// contains filtered or unexported fields
}
GPUGraphicsPipelineTargetInfo is a structure specifying the descriptions of render targets used in a graphics pipeline.
type GPUIndexElementSize ¶
type GPUIndexElementSize uint32
GPUIndexElementSize is a structure specifying the size of elements in an index buffer.
const ( GPUIndexElementSize16Bit GPUIndexElementSize = iota // The index elements are 16-bit. GPUIndexElementSize32Bit // The index elements are 32-bit. )
type GPUIndexedIndirectDrawCommand ¶
type GPUIndexedIndirectDrawCommand struct {
NumIndices uint32 // The number of indices to draw per instance.
NumInstances uint32 // The number of instances to draw.
FirstIndex uint32 // The base index within the index buffer.
VertexOffset int32 // The value added to the vertex index before indexing into the vertex buffer.
FirstInstance uint32 // The ID of the first instance to draw.
}
GPUIndexedIndirectDrawCommand is a structure specifying the parameters of an indexed indirect draw command.
type GPUIndirectDispatchCommand ¶
type GPUIndirectDispatchCommand struct {
GroupcountX uint32 // The number of local workgroups to dispatch in the X dimension.
GroupcountY uint32 // The number of local workgroups to dispatch in the Y dimension.
GroupcountZ uint32 // The number of local workgroups to dispatch in the Z dimension.
}
GPUIndirectDispatchCommand is a structure specifying the parameters of an indexed dispatch command.
type GPUIndirectDrawCommand ¶
type GPUIndirectDrawCommand struct {
NumVertices uint32 // The number of vertices to draw.
NumInstances uint32 // The number of instances to draw.
FirstVertex uint32 // The index of the first vertex to draw.
FirstInstance uint32 // The ID of the first instance to draw.
}
GPUIndirectDrawCommand is a structure specifying the parameters of an indirect draw command.
type GPULoadOp ¶
type GPULoadOp uint32
GPULoadOp is a structure specifying how the contents of a texture attached to a render pass are treated at the beginning of the render pass.
const ( GPULoadOpLoad GPULoadOp = iota // Loads the data currently in the texture. Not recommended for multisample textures as it requires significant memory bandwidth. GPULoadOpClear // Clears the texture to a single color. GPULoadOpDontCare // The driver will do whatever it wants with the texture memory. This is a good option if you know that every single pixel will be touched in the render pass. )
type GPUMultisampleState ¶
type GPUMultisampleState struct {
SampleCount GPUSampleCount // The number of samples to be used in rasterization.
SampleMask uint32 // Reserved for future use. Must be set to 0.
EnableMask bool // Reserved for future use. Must be set to false.
EnableAlphaToCoverage bool // true enables the alpha-to-coverage feature.
// contains filtered or unexported fields
}
GPUMultisampleState is a structure specifying the parameters of the graphics pipeline multisample state.
type GPUPresentMode ¶
type GPUPresentMode uint32
GPUPresentMode is a structure specifying the timing that will be used to present swapchain textures to the OS.
const ( GPUPresentModeVSync GPUPresentMode = iota // Waits for vblank before presenting. No tearing is possible. If there is a pending image to present, the new image is enqueued for presentation. Disallows tearing at the cost of visual latency. GPUPresentModeImmediate // Immediately presents. Lowest latency option, but tearing may occur. GPUPresentModeMailbox // Waits for vblank before presenting. No tearing is possible. If there is a pending image to present, the pending image is replaced by the new image. Similar to VSYNC, but with reduced visual latency. )
type GPUPrimitiveType ¶
type GPUPrimitiveType uint32
GPUPrimitiveType is a structure specifying the primitive topology of a graphics pipeline.
const ( GPUPrimitiveTypeTrianglelist GPUPrimitiveType = iota // A series of separate triangles. GPUPrimitiveTypeTrianglestrip // A series of connected triangles. GPUPrimitiveTypeLinelist // A series of separate lines. GPUPrimitiveTypeLinestrip // A series of connected lines. GPUPrimitiveTypePointlist // A series of separate points. )
type GPURasterizerState ¶
type GPURasterizerState struct {
FillMode GPUFillMode // Whether polygons will be filled in or drawn as lines.
CullMode GPUCullMode // The facing direction in which triangles will be culled.
FrontFace GPUFrontFace // The vertex winding that will cause a triangle to be determined as front-facing.
DepthBiasConstantFactor float32 // A scalar factor controlling the depth value added to each fragment.
DepthBiasClamp float32 // The maximum depth bias of a fragment.
DepthBiasSlopeFactor float32 // A scalar factor applied to a fragment's slope in depth calculations.
EnableDepthBias bool // true to bias fragment depth values.
EnableDepthClip bool // true to enable depth clip, false to enable depth clamp.
// contains filtered or unexported fields
}
GPURasterizerState is a structure specifying the parameters of the graphics pipeline rasterizer state.
type GPURenderPass ¶
type GPURenderPass struct{}
GPURenderPass is an opaque handle representing a render pass.
func BeginGPURenderPass ¶
func BeginGPURenderPass(commandBuffer *GPUCommandBuffer, colorTargetInfos []GPUColorTargetInfo, depthStencilTargetInfo *GPUDepthStencilTargetInfo) *GPURenderPass
BeginGPURenderPass begins a render pass on a command buffer.
type GPURenderState ¶
type GPURenderState struct{}
GPURenderState is a custom GPU render state.
Available since SDL 3.4.0.
type GPURenderStateCreateInfo ¶
type GPURenderStateCreateInfo struct {
FragmentShader *GPUShader // The fragment shader to use when this render state is active.
NumSamplerBindings int32 // The number of additional fragment samplers to bind when this render state is active.
SamplerBindings *GPUTextureSamplerBinding // Additional fragment samplers to bind when this render state is active.
NumStorageTextures int32 // The number of storage textures to bind when this render state is active.
StorageTextures *GPUTexture // Storage textures to bind when this render state is active.
NumStorageBuffers int32 // The number of storage buffers to bind when this render state is active.
StorageBuffers *GPUBuffer // Storage buffers to bind when this render state is active.
Props PropertiesID // A properties ID for extensions. Should be 0 if no extensions are needed..
}
GPURenderStateCreateInfo is a structure specifying the parameters of a GPU render state.
Available since SDL 3.4.0.
type GPUSampleCount ¶
type GPUSampleCount uint32
GPUSampleCount is a structure specifying the sample count of a texture.
const ( GPUSampleCount1 GPUSampleCount = iota // No multisampling. GPUSampleCount2 // MSAA 2x GPUSampleCount4 // MSAA 4x GPUSampleCount8 // MSAA 8x )
type GPUSampler ¶
type GPUSampler struct{}
GPUSampler is an opaque handle representing a sampler.
func CreateGPUSampler ¶
func CreateGPUSampler(device *GPUDevice, createinfo *GPUSamplerCreateInfo) *GPUSampler
CreateGPUSampler creates a sampler object to be used when binding textures in a graphics workflow.
type GPUSamplerAddressMode ¶
type GPUSamplerAddressMode uint32
GPUSamplerAddressMode is a structure specifying behavior of texture sampling when the coordinates exceed the 0-1 range.
const ( GPUSamplerAddressModeRepeat GPUSamplerAddressMode = iota // Specifies that the coordinates will wrap around. GPUSamplerAddressModeMirroredRepeat // Specifies that the coordinates will wrap around mirrored. GPUSamplerAddressModeClampToEdge // Specifies that the coordinates will clamp to the 0-1 range. )
type GPUSamplerCreateInfo ¶
type GPUSamplerCreateInfo struct {
MinFilter GPUFilter // The minification filter to apply to lookups.
MagFilter GPUFilter // The magnification filter to apply to lookups.
MipmapMode GPUSamplerMipmapMode // The mipmap filter to apply to lookups.
AddressModeU GPUSamplerAddressMode // The addressing mode for U coordinates outside [0, 1).
AddressModeV GPUSamplerAddressMode // The addressing mode for V coordinates outside [0, 1).
AddressModeW GPUSamplerAddressMode // The addressing mode for W coordinates outside [0, 1).
MipLodBias float32 // The bias to be added to mipmap LOD calculation.
MaxAnisotropy float32 // The anisotropy value clamp used by the sampler. If enable_anisotropy is false, this is ignored.
CompareOp GPUCompareOp // The comparison operator to apply to fetched data before filtering.
MinLod float32 // Clamps the minimum of the computed LOD value.
MaxLod float32 // Clamps the maximum of the computed LOD value.
EnableAnisotropy bool // true to enable anisotropic filtering.
EnableCompare bool // true to enable comparison against a reference value during lookups.
Props PropertiesID // A properties ID for extensions. Should be 0 if no extensions are needed.
// contains filtered or unexported fields
}
GPUSamplerCreateInfo is a structure specifying the parameters of a sampler.
type GPUSamplerMipmapMode ¶
type GPUSamplerMipmapMode uint32
GPUSamplerMipmapMode is a structure specifying a mipmap mode used by a sampler.
const ( GPUSamplerMipmapModeNearest GPUSamplerMipmapMode = iota // Point filtering. GPUSamplerMipmapModeLinear // Linear filtering. )
type GPUShader ¶
type GPUShader struct{}
GPUShader is an opaque handle representing a compiled shader object.
func CreateGPUShader ¶
func CreateGPUShader(device *GPUDevice, createInfo *GPUShaderCreateInfo) *GPUShader
CreateGPUShader creates a shader to be used when creating a graphics pipeline.
type GPUShaderCreateInfo ¶
type GPUShaderCreateInfo struct {
CodeSize uint64 // The size in bytes of the code pointed to.
Code *uint8 // A pointer to shader code.
Format GPUShaderFormat // The format of the shader code.
Stage GPUShaderStage // The stage the shader program corresponds to.
NumSamplers uint32 // The number of samplers defined in the shader.
NumStorageTextures uint32 // The number of storage textures defined in the shader.
NumStorageBuffers uint32 // The number of storage buffers defined in the shader.
NumUniformBuffers uint32 // The number of uniform buffers defined in the shader.
Props PropertiesID // A properties ID for extensions. Should be 0 if no extensions are needed.
// contains filtered or unexported fields
}
GPUShaderCreateInfo is a structure specifying code and metadata for creating a shader object.
func (*GPUShaderCreateInfo) EntryPoint ¶
func (createInfo *GPUShaderCreateInfo) EntryPoint() string
func (*GPUShaderCreateInfo) SetEntryPoint ¶
func (createInfo *GPUShaderCreateInfo) SetEntryPoint(entryPoint string)
SetEntryPoint specifies the entry point function name for the shader.
type GPUShaderFormat ¶
type GPUShaderFormat uint32
GPUShaderFormat is a structure specifying the format of shader code.
const ( GPUShaderFormatInvalid GPUShaderFormat = 0 GPUShaderFormatPrivate GPUShaderFormat = 1 << 0 // Shaders for NDA'd platforms. GPUShaderFormatSPIRV GPUShaderFormat = 1 << 1 // SPIR-V shaders for Vulkan. GPUShaderFormatDXBC GPUShaderFormat = 1 << 2 // DXBC SM5_1 shaders for D3D12. GPUShaderFormatDXIL GPUShaderFormat = 1 << 3 // DXIL SM6_0 shaders for D3D12. GPUShaderFormatMSL GPUShaderFormat = 1 << 4 // MSL shaders for Metal. GPUShaderFormatMetallib GPUShaderFormat = 1 << 5 // Precompiled metallib shaders for Metal. )
func GetGPUShaderFormats ¶
func GetGPUShaderFormats(device *GPUDevice) GPUShaderFormat
GetGPUShaderFormats returns the supported shader formats for this GPU context.
type GPUShaderStage ¶
type GPUShaderStage uint32
GPUShaderStage is a structure specifying which stage a shader program corresponds to.
const ( GPUShaderStageVertex GPUShaderStage = iota GPUShaderStageFragment )
type GPUStencilOp ¶
type GPUStencilOp uint32
GPUStencilOp is a structure specifying what happens to a stored stencil value if stencil tests fail or pass.
const ( GPUStencilOpInvalid GPUStencilOp = iota GPUStencilOpKeep // Keeps the current value. GPUStencilOpZero // Sets the value to 0. GPUStencilOpReplace // Sets the value to reference. GPUStencilOpIncrementAndClamp // Increments the current value and clamps to the maximum value. GPUStencilOpDecrementAndClamp // Decrements the current value and clamps to 0. GPUStencilOpInvert // Bitwise-inverts the current value. GPUStencilOpIncrementAndWrap // Increments the current value and wraps back to 0. GPUStencilOpDecrementAndWrap // Decrements the current value and wraps to the maximum value. )
type GPUStencilOpState ¶
type GPUStencilOpState struct {
FailOp GPUStencilOp // The action performed on samples that fail the stencil test.
PassOp GPUStencilOp // The action performed on samples that pass the depth and stencil tests.
DepthFailOp GPUStencilOp // The action performed on samples that pass the stencil test and fail the depth test.
CompareOp GPUCompareOp // The comparison operator used in the stencil test.
}
GPUStencilOpState is a structure specifying the stencil operation state of a graphics pipeline.
type GPUStorageBufferReadWriteBinding ¶
type GPUStorageBufferReadWriteBinding struct {
Buffer *GPUBuffer // The buffer to bind. Must have been created with [GPUBufferUsageComputeStorageWrite].
Cycle bool // True cycles the buffer if it is already bound.
// contains filtered or unexported fields
}
GPUStorageBufferReadWriteBinding is a structure specifying parameters related to binding buffers in a compute pass.
type GPUStorageTextureReadWriteBinding ¶
type GPUStorageTextureReadWriteBinding struct {
Texture *GPUTexture // The texture to bind. Must have been created with [GPUTextureUsageComputeStorageWrite] or [GPUTextureUsageComputeStorageSimultaneousReadWrite].
MipLevel uint32 // The mip level index to bind.
Layer uint32 // The layer index to bind.
Cycle bool // True cycles the texture if it is already bound.
// contains filtered or unexported fields
}
GPUStorageTextureReadWriteBinding is a structure specifying parameters related to binding textures in a compute pass.
type GPUStoreOp ¶
type GPUStoreOp uint32
GPUStoreOp is a structure specifying how the contents of a texture attached to a render pass are treated at the end of the render pass.
const ( GPUStoreOpStore GPUStoreOp = iota // Stores the results of the render pass in the texture. Not recommended for multisample textures as it requires significant memory bandwidth. GPUStoreOpDontCare // The driver will do whatever it wants with the texture memory. This is often a good option for depth/stencil textures. GPUStoreOpResolve // Resolves a multisample texture into resolve_texture, which must have a sample count of 1. Then the driver may discard the multisample texture memory. This is the most performant method of resolving a multisample target. GPUStoreOpResolveAndStore // Resolves a multisample texture into the resolve_texture, which must have a sample count of 1. Then the driver stores the multisample texture's contents. Not recommended as it requires significant memory bandwidth. )
type GPUSwapchainComposition ¶
type GPUSwapchainComposition uint32
GPUSwapchainComposition is a structure specifying the texture format and colorspace of the swapchain textures.
const ( GPUSwapchainCompositionSDR GPUSwapchainComposition = iota // B8G8R8A8 or R8G8B8A8 swapchain. Pixel values are in sRGB encoding GPUSwapchainCompositionSDRLinear // B8G8R8A8_SRGB or R8G8B8A8_SRGB swapchain. Pixel values are stored in memory in sRGB encoding but accessed in shaders in "linear sRGB" encoding which is sRGB but with a linear transfer function. GPUSwapchainCompositionHDRExtendedLinear // R16G16B16A16_FLOAT swapchain. Pixel values are in extended linear sRGB encoding and permits values outside of the [0, 1] range. GPUSwapchainCompositionHDR10ST2084 // A2R10G10B10 or A2B10G10R10 swapchain. Pixel values are in BT.2020 ST2084 (PQ) encoding. )
type GPUTexture ¶
type GPUTexture struct{}
GPUTexture is an opaque handle representing a texture.
func CreateGPUTexture ¶
func CreateGPUTexture(device *GPUDevice, createinfo *GPUTextureCreateInfo) *GPUTexture
CreateGPUTexture creates a texture object to be used in graphics or compute workflows.
type GPUTextureCreateInfo ¶
type GPUTextureCreateInfo struct {
Type GPUTextureType // The base dimensionality of the texture.
Format GPUTextureFormat // The pixel format of the texture.
Usage GPUTextureUsageFlags // How the texture is intended to be used by the client.
Width uint32 // The width of the texture.
Height uint32 // The height of the texture.
LayerCountOrDepth uint32 // The layer count or depth of the texture. This value is treated as a layer count on 2D array textures, and as a depth value on 3D textures.
NumLevels uint32 // The number of mip levels in the texture.
SampleCount GPUSampleCount // The number of samples per texel. Only applies if the texture is used as a render target.
Props PropertiesID // A properties ID for extensions. Should be 0 if no extensions are needed.
}
GPUTextureCreateInfo is a structure specifying the parameters of a texture.
type GPUTextureFormat ¶
type GPUTextureFormat uint32
GPUTextureFormat is a structure specifying the pixel format of a texture.
const ( GPUTextureFormatInvalid GPUTextureFormat = iota // Unsigned Normalized Float Color Formats GPUTextureFormatA8Unorm GPUTextureFormatR8Unorm GPUTextureFormatR8G8Unorm GPUTextureFormatR8G8B8A8Unorm GPUTextureFormatR16Unorm GPUTextureFormatR16G16Unorm GPUTextureFormatR16G16B16A16Unorm GPUTextureFormatR10G10B10A2Unorm GPUTextureFormatB5G6R5Unorm GPUTextureFormatB5G5R5A1Unorm GPUTextureFormatB4G4R4A4Unorm GPUTextureFormatB8G8R8A8Unorm // Compressed Unsigned Normalized Float Color Formats GPUTextureFormatBC1RGBAUnorm GPUTextureFormatBC2RGBAUnorm GPUTextureFormatBC3RGBAUnorm GPUTextureFormatBC4RUnorm GPUTextureFormatBC5RGUnorm GPUTextureFormatBC7RGBAUnorm // Compressed Signed Float Color Formats GPUTextureFormatBC6HRGBFloat // Compressed Unsigned Float Color Formats GPUTextureFormatBC6HRGBUfloat // Signed Normalized Float Color Formats GPUTextureFormatR8Snorm GPUTextureFormatR8G8Snorm GPUTextureFormatR8G8B8A8Snorm GPUTextureFormatR16Snorm GPUTextureFormatR16G16Snorm GPUTextureFormatR16G16B16A16Snorm // Signed Float Color Formats GPUTextureFormatR16Float GPUTextureFormatR16G16Float GPUTextureFormatR16G16B16A16Float GPUTextureFormatR32Float GPUTextureFormatR32G32Float GPUTextureFormatR32G32B32A32Float // Unsigned Float Color Formats GPUTextureFormatR11G11B10Ufloat // Unsigned Integer Color Formats GPUTextureFormatR8Uint GPUTextureFormatR8G8Uint GPUTextureFormatR8G8B8A8Uint GPUTextureFormatR16Uint GPUTextureFormatR16G16Uint GPUTextureFormatR16G16B16A16Uint GPUTextureFormatR32Uint GPUTextureFormatR32G32Uint GPUTextureFormatR32G32B32A32Uint // Signed Integer Color Formats GPUTextureFormatR8Int GPUTextureFormatR8G8Int GPUTextureFormatR8G8B8A8Int GPUTextureFormatR16Int GPUTextureFormatR16G16Int GPUTextureFormatR16G16B16A16Int GPUTextureFormatR32Int GPUTextureFormatR32G32Int GPUTextureFormatR32G32B32A32Int // SRGB Unsigned Normalized Color Formats GPUTextureFormatR8G8B8A8UnormSRGB GPUTextureFormatB8G8R8A8UnormSRGB // Compressed SRGB Unsigned Normalized Color Formats GPUTextureFormatBC1RGBAUnormSRGB GPUTextureFormatBC2RGBAUnormSRGB GPUTextureFormatBC3RGBAUnormSRGB GPUTextureFormatBC7RGBAUnormSRGB // Depth Formats GPUTextureFormatD16Unorm GPUTextureFormatD24Unorm GPUTextureFormatD32Float GPUTextureFormatD24UnormS8Uint GPUTextureFormatD32FloatS8Uint // Compressed ASTC Normalized Float Color Formats GPUTextureFormatAstc4x4Unorm GPUTextureFormatAstc5x4Unorm GPUTextureFormatAstc5x5Unorm GPUTextureFormatAstc6x5Unorm GPUTextureFormatAstc6x6Unorm GPUTextureFormatAstc8x5Unorm GPUTextureFormatAstc8x6Unorm GPUTextureFormatAstc8x8Unorm GPUTextureFormatAstc10x5Unorm GPUTextureFormatAstc10x6Unorm GPUTextureFormatAstc10x8Unorm GPUTextureFormatAstc10x10Unorm GPUTextureFormatAstc12x10Unorm GPUTextureFormatAstc12x12Unorm // Compressed SRGB ASTC Normalized Float Color Formats GPUTextureFormatAstc4x4UnormSRGB GPUTextureFormatAstc5x4UnormSRGB GPUTextureFormatAstc5x5UnormSRGB GPUTextureFormatAstc6x5UnormSRGB GPUTextureFormatAstc6x6UnormSRGB GPUTextureFormatAstc8x5UnormSRGB GPUTextureFormatAstc8x6UnormSRGB GPUTextureFormatAstc8x8UnormSRGB GPUTextureFormatAstc10x5UnormSRGB GPUTextureFormatAstc10x6UnormSRGB GPUTextureFormatAstc10x8UnormSRGB GPUTextureFormatAstc10x10UnormSRGB GPUTextureFormatAstc12x10UnormSRGB GPUTextureFormatAstc12x12UnormSRGB // Compressed ASTC Signed Float Color Formats GPUTextureFormatAstc4x4Float GPUTextureFormatAstc5x4Float GPUTextureFormatAstc5x5Float GPUTextureFormatAstc6x5Float GPUTextureFormatAstc6x6Float GPUTextureFormatAstc8x5Float GPUTextureFormatAstc8x6Float GPUTextureFormatAstc8x8Float GPUTextureFormatAstc10x5Float GPUTextureFormatAstc10x6Float GPUTextureFormatAstc10x8Float GPUTextureFormatAstc10x10Float GPUTextureFormatAstc12x10Float GPUTextureFormatAstc12x12Float )
func GetGPUSwapchainTextureFormat ¶
func GetGPUSwapchainTextureFormat(device *GPUDevice, window *Window) GPUTextureFormat
GetGPUSwapchainTextureFormat obtains the texture format of the swapchain for the given window.
func GetGPUTextureFormatFromPixelFormat ¶
func GetGPUTextureFormatFromPixelFormat(format PixelFormat) GPUTextureFormat
GetGPUTextureFormatFromPixelFormat gets the GPU texture format corresponding to an SDL pixel format.
Available since SDL 3.4.0.
type GPUTextureLocation ¶
type GPUTextureLocation struct {
Texture *GPUTexture // The texture used in the copy operation.
MipLevel uint32 // The mip level index of the location.
Layer uint32 // The layer index of the location.
X uint32 // The left offset of the location.
Y uint32 // The top offset of the location.
Z uint32 // The front offset of the location.
}
GPUTextureLocation is a structure specifying a location in a texture.
type GPUTextureRegion ¶
type GPUTextureRegion struct {
Texture *GPUTexture // The texture used in the copy operation.
MipLevel uint32 // The mip level index to transfer.
Layer uint32 // The layer index to transfer.
X uint32 // The left offset of the region.
Y uint32 // The top offset of the region.
Z uint32 // The front offset of the region.
W uint32 // The width of the region.
H uint32 // The height of the region.
D uint32 // The depth of the region.
}
GPUTextureRegion is a structure specifying a region of a texture.
type GPUTextureSamplerBinding ¶
type GPUTextureSamplerBinding struct {
Texture *GPUTexture // The texture to bind. Must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.
Sampler *GPUSampler // The sampler to bind.
}
GPUTextureSamplerBinding is a structure specifying parameters in a sampler binding call.
type GPUTextureTransferInfo ¶
type GPUTextureTransferInfo struct {
TransferBuffer *GPUTransferBuffer // The transfer buffer used in the transfer operation.
Offset uint32 // The starting byte of the image data in the transfer buffer.
PixelsPerRow uint32 // The number of pixels from one row to the next.
RowsPerLayer uint32 // The number of rows from one layer/depth-slice to the next.
}
GPUTextureTransferInfo is a structure specifying parameters related to transferring data to or from a texture.
type GPUTextureType ¶
type GPUTextureType uint32
GPUTextureType is a structure specifying the type of a texture.
const ( GPUTextureType2D GPUTextureType = iota // The texture is a 2-dimensional image. GPUTextureType2DArray // The texture is a 2-dimensional array image. GPUTextureType3D // The texture is a 3-dimensional image. GPUTextureTypeCube // The texture is a cube image. GPUTextureTypeCubeArray // The texture is a cube array image. )
type GPUTextureUsageFlags ¶
type GPUTextureUsageFlags uint32
GPUTextureUsageFlags is a structure specifing how a texture is intended to be used by the client.
const ( GPUTextureUsageSampler GPUTextureUsageFlags = 1 << 0 // Texture supports sampling. GPUTextureUsageColorTarget GPUTextureUsageFlags = 1 << 1 // Texture is a color render target. GPUTextureUsageDepthStencilTarget GPUTextureUsageFlags = 1 << 2 // Texture is a depth stencil target. GPUTextureUsageGraphicsStorageRead GPUTextureUsageFlags = 1 << 3 // Texture supports storage reads in graphics stages. GPUTextureUsageComputeStorageRead GPUTextureUsageFlags = 1 << 4 // Texture supports storage reads in the compute stage. GPUTextureUsageComputeStorageWrite GPUTextureUsageFlags = 1 << 5 // Texture supports storage writes in the compute stage. GPUTextureUsageComputeStorageSimultaneousReadWrite GPUTextureUsageFlags = 1 << 6 // Texture supports reads and writes in the same compute shader. This is NOT equivalent to READ | WRITE. )
type GPUTransferBuffer ¶
type GPUTransferBuffer struct{}
GPUTransferBuffer is an opaque handle representing a transfer buffer.
func CreateGPUTransferBuffer ¶
func CreateGPUTransferBuffer(device *GPUDevice, createinfo *GPUTransferBufferCreateInfo) *GPUTransferBuffer
CreateGPUTransferBuffer creates a transfer buffer to be used when uploading to or downloading from graphics resources.
type GPUTransferBufferCreateInfo ¶
type GPUTransferBufferCreateInfo struct {
Usage GPUTransferBufferUsage // How the transfer buffer is intended to be used by the client.
Size uint32 // The size in bytes of the transfer buffer.
Props PropertiesID // A properties ID for extensions. Should be 0 if no extensions are needed.
}
GPUTransferBufferCreateInfo is a structure specifying the parameters of a transfer buffer.
type GPUTransferBufferLocation ¶
type GPUTransferBufferLocation struct {
TransferBuffer *GPUTransferBuffer // The transfer buffer used in the transfer operation.
Offset uint32 // The starting byte of the buffer data in the transfer buffer.
}
GPUTransferBufferLocation is a structure specifying a location in a transfer buffer.
type GPUTransferBufferUsage ¶
type GPUTransferBufferUsage uint32
GPUTransferBufferUsage is a structure specifying how a transfer buffer is intended to be used by the client.
const ( GPUTransferBufferUsageUpload GPUTransferBufferUsage = iota GPUTransferBufferUsageDownload )
type GPUVertexAttribute ¶
type GPUVertexAttribute struct {
Location uint32 // The shader input location index.
BufferSlot uint32 // The binding slot of the associated vertex buffer.
Format GPUVertexElementFormat // The size and type of the attribute data.
Offset uint32 // The byte offset of this attribute relative to the start of the vertex element.
}
GPUVertexAttribute is a structure specifying a vertex attribute.
type GPUVertexBufferDescription ¶
type GPUVertexBufferDescription struct {
Slot uint32 // The binding slot of the vertex buffer.
Pitch uint32 // The size of a single element + the offset between elements.
InputRate GPUVertexInputRate // Whether attribute addressing is a function of the vertex index or instance index.
InstanceStepRate uint32 // Reserved for future use. Must be set to 0.
}
GPUVertexBufferDescription is a structure specifying the parameters of vertex buffers used in a graphics pipeline.
type GPUVertexElementFormat ¶
type GPUVertexElementFormat uint32
GPUVertexElementFormat is a structure specifying the format of a vertex attribute.
const ( GPUVertexElementFormatInvalid GPUVertexElementFormat = iota // 32-bit Signed Integers GPUVertexElementFormatInt GPUVertexElementFormatInt2 GPUVertexElementFormatInt3 GPUVertexElementFormatInt4 // 32-bit Unsigned Integers GPUVertexElementFormatUint GPUVertexElementFormatUint2 GPUVertexElementFormatUint3 GPUVertexElementFormatUint4 // 32-bit Floats GPUVertexElementFormatFloat GPUVertexElementFormatFloat2 GPUVertexElementFormatFloat3 GPUVertexElementFormatFloat4 // 8-bit Signed Integers GPUVertexElementFormatByte2 GPUVertexElementFormatByte4 // 8-bit Unsigned Integers GPUVertexElementFormatUbyte2 GPUVertexElementFormatUbyte4 // 8-bit Signed Normalized GPUVertexElementFormatByte2Norm GPUVertexElementFormatByte4Norm // 8-bit Unsigned Normalized GPUVertexElementFormatUbyte2Norm GPUVertexElementFormatUbyte4Norm // 16-bit Signed Integers GPUVertexElementFormatShort2 GPUVertexElementFormatShort4 // 16-bit Unsigned Integers GPUVertexElementFormatUshort2 GPUVertexElementFormatUshort4 // 16-bit Signed Normalized GPUVertexElementFormatShort2Norm GPUVertexElementFormatShort4Norm // 16-bit Unsigned Normalized GPUVertexElementFormatUshort2Norm GPUVertexElementFormatUshort4Norm // 16-bit Floats GPUVertexElementFormatHalf2 GPUVertexElementFormatHalf4 )
type GPUVertexInputRate ¶
type GPUVertexInputRate uint32
GPUVertexInputRate is a structure specifying the rate at which vertex attributes are pulled from buffers.
const ( GPUVertexInputRateVertex GPUVertexInputRate = iota // Attribute addressing is a function of the vertex index. GPUVertexInputRateInstance // Attribute addressing is a function of the instance index. )
type GPUVertexInputState ¶
type GPUVertexInputState struct {
VertexBufferDescriptions *GPUVertexBufferDescription // A pointer to an array of vertex buffer descriptions.
NumVertexBuffers uint32 // The number of vertex buffer descriptions in the above array.
VertexAttributes *GPUVertexAttribute // A pointer to an array of vertex attribute descriptions.
NumVertexAttributes uint32 // The number of vertex attribute descriptions in the above array.
}
GPUVertexInputState is a structure specifying the parameters of a graphics pipeline vertex input state.
type GPUViewport ¶
type GPUViewport struct {
X float32 // The left offset of the viewport.
Y float32 // The top offset of the viewport.
W float32 // The width of the viewport.
H float32 // The height of the viewport.
MinDepth float32 // The minimum depth of the viewport.
MaxDepth float32 // The maximum depth of the viewport.
}
GPUViewport is a structure specifying a viewport.
type GPUVulkanOptions ¶
type GPUVulkanOptions struct {
VulkanApiVersion uint32 // The Vulkan API version to request for the instance. Use Vulkan's VK_MAKE_VERSION or VK_MAKE_API_VERSION.
FeatureList uintptr // Pointer to the first element of a chain of Vulkan feature structs. (Requires API version 1.1 or higher.)
Vulkan10PhysicalDeviceFeatures uintptr // Pointer to a VkPhysicalDeviceFeatures struct to enable additional Vulkan 1.0 features.
DeviceExtensionCount uint32 // Number of additional device extensions to require.
DeviceExtensionNames **byte // Pointer to a list of additional device extensions to require.
InstanceExtensionCount uint32 // Number of additional instance extensions to require.
InstanceExtensionNames **byte // Pointer to a list of additional instance extensions to require.
}
GPUVulkanOptions is a structure specifying additional options when using Vulkan.
Available since SDL 3.4.0.
type Gamepad ¶
type Gamepad struct{}
Gamepad is a structure specifying the structure used to identify an SDL gamepad.
func GetGamepadFromID ¶
func GetGamepadFromID(instanceId JoystickID) *Gamepad
GetGamepadFromID gets the Gamepad associated with a joystick instance ID, if it has been opened.
func OpenGamepad ¶
func OpenGamepad(instanceId JoystickID) *Gamepad
OpenGamepad opens a gamepad for use.
type GamepadAxis ¶
type GamepadAxis int32
GamepadAxis is a structure specifying the list of axes available on a gamepad.
const ( GamepadAxisInvalid GamepadAxis = iota - 1 GamepadAxisLeftX GamepadAxisLeftY GamepadAxisRightX GamepadAxisRightY GamepadAxisLeftTrigger GamepadAxisRightTrigger GamepadAxisCount )
type GamepadAxisEvent ¶
type GamepadAxisEvent struct {
CommonEvent
Which JoystickID // The joystick instance id.
Axis uint8 // The gamepad axis ([GamepadAxis]).
Value int16 // The axis value (range: -32768 to 32767).
// contains filtered or unexported fields
}
GamepadAxisEvent defines the gamepad axis motion event structure (event.gaxis.*).
type GamepadBinding ¶
type GamepadBinding struct {
InputType GamepadBindingType
OutputType GamepadBindingType
// contains filtered or unexported fields
}
GamepadBinding is a mapping between one joystick input to a gamepad control.
func GetGamepadBindings ¶
func GetGamepadBindings(gamepad *Gamepad) []*GamepadBinding
GetGamepadBindings returns the SDL joystick layer bindings for a gamepad or nil on failure.
The returned slice must not be freed with e.g. Free.
func (*GamepadBinding) InputAxis ¶
func (g *GamepadBinding) InputAxis() struct{ Axis, AxisMin, AxisMax int32 }
func (*GamepadBinding) InputButton ¶
func (g *GamepadBinding) InputButton() int32
func (*GamepadBinding) InputHat ¶
func (g *GamepadBinding) InputHat() struct{ Hat, HatMask int32 }
func (*GamepadBinding) OutputAxis ¶
func (g *GamepadBinding) OutputAxis() struct { Axis GamepadAxis AxisMin, AxisMax int32 }
func (*GamepadBinding) OutputButton ¶
func (g *GamepadBinding) OutputButton() GamepadButton
type GamepadBindingType ¶
type GamepadBindingType uint32
GamepadBindingType defines the types of gamepad control bindings.
const ( GamepadBindTypeNone GamepadBindingType = iota GamepadBindTypeButton GamepadBindTypeAxis GamepadBindTypeHat )
type GamepadButton ¶
type GamepadButton int32
GamepadButton is a structure specifying the list of buttons available on a gamepad.
const ( GamepadButtonInvalid GamepadButton = iota - 1 GamepadButtonSouth // Bottom face button (e.g. Xbox A button). GamepadButtonEast // Right face button (e.g. Xbox B button). GamepadButtonWest // Left face button (e.g. Xbox X button). GamepadButtonNorth // Top face button (e.g. Xbox Y button). GamepadButtonBack GamepadButtonGuide GamepadButtonStart GamepadButtonLeftStick GamepadButtonRightStick GamepadButtonLeftShoulder GamepadButtonRightShoulder GamepadButtonDpadUp GamepadButtonDpadDown GamepadButtonDpadLeft GamepadButtonDpadRight GamepadButtonMisc1 // Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button, Google Stadia capture button). GamepadButtonRightPaddle1 // Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button). GamepadButtonLeftPaddle1 // Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button). GamepadButtonRightPaddle2 // Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button). GamepadButtonLeftPaddle2 // Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button). GamepadButtonTouchpad // PS4/PS5 touchpad button. GamepadButtonMisc2 // Additional button. GamepadButtonMisc3 // Additional button (e.g. Nintendo GameCube left trigger click). GamepadButtonMisc4 // Additional button (e.g. Nintendo GameCube right trigger click). GamepadButtonMisc5 // Additional button. GamepadButtonMisc6 // Additional button. GamepadButtonCount )
type GamepadButtonEvent ¶
type GamepadButtonEvent struct {
CommonEvent
Which JoystickID // The joystick instance id.
Button uint8 // The gamepad button ([GamepadButton]).
Down bool // true if the button is pressed.
// contains filtered or unexported fields
}
GamepadButtonEvent defines the gamepad button event structure (event.gbutton.*).
type GamepadButtonLabel ¶
type GamepadButtonLabel uint32
GamepadButtonLabel is a structure specifying the set of gamepad button labels.
const ( GamepadButtonLabelUnknown GamepadButtonLabel = iota GamepadButtonLabelA GamepadButtonLabelB GamepadButtonLabelX GamepadButtonLabelY GamepadButtonLabelCross GamepadButtonLabelCircle GamepadButtonLabelSquare GamepadButtonLabelTriangle )
type GamepadDeviceEvent ¶
type GamepadDeviceEvent struct {
CommonEvent
Which JoystickID // The joystick instance id.
}
GamepadDeviceEvent defines the gamepad device event structure (event.gdevice.*).
type GamepadSensorEvent ¶
type GamepadSensorEvent struct {
CommonEvent
Which JoystickID // The joystick instance id.
Sensor int32 // The type of the sensor, one of the values of [SensorType].
Data [3]float32 // Up to 3 values from the sensor, as defined in SDL_sensor.h.
SensorTimestamp uint64 // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock.
}
GamepadSensorEvent defines the gamepad sensor event structure (event.gsensor.*).
type GamepadTouchpadEvent ¶
type GamepadTouchpadEvent struct {
CommonEvent
Which JoystickID // The joystick instance id.
Touchpad int32 // The index of the touchpad.
Finger int32 // The index of the finger on the touchpad.
X float32 // Normalized in the range 0...1 with 0 being on the left.
Y float32 // Normalized in the range 0...1 with 0 being at the top.
Pressure float32 // Normalized in the range 0...1.
}
GamepadTouchpadEvent defines the gamepad touchpad event structure (event.gtouchpad.*).
type GamepadType ¶
type GamepadType uint32
GamepadType defines the standard gamepad types.
const ( GamepadTypeUnknown GamepadType = iota GamepadTypeStandard GamepadTypeXbox360 GamepadTypeXboxOne GamepadTypePS3 GamepadTypePS4 GamepadTypePS5 GamepadTypeNintendoSwitchPro GamepadTypeNintendoSwitchJoyConLeft GamepadTypeNintendoSwitchJoyConRight GamepadTypeNintendoSwitchJoyConPair GamepadTypeGamecube GamepadTypeCount )
func GetGamepadType ¶
func GetGamepadType(gamepad *Gamepad) GamepadType
GetGamepadType gets the type of an opened gamepad.
type GlobFlags ¶
type GlobFlags uint32
GlobFlags defines flags for path matching.
const GlobCaseinsensitive GlobFlags = 1 << 0
type HapticCondition ¶
type HapticCondition struct {
Type HapticEffectType // [HapticSpring], [HapticDamper], [HapticInertia] or [HapticFriction].
Direction HapticDirection // Direction of the effect.
Length uint32 // Duration of the effect.
Delay uint16 // Delay before starting the effect.
Button uint16 // Button that triggers the effect.
Interval uint16 // How soon it can be triggered again after button.
RightSat [3]uint16 // Level when joystick is to the positive side; max 0xFFFF.
LeftSat [3]uint16 // Level when joystick is to the negative side; max 0xFFFF.
RightCoeff [3]int16 // How fast to increase the force towards the positive side.
LeftCoeff [3]int16 // How fast to increase the force towards the negative side.
Deadband [3]uint16 // Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered.
Center [3]int16 // Position of the dead zone.
}
HapticCondition is a structure containing a template for a Condition effect.
type HapticConstant ¶
type HapticConstant struct {
Type HapticEffectType // [HapticConstant_].
Direction HapticDirection // Direction of the effect.
Length uint32 // Duration of the effect.
Delay uint16 // Delay before starting the effect.
Button uint16 // Button that triggers the effect.
Interval uint16 // How soon it can be triggered again after button.
Level int16 // Strength of the constant effect.
AttackLength uint16 // Duration of the attack.
AttackLevel uint16 // Level at the start of the attack.
FadeLength uint16 // Duration of the fade.
FadeLevel uint16 // Level at the end of the fade.
}
HapticConstant is a structure containing a template for a Constant effect.
type HapticCustom ¶
type HapticCustom struct {
Type HapticEffectType // [HapticCustom_].
Direction HapticDirection // Direction of the effect.
Length uint32 // Duration of the effect.
Delay uint16 // Delay before starting the effect.
Button uint16 // Button that triggers the effect.
Interval uint16 // How soon it can be triggered again after button.
Channels uint8 // Axes to use, minimum of one.
Period uint16 // Sample periods.
Samples uint16 // Amount of samples.
Data *uint16 // Should contain channels*samples items.
AttackLength uint16 // Duration of the attack.
AttackLevel uint16 // Level at the start of the attack.
FadeLength uint16 // Duration of the fade.
FadeLevel uint16 // Level at the end of the fade.
}
HapticCustom is a structure containing a template for the SDL_HAPTIC_CUSTOM effect.
type HapticDirection ¶
type HapticDirection struct {
Type HapticDirectionType // The type of encoding.
Dir [3]int32 // The encoded direction.
}
HapticDirection is a structure that represents a haptic direction.
type HapticDirectionType ¶
type HapticDirectionType uint8
HapticDirectionType describes type of coordinates used for haptic direction.
const ( HapticPolar HapticDirectionType = 0 // Uses polar coordinates for the direction. HapticCartesian HapticDirectionType = 1 // Uses cartesian coordinates for the direction. HapticSpherical HapticDirectionType = 2 // Uses spherical coordinates for the direction. HapticSteeringAxis HapticDirectionType = 3 // Use this value to play an effect on the steering wheel axis. )
type HapticEffect ¶
type HapticEffect struct {
Type HapticEffectType // Effect type.
Constant HapticConstant // Constant effect.
Periodic HapticPeriodic // Periodic effect.
Condition HapticCondition // Condition effect.
Ramp HapticRamp // Ramp effect.
Leftright HapticLeftRight // Left/Right effect.
Custom HapticCustom // Custom effect.
}
HapticEffect is a structure describing generic template for any haptic effect.
type HapticEffectType ¶
type HapticEffectType uint16
HapticEffectType describes type of haptic effect.
type HapticID ¶
type HapticID uint32
HapticID is a unique ID for a haptic device for the time it is connected to the system, and is never reused for the lifetime of the application.
type HapticLeftRight ¶
type HapticLeftRight struct {
Type HapticEffectType // [HapticLeftRight].
Length uint32 // Duration of the effect in milliseconds.
LargeMagnitude uint16 // Control of the large controller motor.
SmallMagnitude uint16 // Control of the small controller motor.
}
HapticLeftRight is a structure containing a template for a Left/Right effect.
type HapticPeriodic ¶
type HapticPeriodic struct {
Type HapticEffectType // [HapticSine], [HapticSquare], [HapticTriangle], [HapticSawtoothup] or [HapticSawtoothdown].
Direction HapticDirection // Direction of the effect.
Length uint32 // Duration of the effect.
Delay uint16 // Delay before starting the effect.
Button uint16 // Button that triggers the effect.
Interval uint16 // How soon it can be triggered again after button.
Period uint16 // Period of the wave.
Magnitude int16 // Peak value; if negative, equivalent to 180 degrees extra phase shift.
Offset int16 // Mean value of the wave.
Phase uint16 // Positive phase shift given by hundredth of a degree.
AttackLength uint16 // Duration of the attack.
AttackLevel uint16 // Level at the start of the attack.
FadeLength uint16 // Duration of the fade.
FadeLevel uint16 // Level at the end of the fade.
}
HapticPeriodic is a structure containing a template for a Periodic effect.
type HapticRamp ¶
type HapticRamp struct {
Type HapticEffectType // [HapticRamp_].
Direction HapticDirection // Direction of the effect.
Length uint32 // Duration of the effect.
Delay uint16 // Delay before starting the effect.
Button uint16 // Button that triggers the effect.
Interval uint16 // How soon it can be triggered again after button.
Start int16 // Beginning strength level.
End int16 // Ending strength level.
AttackLength uint16 // Duration of the attack.
AttackLevel uint16 // Level at the start of the attack.
FadeLength uint16 // Duration of the fade.
FadeLevel uint16 // Level at the end of the fade.
}
HapticRamp is a structure containing a template for a Ramp effect.
type HidBusType ¶
type HidBusType uint32
HidBusType defines HID underlying bus types.
const ( HidApiBusUnknown HidBusType = iota // Unknown bus type. HidApiBusUSB // USB bus. Specifications: https://usb.org/hid. HidApiBusBluetooth // Bluetooth or Bluetooth LE bus. Specifications: https://www.bluetooth.com/specifications/specs/human-interface-device-profile-1-1-1/, https://www.bluetooth.com/specifications/specs/hid-service-1-0/, https://www.bluetooth.com/specifications/specs/hid-over-gatt-profile-1-0/. HidApiBusI2C // I2C bus. Specifications: https://docs.microsoft.com/previous-versions/windows/hardware/design/dn642101(v=vs.85). HidApiBusSPI // SPI bus. Specifications: https://www.microsoft.com/download/details.aspx?id=103325. )
type HidDevice ¶
type HidDevice struct{}
HidDevice is an opaque handle representing an open HID device.
type HidDeviceInfo ¶
type HidDeviceInfo struct {
Path *byte // Platform-specific device path.
VendorId uint16 // Device Vendor ID.
ProductId uint16 // Device Product ID.
SerialNumber *byte // Serial Number.
ReleaseNumber uint16 // Device Release Number in binary-coded decimal, also known as Device Version Number.
ManufacturerString *byte // Manufacturer.
ProductString *byte // Product.
UsagePage uint16 // Usage Page for this Device/Interface (Windows/Mac/hidraw only).
Usage uint16 // Usage for this Device/Interface (Windows/Mac/hidraw only).
InterfaceNumber int32 // The USB interface which this logical device represents. Valid only if the device is a USB HID device. Set to -1 in all other cases.
InterfaceClass int32 // Additional information about the USB interface. Valid on libusb and Android implementations.
InterfaceSubclass int32
InterfaceProtocol int32
BusType HidBusType // Underlying bus type.
Next *HidDeviceInfo // Pointer to the next device.
}
HidDeviceInfo describes information about a connected HID device
type HintCallback ¶
type HintCallback uintptr
HintCallback is a callback used to send notifications of hint value changes.
func NewHintCallback ¶
func NewHintCallback(callback func(userdata unsafe.Pointer, name, oldValue, newValue string)) HintCallback
type HintPriority ¶
type HintPriority uint32
HintPriority is an enumeration of hint priorities.
const ( HintDefault HintPriority = iota HintNormal HintOverride )
type HitTest ¶
type HitTest func(window *Window, point *Point, data unsafe.Pointer) HitTestResult
HitTest callback used for hit-testing.
type HitTestResult ¶
type HitTestResult uint32
HitTestResult possible return values from the HitTest callback.
const ( HitTestNormal HitTestResult = iota // Region is normal. No special properties. HitTestDraggable // Region can drag entire window. HitTestResizeTopLeft // Region is the resizable top-left corner border. HitTestResizeTop // Region is the resizable top border. HitTestResizeTopRight // Region is the resizable top-right corner border. HitTestResizeRight // Region is the resizable right border. HitTestResizeBottomRight // Region is the resizable bottom-right corner border. HitTestResizeBottom // Region is the resizable bottom border. HitTestResizeBottomLeft // Region is the resizable bottom-left corner border. HitTestResizeLeft // Region is the resizable left border. )
type IOStatus ¶
type IOStatus uint32
IOStatus defines the IOStream status, set by a read or write operation.
const ( IOStatusReady IOStatus = iota // Everything is ready (no errors and not EOF). IOStatusError // Read or write I/O error. IOStatusEof // End of file. IOStatusNotReady // Non blocking I/O, not ready. IOStatusReadOnly // Tried to write a read-only buffer. IOStatusWriteOnly // Tried to read a write-only buffer. )
type IOStream ¶
type IOStream struct{}
IOStream is a structure specifying the read/write operation structures.
func IOFromConstMem ¶
IOFromConstMem returns a read-only memory buffer for use with IOStream or nil on failure.
func IOFromFile ¶
IOFromFile returns an IOStream for the named file. The mode can be "r" for read-only.
type IOStreamInterface ¶
type IOStreamInterface struct {
Version uint32
Size *func(userdata uintptr) int64
Seek *func(userdata uintptr, offset int64, whence IOWhence) int64
Read *func(userdata, ptr, size uintptr, status *IOStatus) uintptr
Write *func(userdata, ptr, size uintptr, status *IOStatus) uintptr
Flush *func(userdata uintptr, status *IOStatus) bool
Close *func(userdata uintptr) bool
}
IOStreamInterface defines the function pointers that drive an IOStream.
type IOWhence ¶
type IOWhence uint32
IOWhence defines the possible whence values for IOStream seeking.
type InitFlags ¶
type InitFlags uint32
InitFlags defines the initialization flags for Init and/or InitSubSystem.
const ( InitAudio InitFlags = 0x00000010 // [INIT_AUDIO] implies [INIT_EVENTS]. InitVideo InitFlags = 0x00000020 // [INIT_VIDEO] implies [INIT_EVENTS], should be initialized on the main thread. InitJoystick InitFlags = 0x00000200 // [INIT_JOYSTICK] implies [INIT_EVENTS]. InitHaptic InitFlags = 0x00001000 InitGamepad InitFlags = 0x00002000 // [INIT_GAMEPAD] implies [INIT_JOYSTICK]. InitEvents InitFlags = 0x00004000 InitSensor InitFlags = 0x00008000 // [INIT_SENSOR] implies [INIT_EVENTS]. InitCamera InitFlags = 0x00010000 // [INIT_CAMERA] implies [INIT_EVENTS]. )
type InitStatus ¶
type InitStatus uint32
InitStatus is a structure specifying the current status of an InitState structures.
const ( InitStatusUninitialized InitStatus = iota InitStatusInitializing InitStatusInitialized InitStatusUninitializing )
type JoyAxisEvent ¶
type JoyAxisEvent struct {
CommonEvent
Which JoystickID // The joystick instance id.
Axis uint8 // The joystick axis index.
Value int16 // The axis value (range: -32768 to 32767).
// contains filtered or unexported fields
}
JoyAxisEvent defines the joystick axis motion event structure (event.jaxis.*).
type JoyBallEvent ¶
type JoyBallEvent struct {
CommonEvent
Which JoystickID // The joystick instance id.
Ball uint8 // The joystick trackball index.
Xrel int16 // The relative motion in the X direction.
Yrel int16 // The relative motion in the Y direction.
// contains filtered or unexported fields
}
JoyBallEvent defines the joystick trackball motion event structure (event.jball.*).
type JoyBatteryEvent ¶
type JoyBatteryEvent struct {
CommonEvent
Which JoystickID // The joystick instance id.
State PowerState // The joystick battery state.
Percent int32 // The joystick battery percent charge remaining.
}
JoyBatteryEvent defines the joystick battery level change event structure (event.jbattery.*).
type JoyButtonEvent ¶
type JoyButtonEvent struct {
CommonEvent
Which JoystickID // The joystick instance id.
Button uint8 // The joystick button index.
Down bool // True if the button is pressed.
// contains filtered or unexported fields
}
JoyButtonEvent defines the joystick button event structure (event.jbutton.*).
type JoyDeviceEvent ¶
type JoyDeviceEvent struct {
CommonEvent
Which JoystickID // The joystick instance id.
}
JoyDeviceEvent defines the joystick device event structure (event.jdevice.*).
type JoyHatEvent ¶
type JoyHatEvent struct {
CommonEvent
Which JoystickID // The joystick instance id.
Hat uint8 // The joystick hat index.
// The hat position value.
// * [HAT_LEFTUP] [HAT_UP] [HAT_RIGHTUP]
// * [HAT_LEFT] [HAT_CENTERED] [HAT_RIGHT]
// * [HAT_LEFTDOWN] [HAT_DOWN] [HAT_RIGHTDOWN]
//
// * Note that zero means the POV is centered.
Value uint8
// contains filtered or unexported fields
}
JoyHatEvent defines the joystick hat position change event structure (event.jhat.*).
type Joystick ¶
type Joystick struct{}
Joystick is a structure specifying the joystick structure used to identify an SDL joysticks.
func GetJoystickFromID ¶
func GetJoystickFromID(instanceId JoystickID) *Joystick
GetJoystickFromID gets the Joystick associated with an instance ID, if it has been opened.
func GetJoystickFromPlayerIndex ¶
GetJoystickFromPlayerIndex gets the Joystick associated with a player index.
func OpenJoystick ¶
func OpenJoystick(instanceId JoystickID) *Joystick
OpenJoystick opens a joystick for use.
type JoystickConnectionState ¶
type JoystickConnectionState int32
JoystickConnectionState defines the possible connection states for a joystick device.
const ( JoystickConnectionInvalid JoystickConnectionState = iota - 1 JoystickConnectionUnknown JoystickConnectionWired JoystickConnectionWireless )
func GetJoystickConnectionState ¶
func GetJoystickConnectionState(joystick *Joystick) JoystickConnectionState
GetJoystickConnectionState gets the connection state of a joystick.
type JoystickID ¶
type JoystickID uint32
JoystickID is a unique ID for a joystick for the time it is connected to the system, and is never reused for the lifetime of the application.
func GetGamepads ¶
func GetGamepads() []JoystickID
GetGamepads returns a list of currently connected gamepads or nil on failure.
The returned slice must not be freed with e.g. Free.
func GetJoystickID ¶
func GetJoystickID(joystick *Joystick) JoystickID
GetJoystickID gets the instance ID of an opened joystick.
func GetJoysticks ¶
func GetJoysticks() []JoystickID
GetJoysticks gets a list of currently connected joysticks.
type JoystickType ¶
type JoystickType uint16
JoystickType is an enum of some common joystick types.
const ( JoystickTypeUnknown JoystickType = iota JoystickTypeGamepad JoystickTypeWheel JoystickTypeArcadeStick JoystickTypeFlightStick JoystickTypeDancePad JoystickTypeGuitar JoystickTypeDrumKit JoystickTypeArcadePad JoystickTypeThrottle JoystickTypeCount )
func GetJoystickType ¶
func GetJoystickType(joystick *Joystick) JoystickType
GetJoystickType gets the type of an opened joystick.
func GetJoystickTypeForID ¶
func GetJoystickTypeForID(instanceId JoystickID) JoystickType
GetJoystickTypeForID gets the type of a joystick, if available.
type KeyboardDeviceEvent ¶
type KeyboardDeviceEvent struct {
CommonEvent
Which KeyboardID // The keyboard instance id.
}
KeyboardDeviceEvent defines the keyboard device event structure (event.kdevice.*).
type KeyboardEvent ¶
type KeyboardEvent struct {
CommonEvent
WindowID WindowID // The window with keyboard focus, if any.
Which KeyboardID // The keyboard instance id, or 0 if unknown or virtual.
Scancode Scancode // SDL physical key code.
Key Keycode // SDL virtual key code.
Mod Keymod // Current key modifiers.
Raw uint16 // The platform dependent scancode for this event.
Down bool // True if the key is pressed.
Repeat bool // True if this is a key repeat.
}
KeyboardEvent defines the keyboard button event structure (event.key.*).
type KeyboardID ¶
type KeyboardID uint32
KeyboardID is a unique ID for a keyboard for the time it is connected to the system, and is never reused for the lifetime of the application.
func GetKeyboards ¶
func GetKeyboards() []KeyboardID
GetKeyboards gets a list of currently connected keyboards.
type Keycode ¶
type Keycode uint32
Keycode is a structure specifying the SDL virtual key representations.
const ( KeycodeScancodeMask Keycode = 0x40000000 KeycodeUnknown Keycode = 0x00000000 // 0. KeycodeReturn Keycode = 0x0000000d // '\r'. KeycodeEscape Keycode = 0x0000001b // '\x1B'. KeycodeBackspace Keycode = 0x00000008 // '\b'. KeycodeTab Keycode = 0x00000009 // '\t'. KeycodeSpace Keycode = 0x00000020 // ' '. KeycodeExclaim Keycode = 0x00000021 // '!'. KeycodeDblApostrophe Keycode = 0x00000022 // '"'. KeycodeHash Keycode = 0x00000023 // '#'. KeycodeDollar Keycode = 0x00000024 // '$'. KeycodePercent Keycode = 0x00000025 // '%'. KeycodeAmpersand Keycode = 0x00000026 // '&'. KeycodeApostrophe Keycode = 0x00000027 // '\”. KeycodeLeftParen Keycode = 0x00000028 // '('. KeycodeRightParen Keycode = 0x00000029 // ')'. KeycodeAsterisk Keycode = 0x0000002a // '*'. KeycodePlus Keycode = 0x0000002b // '+'. KeycodeComma Keycode = 0x0000002c // ','. KeycodeMinus Keycode = 0x0000002d // '-'. KeycodePeriod Keycode = 0x0000002e // '.'. KeycodeSlash Keycode = 0x0000002f // '/'. Keycode0 Keycode = 0x00000030 // '0'. Keycode1 Keycode = 0x00000031 // '1'. Keycode2 Keycode = 0x00000032 // '2'. Keycode3 Keycode = 0x00000033 // '3'. Keycode4 Keycode = 0x00000034 // '4'. Keycode5 Keycode = 0x00000035 // '5'. Keycode6 Keycode = 0x00000036 // '6'. Keycode7 Keycode = 0x00000037 // '7'. Keycode8 Keycode = 0x00000038 // '8'. Keycode9 Keycode = 0x00000039 // '9'. KeycodeColon Keycode = 0x0000003a // ':'. KeycodeSemicolon Keycode = 0x0000003b // ';'. KeycodeLess Keycode = 0x0000003c // '<'. KeycodeEquals Keycode = 0x0000003d // '='. KeycodeGreater Keycode = 0x0000003e // '>'. KeycodeQuestion Keycode = 0x0000003f // '?'. KeycodeAt Keycode = 0x00000040 // '@'. KeycodeLeftBracket Keycode = 0x0000005b // '['. KeycodeBackslash Keycode = 0x0000005c // '\'. KeycodeRightBracket Keycode = 0x0000005d // ']'. KeycodeCaret Keycode = 0x0000005e // '^'. KeycodeUnderscore Keycode = 0x0000005f // '_'. KeycodeGrave Keycode = 0x00000060 // '`'. KeycodeA Keycode = 0x00000061 // 'a'. KeycodeB Keycode = 0x00000062 // 'b'. KeycodeC Keycode = 0x00000063 // 'c'. KeycodeD Keycode = 0x00000064 // 'd'. KeycodeE Keycode = 0x00000065 // 'e'. KeycodeF Keycode = 0x00000066 // 'f'. KeycodeG Keycode = 0x00000067 // 'g'. KeycodeH Keycode = 0x00000068 // 'h'. KeycodeI Keycode = 0x00000069 // 'i'. KeycodeJ Keycode = 0x0000006a // 'j'. KeycodeK Keycode = 0x0000006b // 'k'. KeycodeL Keycode = 0x0000006c // 'l'. KeycodeM Keycode = 0x0000006d // 'm'. KeycodeN Keycode = 0x0000006e // 'n'. KeycodeO Keycode = 0x0000006f // 'o'. KeycodeP Keycode = 0x00000070 // 'p'. KeycodeQ Keycode = 0x00000071 // 'q'. KeycodeR Keycode = 0x00000072 // 'r'. KeycodeS Keycode = 0x00000073 // 's'. KeycodeT Keycode = 0x00000074 // 't'. KeycodeU Keycode = 0x00000075 // 'u'. KeycodeV Keycode = 0x00000076 // 'v'. KeycodeW Keycode = 0x00000077 // 'w'. KeycodeX Keycode = 0x00000078 // 'x'. KeycodeY Keycode = 0x00000079 // 'y'. KeycodeZ Keycode = 0x0000007a // 'z'. KeycodeLeftBrace Keycode = 0x0000007b // '{'. KeycodePipe Keycode = 0x0000007c // '|'. KeycodeRightBrace Keycode = 0x0000007d // '}'. KeycodeTilde Keycode = 0x0000007e // '~'. KeycodeDelete Keycode = 0x0000007f // '\x7F'. KeycodePlusMinus Keycode = 0x000000b1 // '\xB1'. KeycodeCapsLock Keycode = 0x40000039 KeycodeF1 Keycode = 0x4000003a KeycodeF2 Keycode = 0x4000003b KeycodeF3 Keycode = 0x4000003c KeycodeF4 Keycode = 0x4000003d KeycodeF5 Keycode = 0x4000003e KeycodeF6 Keycode = 0x4000003f KeycodeF7 Keycode = 0x40000040 KeycodeF8 Keycode = 0x40000041 KeycodeF9 Keycode = 0x40000042 KeycodeF10 Keycode = 0x40000043 KeycodeF11 Keycode = 0x40000044 KeycodeF12 Keycode = 0x40000045 KeycodePrintScreen Keycode = 0x40000046 KeycodeScrollLock Keycode = 0x40000047 KeycodePause Keycode = 0x40000048 KeycodeInsert Keycode = 0x40000049 KeycodeHome Keycode = 0x4000004a KeycodePageUp Keycode = 0x4000004b KeycodeEnd Keycode = 0x4000004d KeycodePageDown Keycode = 0x4000004e KeycodeRight Keycode = 0x4000004f KeycodeLeft Keycode = 0x40000050 KeycodeDown Keycode = 0x40000051 KeycodeUp Keycode = 0x40000052 KeycodeNumLockClear Keycode = 0x40000053 KeycodeKpDivide Keycode = 0x40000054 KeycodeKpMultiply Keycode = 0x40000055 KeycodeKpMinus Keycode = 0x40000056 KeycodeKpPlus Keycode = 0x40000057 KeycodeKpEnter Keycode = 0x40000058 KeycodeKp1 Keycode = 0x40000059 KeycodeKp2 Keycode = 0x4000005a KeycodeKp3 Keycode = 0x4000005b KeycodeKp4 Keycode = 0x4000005c KeycodeKp5 Keycode = 0x4000005d KeycodeKp6 Keycode = 0x4000005e KeycodeKp7 Keycode = 0x4000005f KeycodeKp8 Keycode = 0x40000060 KeycodeKp9 Keycode = 0x40000061 KeycodeKp0 Keycode = 0x40000062 KeycodeKpPeriod Keycode = 0x40000063 KeycodeApplication Keycode = 0x40000065 KeycodePower Keycode = 0x40000066 KeycodeKpEquals Keycode = 0x40000067 KeycodeF13 Keycode = 0x40000068 KeycodeF14 Keycode = 0x40000069 KeycodeF15 Keycode = 0x4000006a KeycodeF16 Keycode = 0x4000006b KeycodeF17 Keycode = 0x4000006c KeycodeF18 Keycode = 0x4000006d KeycodeF19 Keycode = 0x4000006e KeycodeF20 Keycode = 0x4000006f KeycodeF21 Keycode = 0x40000070 KeycodeF22 Keycode = 0x40000071 KeycodeF23 Keycode = 0x40000072 KeycodeF24 Keycode = 0x40000073 KeycodeExecute Keycode = 0x40000074 KeycodeHelp Keycode = 0x40000075 KeycodeMenu Keycode = 0x40000076 KeycodeSelect Keycode = 0x40000077 KeycodeStop Keycode = 0x40000078 KeycodeAgain Keycode = 0x40000079 KeycodeUndo Keycode = 0x4000007a KeycodeCut Keycode = 0x4000007b KeycodeCopy Keycode = 0x4000007c KeycodePaste Keycode = 0x4000007d KeycodeFind Keycode = 0x4000007e KeycodeMute Keycode = 0x4000007f KeycodeVolumeUp Keycode = 0x40000080 KeycodeVolumeDown Keycode = 0x40000081 KeycodeKpComma Keycode = 0x40000085 KeycodeKpEqualsAs400 Keycode = 0x40000086 KeycodeAltErase Keycode = 0x40000099 KeycodeSysReq Keycode = 0x4000009a KeycodeCancel Keycode = 0x4000009b KeycodeClear Keycode = 0x4000009c KeycodePrior Keycode = 0x4000009d KeycodeReturn2 Keycode = 0x4000009e KeycodeSeparator Keycode = 0x4000009f KeycodeOut Keycode = 0x400000a0 KeycodeOper Keycode = 0x400000a1 KeycodeClearAgain Keycode = 0x400000a2 KeycodeCrSel Keycode = 0x400000a3 KeycodeExSel Keycode = 0x400000a4 KeycodeKp00 Keycode = 0x400000b0 KeycodeKp000 Keycode = 0x400000b1 KeycodeThousandsSeparator Keycode = 0x400000b2 KeycodeDecimalSeparator Keycode = 0x400000b3 KeycodeCurrencyUnit Keycode = 0x400000b4 KeycodeCurrencySubunit Keycode = 0x400000b5 KeycodeKpLeftParen Keycode = 0x400000b6 KeycodeKpRightParen Keycode = 0x400000b7 KeycodeKpLeftBrace Keycode = 0x400000b8 KeycodeKpRightBrace Keycode = 0x400000b9 KeycodeKpTab Keycode = 0x400000ba KeycodeKpBackspace Keycode = 0x400000bb KeycodeKpA Keycode = 0x400000bc KeycodeKpB Keycode = 0x400000bd KeycodeKpC Keycode = 0x400000be KeycodeKpD Keycode = 0x400000bf KeycodeKpE Keycode = 0x400000c0 KeycodeKpF Keycode = 0x400000c1 KeycodeKpXor Keycode = 0x400000c2 KeycodeKpPower Keycode = 0x400000c3 KeycodeKpPercent Keycode = 0x400000c4 KeycodeKpLess Keycode = 0x400000c5 KeycodeKpGreater Keycode = 0x400000c6 KeycodeKpAmpersand Keycode = 0x400000c7 KeycodeKpDblAmpersand Keycode = 0x400000c8 KeycodeKpVerticalBar Keycode = 0x400000c9 KeycodeKpDblVerticalBar Keycode = 0x400000ca KeycodeKpColon Keycode = 0x400000cb KeycodeKpHash Keycode = 0x400000cc KeycodeKpSpace Keycode = 0x400000cd KeycodeKpAt Keycode = 0x400000ce KeycodeKpExclam Keycode = 0x400000cf KeycodeKpMemStore Keycode = 0x400000d0 KeycodeKpMemRecall Keycode = 0x400000d1 KeycodeKpMemClear Keycode = 0x400000d2 KeycodeKpMemAdd Keycode = 0x400000d3 KeycodeKpMemSubtract Keycode = 0x400000d4 KeycodeKpMemMultiply Keycode = 0x400000d5 KeycodeKpMemDivide Keycode = 0x400000d6 KeycodeKpPlusMinus Keycode = 0x400000d7 KeycodeKpClear Keycode = 0x400000d8 KeycodeKpClearEntry Keycode = 0x400000d9 KeycodeKpBinary Keycode = 0x400000da KeycodeKpOctal Keycode = 0x400000db KeycodeKpDecimal Keycode = 0x400000dc KeycodeKpHexadecimal Keycode = 0x400000dd KeycodeLCtrl Keycode = 0x400000e0 KeycodeLShift Keycode = 0x400000e1 KeycodeLAlt Keycode = 0x400000e2 KeycodeLGui Keycode = 0x400000e3 KeycodeRCtrl Keycode = 0x400000e4 KeycodeRShift Keycode = 0x400000e5 KeycodeRAlt Keycode = 0x400000e6 KeycodeRGui Keycode = 0x400000e7 KeycodeMode Keycode = 0x40000101 KeycodeSleep Keycode = 0x40000102 KeycodeWake Keycode = 0x40000103 KeycodeChannelIncrement Keycode = 0x40000104 KeycodeChannelDecrement Keycode = 0x40000105 KeycodeMediaPlay Keycode = 0x40000106 KeycodeMediaPause Keycode = 0x40000107 KeycodeMediaRecord Keycode = 0x40000108 KeycodeMediaFastForward Keycode = 0x40000109 KeycodeMediaRewind Keycode = 0x4000010a KeycodeMediaNextTrack Keycode = 0x4000010b KeycodeMediaPreviousTrack Keycode = 0x4000010c KeycodeMediaStop Keycode = 0x4000010d KeycodeMediaEject Keycode = 0x4000010e KeycodeMediaPlayPause Keycode = 0x4000010f KeycodeMediaSelect Keycode = 0x40000110 KeycodeAcNew Keycode = 0x40000111 KeycodeAcOpen Keycode = 0x40000112 KeycodeAcClose Keycode = 0x40000113 KeycodeAcExit Keycode = 0x40000114 KeycodeAcSave Keycode = 0x40000115 KeycodeAcPrint Keycode = 0x40000116 KeycodeAcProperties Keycode = 0x40000117 KeycodeAcSearch Keycode = 0x40000118 KeycodeAcHome Keycode = 0x40000119 KeycodeAcBack Keycode = 0x4000011a KeycodeAcForward Keycode = 0x4000011b KeycodeAcStop Keycode = 0x4000011c KeycodeAcRefresh Keycode = 0x4000011d KeycodeAcBookmarks Keycode = 0x4000011e KeycodeSoftLeft Keycode = 0x4000011f KeycodeSoftRight Keycode = 0x40000120 KeycodeCall Keycode = 0x40000121 KeycodeEndCall Keycode = 0x40000122 KeycodeLeftTab Keycode = 0x20000001 // Extended key Left Tab. KeycodeLevel5Shift Keycode = 0x20000002 // Extended key Level 5 Shift. KeycodeMultiKeyCompose Keycode = 0x20000003 // Extended key Multi-key Compose. KeycodeLMeta Keycode = 0x20000004 // Extended key Left Meta. KeycodeRMeta Keycode = 0x20000005 // Extended key Right Meta. KeycodeLHyper Keycode = 0x20000006 // Extended key Left Hyper. KeycodeRHyper Keycode = 0x20000007 // Extended key Right Hyper. )
func GetKeyFromName ¶
GetKeyFromName gets a key code from a human-readable name.
func GetKeyFromScancode ¶
GetKeyFromScancode gets the key code corresponding to the given scancode according to the current keyboard layout.
type Keymod ¶
type Keymod uint16
Keymod defines the valid key modifiers (possibly OR'd together).
const ( KeymodNone Keymod = 0x0000 // No modifier is applicable. KeymodLShift Keymod = 0x0001 // The left Shift key is down. KeymodRShift Keymod = 0x0002 // The right Shift key is down. KeymodLevel5 Keymod = 0x0004 // The Level 5 Shift key is down. KeymodLCtrl Keymod = 0x0040 // The left Ctrl (Control) key is down. KeymodRCtrl Keymod = 0x0080 // The right Ctrl (Control) key is down. KeymodLAlt Keymod = 0x0100 // The left Alt key is down. KeymodRAlt Keymod = 0x0200 // The right Alt key is down. KeymodLGui Keymod = 0x0400 // The left GUI key (often the Windows key) is down. KeymodRGui Keymod = 0x0800 // The right GUI key (often the Windows key) is down. KeymodNum Keymod = 0x1000 // The Num Lock key (may be located on an extended keypad) is down. KeymodCaps Keymod = 0x2000 // The Caps Lock key is down. KeymodMode Keymod = 0x4000 // The !AltGr key is down. KeymodScroll Keymod = 0x8000 // The Scroll Lock key is down. KeymodCtrl Keymod = KeymodLCtrl | KeymodRCtrl // Any Ctrl key is down. KeymodShift Keymod = KeymodLShift | KeymodRShift // Any Shift key is down. KeymodAlt Keymod = KeymodLAlt | KeymodRAlt // Any Alt key is down. KeymodGui Keymod = KeymodLGui | KeymodRGui // Any GUI key is down. )
func GetModState ¶
func GetModState() Keymod
GetModState returns an OR'd combination of the modifier keys for the keyboard.
type Locale ¶
type Locale struct {
Language string // A language name, like "en" for English.
Country string // A country, like "US" for America. Can be NULL.
}
Locale is a struct to provide locale data.
func GetPreferredLocales ¶
func GetPreferredLocales() []*Locale
GetPreferredLocales reports the user's preferred locale.
type LogCategory ¶
type LogCategory uint32
LogCategory is a structure specifying the predefined log categories.
const ( LogCategoryApplication LogCategory = iota LogCategoryError LogCategoryAssert LogCategorySystem LogCategoryAudio LogCategoryVideo LogCategoryRender LogCategoryInput LogCategoryTest LogCategoryGPU LogCategoryReserved2 LogCategoryReserved3 LogCategoryReserved4 LogCategoryReserved5 LogCategoryReserved6 LogCategoryReserved7 LogCategoryReserved8 LogCategoryReserved9 LogCategoryReserved10 LogCategoryCustom )
type LogOutputFunction ¶
type LogOutputFunction uintptr
func NewLogOutputFunctionCallback ¶
func NewLogOutputFunctionCallback(callback func(userdata unsafe.Pointer, category LogCategory, priority LogPriority, message string)) LogOutputFunction
type LogPriority ¶
type LogPriority uint32
LogPriority is a structure specifying the predefined log priorities.
const ( LogPriorityInvalid LogPriority = iota LogPriorityTrace LogPriorityVerbose LogPriorityDebug LogPriorityInfo LogPriorityWarn LogPriorityError LogPriorityCritical LogPriorityCount )
type MatrixCoefficients ¶
type MatrixCoefficients uint32
MatrixCoefficients defines the colorspace matrix coefficients.
const ( MatrixCoefficientsIdentity MatrixCoefficients = 0 MatrixCoefficientsBT709 MatrixCoefficients = 1 // ITU-R BT.709-6. MatrixCoefficientsUnspecified MatrixCoefficients = 2 MatrixCoefficientsFCC MatrixCoefficients = 4 // US FCC Title 47. MatrixCoefficientsBT470BG MatrixCoefficients = 5 // ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as SDL_MATRIX_COEFFICIENTS_BT601. MatrixCoefficientsBT601 MatrixCoefficients = 6 // ITU-R BT.601-7 525. MatrixCoefficientsSMPTE240 MatrixCoefficients = 7 // SMPTE 240M. MatrixCoefficientsYCGCO MatrixCoefficients = 8 MatrixCoefficientsBT2020NCL MatrixCoefficients = 9 // ITU-R BT.2020-2 non-constant luminance. MatrixCoefficientsBT2020CL MatrixCoefficients = 10 // ITU-R BT.2020-2 constant luminance. MatrixCoefficientsSMPTE2085 MatrixCoefficients = 11 // SMPTE ST 2085. MatrixCoefficientsChromaDerivedNCL MatrixCoefficients = 12 MatrixCoefficientsChromaDerivedCL MatrixCoefficients = 13 MatrixCoefficientsICTCP MatrixCoefficients = 14 // ITU-R BT.2100-0 ICTCP. MatrixCoefficientsCustom MatrixCoefficients = 31 )
type MessageBoxButtonData ¶
type MessageBoxButtonData struct {
Flags MessageBoxButtonFlags
ButtonID int32 // User defined button id (value returned via [ShowMessageBox]).
// contains filtered or unexported fields
}
MessageBoxButtonData defines the individual button data.
func (*MessageBoxButtonData) SetText ¶
func (m *MessageBoxButtonData) SetText(s string)
SetText sets the text of a button.
func (*MessageBoxButtonData) Text ¶
func (m *MessageBoxButtonData) Text() string
Text gets the UTF-8 button text.
type MessageBoxButtonFlags ¶
type MessageBoxButtonFlags uint32
MessageBoxButtonFlags defines the MessageBoxButtonData flags.
const ( MessageBoxButtonReturnKeyDefault MessageBoxButtonFlags = 0x00000001 MessageBoxButtonEscapeKeyDefault MessageBoxButtonFlags = 0x00000002 )
type MessageBoxColor ¶
type MessageBoxColor struct {
R, G, B uint8
}
MessageBoxColor defines the rgb value used in a message box color scheme.
type MessageBoxColorScheme ¶
type MessageBoxColorScheme struct {
Colors [MessageBoxColorCount]MessageBoxColor
}
MessageBoxColorScheme is a set of colors to use for message box dialogs.
type MessageBoxColorType ¶
type MessageBoxColorType uint32
MessageBoxColorType is an enumeration of indices inside the colors array of MessageBoxColorScheme.
const ( MessageBoxColorBackground MessageBoxColorType = iota MessageBoxColorText MessageBoxColorButtonBorder MessageBoxColorButtonBackground MessageBoxColorButtonSelected MessageBoxColorCount )
type MessageBoxData ¶
type MessageBoxData struct {
Flags MessageBoxFlags
Window *Window // Parent window, can be nil.
ColorScheme *MessageBoxColorScheme // [MessageBoxColorScheme], can be nil to use system settings.
// contains filtered or unexported fields
}
MessageBoxData defines the messagebox structure containing title, text, window, etc.
func (*MessageBoxData) Buttons ¶
func (m *MessageBoxData) Buttons() []MessageBoxButtonData
Buttons gets MessageBox buttons.
func (*MessageBoxData) Message ¶
func (m *MessageBoxData) Message() string
Message gets the UTF-8 message text.
func (*MessageBoxData) SetButtons ¶
func (m *MessageBoxData) SetButtons(buttons ...MessageBoxButtonData)
SetButtons sets MessageBox buttons.
func (*MessageBoxData) SetMessage ¶
func (m *MessageBoxData) SetMessage(s string)
SetMessage sets the message text of a MessageBox.
func (*MessageBoxData) SetTitle ¶
func (m *MessageBoxData) SetTitle(s string)
SetTitle sets the title of a MessageBox.
type MessageBoxFlags ¶
type MessageBoxFlags uint32
MessageBoxFlags defines the message box flags.
const ( MessageBoxError MessageBoxFlags = 0x00000010 // Error dialog. MessageBoxWarning MessageBoxFlags = 0x00000020 // Warning dialog. MessageBoxInformation MessageBoxFlags = 0x00000040 // Informational dialog. MessageBoxButtonsLeftToRight MessageBoxFlags = 0x00000080 // Buttons placed left to right. MessageBoxButtonsRightToLeft MessageBoxFlags = 0x00000100 // Buttons placed right to left. )
type MouseButtonEvent ¶
type MouseButtonEvent struct {
CommonEvent
WindowID WindowID // The window with mouse focus, if any.
Which MouseID // The mouse instance id in relative mode, [TOUCH_MOUSEID] for touch events, or 0.
Button uint8 // The mouse button index.
Down bool // True if the button is pressed.
Clicks uint8 // 1 for single-click, 2 for double-click, etc.
X float32 // X coordinate, relative to window.
Y float32 // Y coordinate, relative to window.
// contains filtered or unexported fields
}
MouseButtonEvent defines the mouse button event structure (event.button.*).
type MouseButtonFlags ¶
type MouseButtonFlags uint32
MouseButtonFlags is a bitmask of pressed mouse buttons, as reported by GetMouseState, etc.
const ( ButtonLeft MouseButtonFlags = iota + 1 ButtonMiddle ButtonRight ButtonX1 ButtonX2 ButtonLMask MouseButtonFlags = 1 << (ButtonLeft - 1) ButtonMMask MouseButtonFlags = 1 << (ButtonMiddle - 1) ButtonRMask MouseButtonFlags = 1 << (ButtonRight - 1) ButtonX1Mask MouseButtonFlags = 1 << (ButtonX1 - 1) ButtonX2Mask MouseButtonFlags = 1 << (ButtonX2 - 1) )
func GetGlobalMouseState ¶
func GetGlobalMouseState(x *float32, y *float32) MouseButtonFlags
GetGlobalMouseState queries the platform for the asynchronous mouse button state and the desktop-relative platform-cursor position.
func GetMouseState ¶
func GetMouseState(x *float32, y *float32) MouseButtonFlags
GetMouseState queries SDL's cache for the synchronous mouse button state and the window-relative SDL-cursor position.
func GetRelativeMouseState ¶
func GetRelativeMouseState(x *float32, y *float32) MouseButtonFlags
GetRelativeMouseState queries SDL's cache for the synchronous mouse button state and accumulated mouse delta since last call.
type MouseDeviceEvent ¶
type MouseDeviceEvent struct {
CommonEvent
Which MouseID // The mouse instance id.
}
MouseDeviceEvent defines the mouse device event structure (event.mdevice.*).
type MouseID ¶
type MouseID uint32
MouseID is a unique ID for a mouse for the time it is connected to the system, and is never reused for the lifetime of the application.
type MouseMotionEvent ¶
type MouseMotionEvent struct {
CommonEvent
WindowID WindowID // The window with mouse focus, if any.
Which MouseID // The mouse instance id in relative mode, [TOUCH_MOUSEID] for touch events, or 0.
State MouseButtonFlags // The current button state.
X float32 // X coordinate, relative to window.
Y float32 // Y coordinate, relative to window.
Xrel float32 // The relative motion in the X direction.
Yrel float32 // The relative motion in the Y direction.
}
MouseMotionEvent defines the mouse motion event structure (event.motion.*).
type MouseMotionTransformCallback ¶
type MouseMotionTransformCallback uintptr
MouseMotionTransformCallback is a callback used to transform mouse motion delta from raw values.
Available since SDL 3.4.0.
type MouseWheelDirection ¶
type MouseWheelDirection uint32
MouseWheelDirection defines the scroll direction types for the Scroll event.
const ( MouseWheelNormal MouseWheelDirection = iota // The scroll direction is normal. MouseWheelFlipped // The scroll direction is flipped / natural. )
type MouseWheelEvent ¶
type MouseWheelEvent struct {
CommonEvent
WindowID WindowID // The window with mouse focus, if any.
Which MouseID // The mouse instance id in relative mode or 0.
X float32 // The amount scrolled horizontally, positive to the right and negative to the left.
Y float32 // The amount scrolled vertically, positive away from the user and negative toward the user.
Direction MouseWheelDirection // Set to one of the [MOUSEWHEEL_*] defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back.
MouseX float32 // X coordinate, relative to window
MouseY float32 // Y coordinate, relative to window
IntegerX int32 // The amount scrolled horizontally, accumulated to whole scroll "ticks" (added in 3.2.12).
IntegerY int32 // The amount scrolled vertically, accumulated to whole scroll "ticks" (added in 3.2.12).
}
MouseWheelEvent defines the mouse wheel event structure (event.wheel.*).
type Mutex ¶
type Mutex struct{}
Mutex defines a means to serialize access to a resource between threads.
type NSTimerCallback ¶
type NSTimerCallback uintptr
NSTimerCallback is a function prototype for the nanosecond timer callback function.
type PackedLayout ¶
type PackedLayout uint32
PackedLayout defines the packed component layout.
const ( PackedLayoutNone PackedLayout = iota PackedLayout332 PackedLayout4444 PackedLayout1555 PackedLayout5551 PackedLayout565 PackedLayout8888 PackedLayout2101010 PackedLayout1010102 )
type PackedOrder ¶
type PackedOrder uint32
PackedOrder defines the packed component order, high bit -> low bit.
const ( PackedOrderNone PackedOrder = iota PackedOrderXRGB PackedOrderRGBX PackedOrderARGB PackedOrderRGBA PackedOrderXBGR PackedOrderBGRX PackedOrderABGR PackedOrderBGRA )
type Palette ¶
type Palette struct {
// contains filtered or unexported fields
}
Palette is a set of indexed colors representing a palette.
func CreatePalette ¶
CreatePalette creates a palette structure with the specified number of color entries.
func CreateSurfacePalette ¶
CreateSurfacePalette creates a palette and associate it with a surface.
func GetSurfacePalette ¶
GetSurfacePalette gets the palette used by a surface.
func GetTexturePalette ¶
GetTexturePalette gets the palette used by a texture.
Available since SDL 3.4.0.
type PathInfo ¶
type PathInfo struct {
Type PathType // The path type.
Size uint64 // The file size in bytes.
CreateTime Time // The time when the path was created.
ModifyTime Time // The last time the path was modified.
AccessTime Time // The last time the path was read.
}
PathInfo defines the information about a path on the filesystem.
type PenAxis ¶
type PenAxis uint32
PenAxis defines the pen axis indices.
const ( PenAxisPressure PenAxis = iota // Pen pressure. Unidirectional: 0 to 1.0. PenAxisXTilt // Pen horizontal tilt angle. Bidirectional: -90.0 to 90.0 (left-to-right). PenAxisYTilt // Pen vertical tilt angle. Bidirectional: -90.0 to 90.0 (top-to-down). PenAxisDistance // Pen distance to drawing surface. Unidirectional: 0.0 to 1.0. PenAxisRotation // Pen barrel rotation. Bidirectional: -180 to 179.9 (clockwise, 0 is facing up, -180.0 is facing down). PenAxisSlider // Pen finger wheel or slider (e.g., Airbrush Pen). Unidirectional: 0 to 1.0. PenAxisTangentialPressure // Pressure from squeezing the pen ("barrel pressure"). PenAxisCount // Total known pen axis types in this version of SDL. This number may grow in future releases!. )
type PenAxisEvent ¶
type PenAxisEvent struct {
CommonEvent
WindowID WindowID // The window with pen focus, if any.
Which PenID // The pen instance id.
PenState PenInputFlags // Complete pen input state at time of event.
X float32 // X coordinate, relative to window.
Y float32 // Y coordinate, relative to window.
Axis PenAxis // Axis that has changed.
Value float32 // New value of axis.
}
PenAxisEvent defines the pressure-sensitive pen pressure / angle event structure (event.paxis.*).
type PenButtonEvent ¶
type PenButtonEvent struct {
CommonEvent
WindowID WindowID // The window with mouse focus, if any.
Which PenID // The pen instance id.
PenState PenInputFlags // Complete pen input state at time of event.
X float32 // X coordinate, relative to window.
Y float32 // Y coordinate, relative to window.
Button uint8 // The pen button index (first button is 1).
Down bool // True if the button is pressed.
}
PenButtonEvent defines the pressure-sensitive pen button event structure (event.pbutton.*).
type PenDeviceType ¶
type PenDeviceType int32
PenDeviceType describes the type of a pen device.
Available since SDL 3.4.0.
const ( PenDeviceTypeInvalid PenDeviceType = iota - 1 // Not a valid pen device. PenDeviceTypeUnknown // Don't know specifics of this pen. PenDeviceTypeDirect // Pen touches display. PenDeviceTypeIndirect // Pen touches something that isn't the display. )
type PenInputFlags ¶
type PenInputFlags uint32
PenInputFlags defines the pen input flags, as reported by various pen events' pen_state field.
const ( PenInputDown PenInputFlags = 1 << iota // Pen is pressed down. PenInputButton1 // Button 1 is pressed. PenInputButton2 // Button 2 is pressed. PenInputButton3 // Button 3 is pressed. PenInputButton4 // Button 4 is pressed. PenInputButton5 // Button 5 is pressed. PenInputEraserTip PenInputFlags = 1 << 30 // Eraser tip is used. )
type PenMotionEvent ¶
type PenMotionEvent struct {
CommonEvent
WindowID WindowID // The window with pen focus, if any.
Which PenID // The pen instance id.
PenState PenInputFlags // Complete pen input state at time of event.
X float32 // X coordinate, relative to window.
Y float32 // Y coordinate, relative to window.
}
PenMotionEvent defines the pressure-sensitive pen motion event structure (event.pmotion.*).
type PenProximityEvent ¶
type PenProximityEvent struct {
CommonEvent
WindowID WindowID // The window with pen focus, if any.
Which PenID // The pen instance id.
}
PenProximityEvent defines the pressure-sensitive pen proximity event structure (event.pproximity.*).
type PenTouchEvent ¶
type PenTouchEvent struct {
CommonEvent
WindowID WindowID // The window with pen focus, if any.
Which PenID // The pen instance id.
PenState PenInputFlags // Complete pen input state at time of event.
X float32 // X coordinate, relative to window.
Y float32 // Y coordinate, relative to window.
Eraser bool // True if eraser end is used (not all pens support this).
Down bool // True if the pen is touching or false if the pen is lifted off.
}
PenTouchEvent defines the pressure-sensitive pen touched event structure (event.ptouch.*).
type PinchFingerEvent ¶
type PinchFingerEvent struct {
CommonEvent
Scale float32 // The scale change since the last [EventPinchUpdate]. Scale < 1 is "zoom out". Scale > 1 is "zoom in".
WindowID WindowID // The window underneath the finger, if any.
}
PinchFingerEvent defines the pinch finger event structure (event.pinch.*).
type PixelFormat ¶
type PixelFormat uint32
PixelFormat defines the pixel format.
const ( PixelFormatUnknown PixelFormat = 0 PixelFormatIndex1LSB PixelFormat = 0x11100100 PixelFormatIndex1MSB PixelFormat = 0x11200100 PixelFormatIndex2LSB PixelFormat = 0x1C100200 PixelFormatIndex2MSB PixelFormat = 0x1C200200 PixelFormatIndex4LSB PixelFormat = 0x12100400 PixelFormatIndex4MSB PixelFormat = 0x12200400 PixelFormatIndex8 PixelFormat = 0x13000801 PixelFormatRGB332 PixelFormat = 0x14110801 PixelFormatXRGB4444 PixelFormat = 0x15120C02 PixelFormatXBGR4444 PixelFormat = 0x15520C02 PixelFormatXRGB1555 PixelFormat = 0x15130F02 PixelFormatXBGR1555 PixelFormat = 0x15530F02 PixelFormatARGB4444 PixelFormat = 0x15321002 PixelFormatRGBA4444 PixelFormat = 0x15421002 PixelFormatABGR4444 PixelFormat = 0x15721002 PixelFormatBGRA4444 PixelFormat = 0x15821002 PixelFormatARGB1555 PixelFormat = 0x15331002 PixelFormatRGBA5551 PixelFormat = 0x15441002 PixelFormatABGR1555 PixelFormat = 0x15731002 PixelFormatBGRA5551 PixelFormat = 0x15841002 PixelFormatRGB565 PixelFormat = 0x15151002 PixelFormatBGR565 PixelFormat = 0x15551002 PixelFormatRGB24 PixelFormat = 0x17101803 PixelFormatBGR24 PixelFormat = 0x17401803 PixelFormatXRGB8888 PixelFormat = 0x16161804 PixelFormatRGBX8888 PixelFormat = 0x16261804 PixelFormatXBGR8888 PixelFormat = 0x16561804 PixelFormatBGRX8888 PixelFormat = 0x16661804 PixelFormatARGB8888 PixelFormat = 0x16362004 PixelFormatRGBA8888 PixelFormat = 0x16462004 PixelFormatABGR8888 PixelFormat = 0x16762004 PixelFormatBGRA8888 PixelFormat = 0x16862004 PixelFormatXRGB2101010 PixelFormat = 0x16172004 PixelFormatXBGR2101010 PixelFormat = 0x16572004 PixelFormatARGB2101010 PixelFormat = 0x16372004 PixelFormatABGR2101010 PixelFormat = 0x16772004 PixelFormatRGB48 PixelFormat = 0x18103006 PixelFormatBGR48 PixelFormat = 0x18403006 PixelFormatRGBA64 PixelFormat = 0x18204008 PixelFormatARGB64 PixelFormat = 0x18304008 PixelFormatBGRA64 PixelFormat = 0x18504008 PixelFormatABGR64 PixelFormat = 0x18604008 PixelFormatRGB48Float PixelFormat = 0x1A103006 PixelFormatBGR48Float PixelFormat = 0x1A403006 PixelFormatRGBA64Float PixelFormat = 0x1A204008 PixelFormatARGB64Float PixelFormat = 0x1A304008 PixelFormatBGRA64Float PixelFormat = 0x1A504008 PixelFormatABGR64Float PixelFormat = 0x1A604008 PixelFormatRGB96Float PixelFormat = 0x1B10600C PixelFormatBGR96Float PixelFormat = 0x1B40600C PixelFormatRGBA128Float PixelFormat = 0x1B208010 PixelFormatARGB128Float PixelFormat = 0x1B308010 PixelFormatBGRA128Float PixelFormat = 0x1B508010 PixelFormatABGR128Float PixelFormat = 0x1B608010 PixelFormatYV12 PixelFormat = 0x32315659 PixelFormatIYUV PixelFormat = 0x56555949 PixelFormatYUY2 PixelFormat = 0x32595559 PixelFormatUYVY PixelFormat = 0x59565955 PixelFormatYVYU PixelFormat = 0x55595659 PixelFormatNV12 PixelFormat = 0x3231564E PixelFormatNV21 PixelFormat = 0x3132564E PixelFormatP010 PixelFormat = 0x30313050 PixelFormatExternalOES PixelFormat = 0x2053454F PixelFormatRGBA32 PixelFormat = PixelFormatABGR8888 PixelFormatARGB32 PixelFormat = PixelFormatBGRA8888 PixelFormatBGRA32 PixelFormat = PixelFormatARGB8888 PixelFormatABGR32 PixelFormat = PixelFormatRGBA8888 PixelFormatRGBX32 PixelFormat = PixelFormatXBGR8888 PixelFormatXRGB32 PixelFormat = PixelFormatBGRX8888 PixelFormatBGRX32 PixelFormat = PixelFormatXRGB8888 PixelFormatXBGR32 PixelFormat = PixelFormatRGBX8888 )
func DefinePixelFormat ¶
func DefinePixelFormat[T BitmapOrder | PackedOrder | ArrayOrder](pixelType PixelType, order T, layout PackedLayout, bitsPerPixel, bytesPerPixel byte) PixelFormat
DefinePixelFormat defines custom non-FourCC pixel formats.
func DefinePixelFourCC ¶
func DefinePixelFourCC(a, b, c, d byte) PixelFormat
DefinePixelFourCC defines custom FourCC pixel formats.
func GetPixelFormatFromGPUTextureFormat ¶
func GetPixelFormatFromGPUTextureFormat(format GPUTextureFormat) PixelFormat
GetPixelFormatFromGPUTextureFormat gets the SDL pixel format corresponding to a GPU texture format.
Available since SDL 3.4.0.
func GetWindowPixelFormat ¶
func GetWindowPixelFormat(window *Window) PixelFormat
GetWindowPixelFormat gets the pixel format associated with the window.
type PixelFormatDetails ¶
type PixelFormatDetails struct {
Format PixelFormat
BitsPerPixel uint8
BytesPerPixel uint8
Padding [2]uint8
Rmask, Gmask, Bmask, Amask uint32
Rbits, Gbits, Bbits, Abits uint8
Rshift, Gshift, Bshift, Ashift uint8
}
PixelFormatDetails defines the details about the format of a pixel.
func GetPixelFormatDetails ¶
func GetPixelFormatDetails(format PixelFormat) *PixelFormatDetails
GetPixelFormatDetails creates an PixelFormatDetails structure corresponding to a pixel format.
type Point ¶
type Point struct {
X, Y int32
}
Point is a structure specifying the structure that defines a point (using integers)s.
type PowerState ¶
type PowerState int32
PowerState is the basic state for the system's power supply return by GetPowerInfo.
const ( PowerStateError PowerState = iota - 1 // Error determining power status. PowerStateUnknown // Cannot determine power status. PowerStateOnBattery // Not plugged in, running on the battery. PowerStateNoBattery // Plugged in, no battery available. PowerStateCharging // Plugged in, charging battery. PowerStateCharged // Plugged in, battery charged. )
func GetJoystickPowerInfo ¶
func GetJoystickPowerInfo(joystick *Joystick, percent *int32) PowerState
GetJoystickPowerInfo gets the battery state of a joystick.
func GetPowerInfo ¶
func GetPowerInfo(seconds *int32, percent *int32) PowerState
GetPowerInfo gets the current power supply details.
type ProcessIO ¶
type ProcessIO uint32
ProcessIO defines the description of where standard I/O should be directed when creating a process.
const ( ProcessStdioInherited ProcessIO = iota // The I/O stream is inherited from the application. ProcessStdioNull // The I/O stream is ignored. ProcessStdioApp // The I/O stream is connected to a new [IOStream] that the application can read or write. ProcessStdioRedirect // The I/O stream is redirected to an existing [IOStream]. )
type ProgressState ¶
type ProgressState int32
ProgressState defines window progress state
const ( ProgressStateInvalid ProgressState = iota - 1 // An invalid progress state indicating an error; check [GetError]. ProgressStateNone // No progress bar is shown. ProgressStateIndeterminate // The progress bar is shown in a indeterminate state. ProgressStateNormal // The progress bar is shown in a normal state. ProgressStatePaused // The progress bar is shown in a paused state. ProgressStateError // The progress bar is shown in a state indicating the application had an error. )
func GetWindowProgressState ¶
func GetWindowProgressState(window *Window) ProgressState
GetWindowProgressState gets the state of the progress bar for the given window’s taskbar icon.
Available since SDL 3.4.0.
type PropertiesID ¶
type PropertiesID uint32
PropertiesID is an ID that represents a properties set.
func CreateProperties ¶
func CreateProperties() PropertiesID
CreateProperties creates a group of properties.
func GetCameraProperties ¶
func GetCameraProperties(camera *Camera) PropertiesID
GetCameraProperties gets the properties associated with an opened camera.
func GetDisplayProperties ¶
func GetDisplayProperties(displayID DisplayID) PropertiesID
GetDisplayProperties gets the properties associated with a display.
func GetGPUDeviceProperties ¶
func GetGPUDeviceProperties(device *GPUDevice) PropertiesID
GetGPUDeviceProperties gets the properties associated with a GPU device.
Available since SDL 3.4.0.
func GetGlobalProperties ¶
func GetGlobalProperties() PropertiesID
GetGlobalProperties gets the global SDL properties.
func GetJoystickProperties ¶
func GetJoystickProperties(joystick *Joystick) PropertiesID
GetJoystickProperties gets the properties associated with a joystick.
func GetRendererProperties ¶
func GetRendererProperties(renderer *Renderer) PropertiesID
GetRendererProperties gets the properties associated with a renderer.
func GetSurfaceProperties ¶
func GetSurfaceProperties(surface *Surface) PropertiesID
GetSurfaceProperties gets the properties associated with a surface.
func GetTextureProperties ¶
func GetTextureProperties(texture *Texture) PropertiesID
GetTextureProperties gets the properties associated with a texture.
func GetWindowProperties ¶
func GetWindowProperties(window *Window) PropertiesID
GetWindowProperties gets the properties associated with a window.
type PropertyType ¶
type PropertyType uint32
PropertyType defines the SDL property type.
const ( PropertyTypeInvalid PropertyType = iota PropertyTypePointer PropertyTypeString PropertyTypeNumber PropertyTypeFloat PropertyTypeBoolean )
func GetPropertyType ¶
func GetPropertyType(props PropertiesID, name string) PropertyType
GetPropertyType gets the type of a property in a group of properties.
type QuitEvent ¶
type QuitEvent struct {
CommonEvent
}
QuitEvent is a structure specifying the "quit requested" events.
type RWLock ¶
type RWLock struct{}
RWLock is a mutex that allows read-only threads to run in parallel.
type Rect ¶
type Rect struct {
X, Y, W, H int32
}
Rect is a rectangle, with the origin at the upper left (using integers).
func GetRectEnclosingPoints ¶
GetRectEnclosingPoints calculates a minimal rectangle enclosing a set of points.
func GetRectIntersection ¶
GetRectIntersection calculates the intersection of two rectangles.
func GetRectUnion ¶
GetRectUnion calculates the union of two rectangles.
func GetWindowMouseRect ¶
GetWindowMouseRect gets the mouse confinement rectangle of a window.
type RenderEvent ¶
type RenderEvent struct {
CommonEvent
WindowID WindowID // The window containing the renderer in question.
}
RenderEvent defines the renderer event structure (event.render.*).
type Renderer ¶
type Renderer struct{}
Renderer is a structure representing rendering state
func CreateGPURenderer ¶
CreateGPURenderer creates a 2D GPU rendering context.
The GPU device to use is passed in as a parameter. If this is nil, then a device will be created normally and can be retrieved using GetGPURendererDevice.
The window to use is passed in as a parameter. If this is nil, then this will become an offscreen renderer. In that case, you should call SetRenderTarget to setup rendering to a texture, and then call RenderPresent normally to complete drawing a frame.
Available since SDL 3.4.0.
func CreateRenderer ¶
CreateRenderer creates a 2D rendering context for a window. The name parameter can be one driver, a comma-separated list of drivers or "" to let SDL choose one.
func CreateRendererWithProperties ¶
func CreateRendererWithProperties(props PropertiesID) *Renderer
CreateRendererWithProperties creates a 2D rendering context for a window, with the specified properties.
func CreateSoftwareRenderer ¶
CreateSoftwareRenderer creates a 2D software rendering context for a surface.
func GetRenderer ¶
GetRenderer gets the renderer associated with a window.
func GetRendererFromTexture ¶
GetRendererFromTexture gets the renderer that created an Texture.
type RendererLogicalPresentation ¶
type RendererLogicalPresentation uint32
RendererLogicalPresentation describes how the logical size is mapped to the output.
const ( LogicalPresentationDisabled RendererLogicalPresentation = iota // There is no logical size in effect LogicalPresentationStretch // The rendered content is stretched to the output resolution LogicalPresentationLetterbox // The rendered content is fit to the largest dimension and the other dimension is letterboxed with the clear color LogicalPresentationOverscan // The rendered content is fit to the smallest dimension and the other dimension extends beyond the output bounds LogicalPresentationIntegerScale // The rendered content is scaled up by integer multiples to fit the output resolution )
type Scancode ¶
type Scancode uint32
Scancode is a structure specifying the SDL keyboard scancode representations.
const ( ScancodeUnknown Scancode = 0 ScancodeA Scancode = 4 ScancodeB Scancode = 5 ScancodeC Scancode = 6 ScancodeD Scancode = 7 ScancodeE Scancode = 8 ScancodeF Scancode = 9 ScancodeG Scancode = 10 ScancodeH Scancode = 11 ScancodeI Scancode = 12 ScancodeJ Scancode = 13 ScancodeK Scancode = 14 ScancodeL Scancode = 15 ScancodeM Scancode = 16 ScancodeN Scancode = 17 ScancodeO Scancode = 18 ScancodeP Scancode = 19 ScancodeQ Scancode = 20 ScancodeR Scancode = 21 ScancodeS Scancode = 22 ScancodeT Scancode = 23 ScancodeU Scancode = 24 ScancodeV Scancode = 25 ScancodeW Scancode = 26 ScancodeX Scancode = 27 ScancodeY Scancode = 28 ScancodeZ Scancode = 29 Scancode1 Scancode = 30 Scancode2 Scancode = 31 Scancode3 Scancode = 32 Scancode4 Scancode = 33 Scancode5 Scancode = 34 Scancode6 Scancode = 35 Scancode7 Scancode = 36 Scancode8 Scancode = 37 Scancode9 Scancode = 38 Scancode0 Scancode = 39 ScancodeReturn Scancode = 40 ScancodeEscape Scancode = 41 ScancodeBackspace Scancode = 42 ScancodeTab Scancode = 43 ScancodeSpace Scancode = 44 ScancodeMinus Scancode = 45 ScancodeEquals Scancode = 46 ScancodeLeftBracket Scancode = 47 ScancodeRightBracket Scancode = 48 ScancodeBackslash Scancode = 49 // Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. ScancodeNonUSHash Scancode = 50 // ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. ScancodeSemicolon Scancode = 51 ScancodeApostrophe Scancode = 52 ScancodeGrave Scancode = 53 // Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. ScancodeComma Scancode = 54 ScancodePeriod Scancode = 55 ScancodeSlash Scancode = 56 ScancodeCapsLock Scancode = 57 ScancodeF1 Scancode = 58 ScancodeF2 Scancode = 59 ScancodeF3 Scancode = 60 ScancodeF4 Scancode = 61 ScancodeF5 Scancode = 62 ScancodeF6 Scancode = 63 ScancodeF7 Scancode = 64 ScancodeF8 Scancode = 65 ScancodeF9 Scancode = 66 ScancodeF10 Scancode = 67 ScancodeF11 Scancode = 68 ScancodeF12 Scancode = 69 ScancodePrintScreen Scancode = 70 ScancodeScrollLock Scancode = 71 ScancodePause Scancode = 72 ScancodeInsert Scancode = 73 // Insert on PC, help on some Mac keyboards (but does send code 73, not 117). ScancodeHome Scancode = 74 ScancodePageUp Scancode = 75 ScancodeDelete Scancode = 76 ScancodeEnd Scancode = 77 ScancodePageDown Scancode = 78 ScancodeRight Scancode = 79 ScancodeLeft Scancode = 80 ScancodeDown Scancode = 81 ScancodeUp Scancode = 82 ScancodeNumLockClear Scancode = 83 // Num lock on PC, clear on Mac keyboards. ScancodeKpDivide Scancode = 84 ScancodeKpMultiply Scancode = 85 ScancodeKpMinus Scancode = 86 ScancodeKpPlus Scancode = 87 ScancodeKpEnter Scancode = 88 ScancodeKp1 Scancode = 89 ScancodeKp2 Scancode = 90 ScancodeKp3 Scancode = 91 ScancodeKp4 Scancode = 92 ScancodeKp5 Scancode = 93 ScancodeKp6 Scancode = 94 ScancodeKp7 Scancode = 95 ScancodeKp8 Scancode = 96 ScancodeKp9 Scancode = 97 ScancodeKp0 Scancode = 98 ScancodeKpPeriod Scancode = 99 ScancodeNonUSBackslash Scancode = 100 // This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. ScancodeApplication Scancode = 101 // Windows contextual menu, compose. ScancodePower Scancode = 102 // The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. ScancodeKpEquals Scancode = 103 ScancodeF13 Scancode = 104 ScancodeF14 Scancode = 105 ScancodeF15 Scancode = 106 ScancodeF16 Scancode = 107 ScancodeF17 Scancode = 108 ScancodeF18 Scancode = 109 ScancodeF19 Scancode = 110 ScancodeF20 Scancode = 111 ScancodeF21 Scancode = 112 ScancodeF22 Scancode = 113 ScancodeF23 Scancode = 114 ScancodeF24 Scancode = 115 ScancodeExecute Scancode = 116 ScancodeHelp Scancode = 117 // AL Integrated Help Center. ScancodeMenu Scancode = 118 // Menu (show menu). ScancodeSelect Scancode = 119 ScancodeStop Scancode = 120 // AC Stop. ScancodeAgain Scancode = 121 // AC Redo/Repeat. ScancodeUndo Scancode = 122 // AC Undo. ScancodeCut Scancode = 123 // AC Cut. ScancodeCopy Scancode = 124 // AC Copy. ScancodePaste Scancode = 125 // AC Paste. ScancodeFind Scancode = 126 // AC Find. ScancodeMute Scancode = 127 ScancodeVolumeUp Scancode = 128 ScancodeVolumeDown Scancode = 129 ScancodeKpComma Scancode = 133 ScancodeKpEqualsAs400 Scancode = 134 ScancodeInternational1 Scancode = 135 // used on Asian keyboards, see footnotes in USB doc. ScancodeInternational2 Scancode = 136 ScancodeInternational3 Scancode = 137 // Yen. ScancodeInternational4 Scancode = 138 ScancodeInternational5 Scancode = 139 ScancodeInternational6 Scancode = 140 ScancodeInternational7 Scancode = 141 ScancodeInternational8 Scancode = 142 ScancodeInternational9 Scancode = 143 ScancodeLang1 Scancode = 144 // Hangul/English toggle. ScancodeLang2 Scancode = 145 // Hanja conversion. ScancodeLang3 Scancode = 146 // Katakana. ScancodeLang4 Scancode = 147 // Hiragana. ScancodeLang5 Scancode = 148 // Zenkaku/Hankaku. ScancodeLang6 Scancode = 149 // Reserved. ScancodeLang7 Scancode = 150 // Reserved. ScancodeLang8 Scancode = 151 // Reserved. ScancodeLang9 Scancode = 152 // Reserved. ScancodeAltErase Scancode = 153 // Erase-Eaze. ScancodeSysReq Scancode = 154 ScancodeCancel Scancode = 155 // AC Cancel. ScancodeClear Scancode = 156 ScancodePrior Scancode = 157 ScancodeReturn2 Scancode = 158 ScancodeSeparator Scancode = 159 ScancodeOut Scancode = 160 ScancodeOper Scancode = 161 ScancodeClearAgain Scancode = 162 ScancodeCrSel Scancode = 163 ScancodeExSel Scancode = 164 ScancodeKp00 Scancode = 176 ScancodeKp000 Scancode = 177 ScancodeThousandsSeparator Scancode = 178 ScancodeDecimalSeparator Scancode = 179 ScancodeCurrencyUnit Scancode = 180 ScancodeCurrencySubunit Scancode = 181 ScancodeKpLeftParen Scancode = 182 ScancodeKpRightParen Scancode = 183 ScancodeKpLeftBrace Scancode = 184 ScancodeKpRightBrace Scancode = 185 ScancodeKpTab Scancode = 186 ScancodeKpBackspace Scancode = 187 ScancodeKpA Scancode = 188 ScancodeKpB Scancode = 189 ScancodeKpC Scancode = 190 ScancodeKpD Scancode = 191 ScancodeKpE Scancode = 192 ScancodeKpF Scancode = 193 ScancodeKpXor Scancode = 194 ScancodeKpPower Scancode = 195 ScancodeKpPercent Scancode = 196 ScancodeKpLess Scancode = 197 ScancodeKpGreater Scancode = 198 ScancodeKpAmpersand Scancode = 199 ScancodeKpDblAmpersand Scancode = 200 ScancodeKpVerticalBar Scancode = 201 ScancodeKpDblverticalBar Scancode = 202 ScancodeKpColon Scancode = 203 ScancodeKpHash Scancode = 204 ScancodeKpSpace Scancode = 205 ScancodeKpAt Scancode = 206 ScancodeKpExclam Scancode = 207 ScancodeKpMemStore Scancode = 208 ScancodeKpMemRecall Scancode = 209 ScancodeKpMemClear Scancode = 210 ScancodeKpMemAdd Scancode = 211 ScancodeKpMemSubtract Scancode = 212 ScancodeKpMemMultiply Scancode = 213 ScancodeKpMemDivide Scancode = 214 ScancodeKpPlusMinus Scancode = 215 ScancodeKpClear Scancode = 216 ScancodeKpClearEntry Scancode = 217 ScancodeKpBinary Scancode = 218 ScancodeKpOctal Scancode = 219 ScancodeKpDecimal Scancode = 220 ScancodeKpHexadecimal Scancode = 221 ScancodeLCtrl Scancode = 224 ScancodeLShift Scancode = 225 ScancodeLAlt Scancode = 226 // Alt, option. ScancodeLGui Scancode = 227 // Windows, command (apple), meta. ScancodeRCtrl Scancode = 228 ScancodeRShift Scancode = 229 ScancodeRAlt Scancode = 230 // Alt gr, option. ScancodeRGui Scancode = 231 // Windows, command (apple), meta. ScancodeMode Scancode = 257 ScancodeSleep Scancode = 258 // Sleep. ScancodeWake Scancode = 259 // Wake. ScancodeChannelIncrement Scancode = 260 // Channel Increment. ScancodeChannelDecrement Scancode = 261 // Channel Decrement. ScancodeMediaPlay Scancode = 262 // Play. ScancodeMediaPause Scancode = 263 // Pause. ScancodeMediaRecord Scancode = 264 // Record. ScancodeMediaFastForward Scancode = 265 // Fast Forward. ScancodeMediaRewind Scancode = 266 // Rewind. ScancodeMediaNextTrack Scancode = 267 // Next Track. ScancodeMediaPreviousTrack Scancode = 268 // Previous Track. ScancodeMediaStop Scancode = 269 // Stop. ScancodeMediaEject Scancode = 270 // Eject. ScancodeMediaPlayPause Scancode = 271 // Play / Pause. ScancodeMediaSelect Scancode = 272 // Media Select. ScancodeAcNew Scancode = 273 // AC New. ScancodeAcOpen Scancode = 274 // AC Open. ScancodeAcClose Scancode = 275 // AC Close. ScancodeAcExit Scancode = 276 // AC Exit. ScancodeAcSave Scancode = 277 // AC Save. ScancodeAcPrint Scancode = 278 // AC Print. ScancodeAcProperties Scancode = 279 // AC Properties. ScancodeAcSearch Scancode = 280 // AC Search. ScancodeAcHome Scancode = 281 // AC Home. ScancodeAcBack Scancode = 282 // AC Back. ScancodeAcForward Scancode = 283 // AC Forward. ScancodeAcStop Scancode = 284 // AC Stop. ScancodeAcRefresh Scancode = 285 // AC Refresh. ScancodeAcBookmarks Scancode = 286 // AC Bookmarks. ScancodeSoftLeft Scancode = 287 // Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display. ScancodeSoftRight Scancode = 288 // Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display. ScancodeCall Scancode = 289 // Used for accepting phone calls. ScancodeEndCall Scancode = 290 // Used for rejecting phone calls. ScancodeReserved Scancode = 400 // 400-500 reserved for dynamic keycodes. ScancodeCount Scancode = 512 // Not a key, just marks the number of scancodes for array bounds. )
func GetScancodeFromKey ¶
GetScancodeFromKey gets the scancode corresponding to the given key code according to the current keyboard layout.
func GetScancodeFromName ¶
GetScancodeFromName gets a scancode from a human-readable name.
type Semaphore ¶
type Semaphore struct{}
Semaphore defines a means to manage access to a resource, by count, between threads.
type Sensor ¶
type Sensor struct{}
Sensor is a opaque structure used to identify an opened SDL sensor.
type SensorEvent ¶
type SensorEvent struct {
CommonEvent
Which SensorID // The instance ID of the sensor.
Data [6]float32 // Up to 6 values from the sensor - additional values can be queried using [GetSensorData].
SensorTimestamp uint64 // The timestamp of the sensor reading in nanoseconds, not necessarily synchronized with the system clock.
}
SensorEvent defines the sensor event structure (event.sensor.*).
type SensorID ¶
type SensorID uint32
SensorID is a unique ID for a sensor for the time it is connected to the system, and is never reused for the lifetime of the application.
type SensorType ¶
type SensorType int32
SensorType is a structure specifying the different sensors defined by SDLs.
const ( SensorInvalid SensorType = iota - 1 // Returned for an invalid sensor. SensorUnknown // Unknown sensor type. SensorAccel // Accelerometer. SensorGyro // Gyroscope. SensorAccelL // Accelerometer for left Joy-Con controller and Wii nunchuk. SensorGyroL // Gyroscope for left Joy-Con controller. SensorAccelR // Accelerometer for right Joy-Con controller. SensorGyroR // Gyroscope for right Joy-Con controller. SensorCount )
type StorageInterface ¶
type StorageInterface struct {
Version uint32 // The version of this interface.
Close *func(userdata uintptr) bool // Called when the storage is closed.
Ready *func(userdata uintptr) bool // Optional, returns whether the storage is currently ready for access.
Enumerate *func(userdata uintptr, path *byte, callback EnumerateDirectoryCallback, callbackUserdata uintptr) bool // Enumerate a directory, optional for write-only storage.
Info *func(userdata uintptr, path *byte, info *PathInfo) bool // Get path information, optional for write-only storage.
ReadFile *func(userdata uintptr, path *byte, destination uintptr, length uint64) bool // Read a file from storage, optional for write-only storage.
WriteFile *func(userdata uintptr, path *byte, source uintptr, length uint64) bool // Write a file to storage, optional for read-only storage.
Mkdir *func(userdata uintptr, path *byte) bool // Create a directory, optional for read-only storage.
Remove *func(userdata uintptr, path *byte) bool // Remove a file or empty directory, optional for read-only storage.
Rename *func(userdata uintptr, oldpath, newpath *byte) bool // Rename a path, optional for read-only storage.
Copy *func(userdata uintptr, oldpath, newpath *byte) bool // Copy a file, optional for read-only storage.
SpaceRemaining *func(userdata uintptr) uint64 // Get the space remaining, optional for read-only storage.
}
StorageInterface defines function interface for Storage.
type Surface ¶
type Surface struct {
Flags SurfaceFlags // The flags of the surface, read-only.
Format PixelFormat // The format of the surface, read-only.
W int32 // The width of the surface, read-only.
H int32 // The height of the surface, read-only.
Pitch int32 // The distance in bytes between rows of pixels, read-only.
Pixels unsafe.Pointer // A pointer to the pixels of the surface, the pixels are writeable if non-nil.
Refcount int32 // Application reference count, used when freeing surface.
Reserved unsafe.Pointer // Reserved for internal use.
}
Surface is a collection of pixels used in software blitting.
func AcquireCameraFrame ¶
AcquireCameraFrame acquires a frame.
func ConvertSurface ¶
func ConvertSurface(surface *Surface, format PixelFormat) *Surface
ConvertSurface copies an existing surface to a new surface of the specified format.
func ConvertSurfaceAndColorspace ¶
func ConvertSurfaceAndColorspace(surface *Surface, format PixelFormat, palette *Palette, colorspace Colorspace, props PropertiesID) *Surface
ConvertSurfaceAndColorspace copies an existing surface to a new surface of the specified format and colorspace.
func CreateSurface ¶
func CreateSurface(width int32, height int32, format PixelFormat) *Surface
CreateSurface allocates a new surface with a specific pixel format.
func CreateSurfaceFrom ¶
func CreateSurfaceFrom(width int32, height int32, format PixelFormat, pixels unsafe.Pointer, pitch int32) *Surface
CreateSurfaceFrom allocates a new surface with a specific pixel format and existing pixel data.
func DuplicateSurface ¶
DuplicateSurface creates a new surface identical to the existing surface.
func GetSurfaceImages ¶
GetSurfaceImages gets an array including all versions of a surface.
func GetWindowSurface ¶
GetWindowSurface gets the SDL surface associated with the window.
func RenderReadPixels ¶
RenderReadPixels reads pixels from the current rendering target.
func RotateSurface ¶
RotateSurface returns a copy of a surface rotated clockwise a number of degrees.
Available since SDL 3.4.0.
func ScaleSurface ¶
ScaleSurface creates a new surface identical to the existing surface, scaled to the desired size.
type SurfaceFlags ¶
type SurfaceFlags uint32
SurfaceFlags is a structure specifying the flags on an [Surfaces].
const ( SurfacePreallocated SurfaceFlags = 1 << iota // Surface uses preallocated pixel memory. SurfaceLockNeeded // Surface needs to be locked to access pixels. SurfaceLocked // Surface is currently locked. SurfaceSIMDAligned // Surface uses pixel memory allocated with [aligned_alloc]. )
type SystemCursor ¶
type SystemCursor uint32
SystemCursor defines the cursor types for CreateSystemCursor.
const ( SystemCursorDefault SystemCursor = iota // Default cursor. Usually an arrow. SystemCursorText // Text selection. Usually an I-beam. SystemCursorWait // Wait. Usually an hourglass or watch or spinning ball. SystemCursorCrosshair // Crosshair. SystemCursorProgress // Program is busy but still interactive. Usually it's WAIT with an arrow. SystemCursorNWSEResize // Double arrow pointing northwest and southeast. SystemCursorNESWResize // Double arrow pointing northeast and southwest. SystemCursorEWResize // Double arrow pointing west and east. SystemCursorNSResize // Double arrow pointing north and south. SystemCursorMove // Four pointed arrow pointing north, south, east, and west. SystemCursorNotAllowed // Not permitted. Usually a slashed circle or crossbones. SystemCursorPointer // Pointer that indicates a link. Usually a pointing hand. SystemCursorNWResize // Window resize top-left. This may be a single arrow or a double arrow like NWSE_RESIZE. SystemCursorNResize // Window resize top. May be NS_RESIZE. SystemCursorNEResize // Window resize top-right. May be NESW_RESIZE. SystemCursorEResize // Window resize right. May be EW_RESIZE. SystemCursorSEResize // Window resize bottom-right. May be NWSE_RESIZE. SystemCursorSResize // Window resize bottom. May be NS_RESIZE. SystemCursorSWResize // Window resize bottom-left. May be NESW_RESIZE. SystemCursorWResize // Window resize left. May be EW_RESIZE. SystemCursorCount )
type SystemTheme ¶
type SystemTheme uint32
const ( SystemThemeUnknown SystemTheme = iota // Unknown system theme SystemThemeLight // Light colored system theme SystemThemeDark // Dark colored system theme )
func GetSystemTheme ¶
func GetSystemTheme() SystemTheme
GetSystemTheme gets the current system theme.
type TextEditingCandidatesEvent ¶
type TextEditingCandidatesEvent struct {
CommonEvent
WindowID WindowID // The window with keyboard focus, if any.
SelectedCandidate int32 // The index of the selected candidate, or -1 if no candidate is selected.
Horizontal bool // true if the list is horizontal, false if it's vertical.
// contains filtered or unexported fields
}
TextEditingCandidatesEvent defines the keyboard IME candidates event structure (event.edit_candidates.*).
func (*TextEditingCandidatesEvent) Candidates ¶
func (t *TextEditingCandidatesEvent) Candidates() []string
Candidates returns the list of candidates, or empty if there are no candidates available.
type TextEditingEvent ¶
type TextEditingEvent struct {
CommonEvent
WindowID WindowID // The window with keyboard focus, if any.
Start int32 // The start cursor of selected editing text, or -1 if not set.
Length int32 // The length of selected editing text, or -1 if not set.
// contains filtered or unexported fields
}
TextEditingEvent defines the keyboard text editing event structure (event.edit.*).
func (*TextEditingEvent) Text ¶
func (t *TextEditingEvent) Text() string
Text returns the editing text.
type TextInputEvent ¶
type TextInputEvent struct {
CommonEvent
WindowID WindowID // The window with keyboard focus, if any.
// contains filtered or unexported fields
}
TextInputEvent defines the keyboard text input event structure (event.text.*).
func (*TextInputEvent) Text ¶
func (t *TextInputEvent) Text() string
Text returns the input text, UTF-8 encoded.
type TextInputType ¶
type TextInputType uint32
TextInputType defines the text input type.
const ( TextInputTypeText TextInputType = iota // The input is text. TextInputTypeTextName // The input is a person's name. TextInputTypeTextEmail // The input is an e-mail address. TextInputTypeTextUsername // The input is a username. TextInputTypeTextPasswordHidden // The input is a secure password that is hidden. TextInputTypeTextPasswordVisible // The input is a secure password that is visible. TextInputTypeNumber // The input is a number. TextInputTypeNumberPasswordHidden // The input is a secure PIN that is hidden. TextInputTypeNumberPasswordVisible // The input is a secure PIN that is visible. )
type Texture ¶
type Texture struct {
Format PixelFormat // The format of the texture, read-only
W int32 // The width of the texture, read-only.
H int32 // The height of the texture, read-only.
Refcount int32 // Application reference count, used when freeing texture
}
Texture is a efficient driver-specific representation of pixel data.
func CreateTexture ¶
func CreateTexture(renderer *Renderer, format PixelFormat, access TextureAccess, w int32, h int32) *Texture
CreateTexture creates a texture for a rendering context.
func CreateTextureFromSurface ¶
CreateTextureFromSurface creates a texture from an existing surface.
func CreateTextureWithProperties ¶
func CreateTextureWithProperties(renderer *Renderer, props PropertiesID) *Texture
CreateTextureWithProperties creates a texture for a rendering context with the specified properties.
func GetRenderTarget ¶
GetRenderTarget gets the current render target.
type TextureAccess ¶
type TextureAccess uint32
TextureAccess the access pattern allowed for a texture.
const ( TextureAccessStatic TextureAccess = iota // Changes rarely, not lockable TextureAccessStreaming // Changes frequently, lockable TextureAccessTarget // Texture can be used as a render target )
type TextureAddressMode ¶
type TextureAddressMode int32
TextureAddressMode defines the addressing mode for a texture when used in RenderGeometry.
Available since SDL 3.4.0.
const ( TextureAddressInvalid TextureAddressMode = iota - 1 TextureAddressAuto // Wrapping is enabled if texture coordinates are outside [0, 1], this is the default. TextureAddressClamp // Texture coordinates are clamped to the [0, 1] range. TextureAddressWrap // The texture is repeated (tiled). )
type ThreadFunction ¶
type ThreadFunction uintptr
ThreadFunction is the function passed to [CreateThread] as the new thread's entry point.
type ThreadPriority ¶
type ThreadPriority uint32
ThreadPriority is a structure specifying the SDL thread prioritys.
const ( ThreadPriorityLow ThreadPriority = iota ThreadPriorityNormal ThreadPriorityHigh ThreadPriorityTimeCritical )
type ThreadState ¶
type ThreadState uint32
ThreadState is a structure specifying the SDL thread states.
const ( ThreadUnknown ThreadState = iota // The thread is not valid. ThreadAlive // The thread is currently running. ThreadDetached // The thread is detached and can't be waited on. ThreadComplete // The thread has finished and should be cleaned up with [WaitThread]. )
type Time ¶
type Time int64
Time is a structure specifying SDL time. SDL times are signed, 64-bit integers representing nanoseconds since the Unix epoch (Jan 1, 1970).
type TimeFormat ¶
type TimeFormat uint32
TimeFormat is a structure specifying the preferred time format of the current system locales.
const ( TimeFormat24HR TimeFormat = iota // 24 hour time. TimeFormat12HR // 12 hour time. )
type TimerCallback ¶
type TimerCallback uintptr
TimerCallback is a function prototype for the millisecond timer callback function.
type TouchDeviceType ¶
type TouchDeviceType int32
TouchDeviceType is an enum that describes the type of a touch device.
const ( TouchDeviceInvalid TouchDeviceType = iota - 1 TouchDeviceDirect // Touch screen with window-relative coordinates. TouchDeviceIndirectAbsolute // Trackpad with absolute device coordinates. TouchDeviceIndirectRelative // Trackpad with screen cursor-relative coordinates. )
type TouchFingerEvent ¶
type TouchFingerEvent struct {
CommonEvent
TouchID TouchID // The touch device id.
FingerID FingerID
X float32 // Normalized in the range 0...1.
Y float32 // Normalized in the range 0...1.
Dx float32 // Normalized in the range -1...1.
Dy float32 // Normalized in the range -1...1.
Pressure float32 // Normalized in the range 0...1.
WindowID WindowID // The window underneath the finger, if any.
}
TouchFingerEvent defines the touch finger event structure (event.tfinger.*).
type TransferCharacteristics ¶
type TransferCharacteristics uint32
TransferCharacteristics defines the colorspace transfer characteristics.
const ( TransferCharacteristicsUnknown TransferCharacteristics = 0 TransferCharacteristicsBT709 TransferCharacteristics = 1 // Rec. ITU-R BT.709-6 / ITU-R BT1361. TransferCharacteristicsUnspecified TransferCharacteristics = 2 TransferCharacteristicsGamma22 TransferCharacteristics = 4 // ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM. TransferCharacteristicsGamma28 TransferCharacteristics = 5 // ITU-R BT.470-6 System B, G. TransferCharacteristicsBT601 TransferCharacteristics = 6 // SMPTE ST 170M / ITU-R BT.601-7 525 or 625. TransferCharacteristicsSMPTE240 TransferCharacteristics = 7 // SMPTE ST 240M. TransferCharacteristicsLinear TransferCharacteristics = 8 TransferCharacteristicsLog100 TransferCharacteristics = 9 TransferCharacteristicsLog100Sqrt10 TransferCharacteristics = 10 TransferCharacteristicsIEC61966 TransferCharacteristics = 11 // IEC 61966-2-4. TransferCharacteristicsBT1361 TransferCharacteristics = 12 // ITU-R BT1361 Extended Colour Gamut. TransferCharacteristicsSRGB TransferCharacteristics = 13 // IEC 61966-2-1 (sRGB or sYCC). TransferCharacteristicsBT202010Bit TransferCharacteristics = 14 // ITU-R BT2020 for 10-bit system. TransferCharacteristicsBT202012Bit TransferCharacteristics = 15 // ITU-R BT2020 for 12-bit system. TransferCharacteristicsPQ TransferCharacteristics = 16 // SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems. TransferCharacteristicsSMPTE428 TransferCharacteristics = 17 // SMPTE ST 428-1. TransferCharacteristicsHLG TransferCharacteristics = 18 // ARIB STD-B67, known as "hybrid log-gamma" (HLG). TransferCharacteristicsCustom TransferCharacteristics = 31 )
type TrayEntry ¶
type TrayEntry struct{}
TrayEntry is an opaque handle representing an entry on a system tray object.
type TrayEntryFlags ¶
type TrayEntryFlags uint32
TrayEntryFlags defines flags that control the creation of system tray entries.
const ( TrayentryButton TrayEntryFlags = 0x00000001 // Make the entry a simple button. Required. TrayentryCheckbox TrayEntryFlags = 0x00000002 // Make the entry a checkbox. Required. TrayentryDisabled TrayEntryFlags = 0x80000000 // Make the entry disabled. Optional. TrayentryChecked TrayEntryFlags = 0x40000000 // Make the entry checked. This is valid only for checkboxes. Optional. )
type TrayMenu ¶
type TrayMenu struct{}
TrayMenu is an opaque handle representing a menu/submenu on a system tray object.
type UserEvent ¶
type UserEvent struct {
CommonEvent
WindowID WindowID // The associated window if any.
Code int32 // User defined event code.
Data1 unsafe.Pointer // User defined data pointer.
Data2 unsafe.Pointer // User defined data pointer.
}
UserEvent is a user-defined event type (event.user.*).
type Vertex ¶
type Vertex struct {
Position FPoint // Vertex position, in SDL_Renderer coordinates
Color FColor // Vertex color
TexCoord FPoint // Normalized texture coordinates, if needed
}
Vertex is a vertex structure.
type VirtualJoystickDesc ¶
type VirtualJoystickDesc struct {
Version uint32 // The version of this interface.
Type uint16 // [JoystickType].
VendorId uint16 // The USB vendor ID of this joystick.
ProductId uint16 // The USB product ID of this joystick.
Naxes uint16 // The number of axes on this joystick.
Nballs uint16 // The number of balls on this joystick.
Nhats uint16 // The number of hats on this joystick.
Ntouchpads uint16 // The number of touchpads on this joystick, requires `touchpads` to point at valid descriptions.
Nsensors uint16 // The number of sensors on this joystick, requires `sensors` to point at valid descriptions.
ButtonMask uint32 // A mask of which buttons are valid for this controller e.g. (1 << SDL_GAMEPAD_BUTTON_SOUTH).
AxisMask uint32 // A mask of which axes are valid for this controller e.g. (1 << SDL_GAMEPAD_AXIS_LEFTX).
Name *byte // The name of the joystick.
Touchpads *VirtualJoystickTouchpadDesc // A pointer to an array of touchpad descriptions, required if `ntouchpads` is > 0.
Sensors *VirtualJoystickSensorDesc // A pointer to an array of sensor descriptions, required if `nsensors` is > 0.
Userdata uintptr
Update *func(userdata uintptr) // Called when the joystick state should be updated.
SetPlayerIndex *func(userdata uintptr, playerIndex int32) // Called when the player index is set.
Rumble *func(userdata uintptr, lowFrequencyRumble, highFrequencyRumble uint16) bool // Implements [RumbleJoystick()].
RumbleTriggers *func(userdata uintptr, leftRumble, rightRumble uint16) bool // Implements [RumbleJoystickTriggers()].
SetLED *func(userdata uintptr, red, green, blue uint8) bool // Implements [SetJoystickLED()].
SendEffect *func(userdata uintptr, data uintptr, size int32) bool // Implements [SendJoystickEffect()].
SetSensorsEnabled *func(userdata uintptr, enabled bool) bool // Implements [SetGamepadSensorEnabled()].
Cleanup *func(userdata uintptr) // Cleans up the userdata when the joystick is detached.
// contains filtered or unexported fields
}
VirtualJoystickDesc is a structure that describes a virtual joystick.
type VirtualJoystickSensorDesc ¶
type VirtualJoystickSensorDesc struct {
Type SensorType // The type of this sensor.
Rate float32 // The update frequency of this sensor, may be 0.0f.
}
VirtualJoystickSensorDesc is a structure that describes a virtual joystick sensor.
type VirtualJoystickTouchpadDesc ¶
type VirtualJoystickTouchpadDesc struct {
NFingers uint16 // The number of simultaneous fingers on this touchpad.
// contains filtered or unexported fields
}
VirtualJoystickTouchpadDesc is a structure that describes a virtual joystick touchpad.
type Window ¶
type Window struct{}
Window is used as an opaque handle to a window.
func CreateWindow ¶
func CreateWindow(title string, w int32, h int32, flags WindowFlags) *Window
CreateWindow creates a window with the specified dimensions and flags.
func CreateWindowWithProperties ¶
func CreateWindowWithProperties(props PropertiesID) *Window
CreateWindowWithProperties creates a window with the specified properties.
func GLGetCurrentWindow ¶
func GLGetCurrentWindow() *Window
GLGetCurrentWindow returns the currently active OpenGL window on success or nil on failure.
func GetGrabbedWindow ¶
func GetGrabbedWindow() *Window
GetGrabbedWindow gets the window that currently has an input grab enabled.
func GetKeyboardFocus ¶
func GetKeyboardFocus() *Window
GetKeyboardFocus queries the window which currently has keyboard focus.
func GetMouseFocus ¶
func GetMouseFocus() *Window
GetMouseFocus gets the window which currently has mouse focus.
func GetRenderWindow ¶
GetRenderWindow gets the window associated with a renderer.
func GetWindowFromEvent ¶
GetWindowFromEvent returns the associated window with an event or nil if there is none.
func GetWindowFromID ¶
GetWindowFromID gets a window from a stored ID.
func GetWindowParent ¶
GetWindowParent gets parent of a window.
type WindowEvent ¶
type WindowEvent struct {
CommonEvent
WindowID WindowID // The associated window.
Data1 int32 // Event dependent data.
Data2 int32 // Event dependent data.
}
WindowEvent defines the window state change event data (event.window.*).
type WindowFlags ¶
type WindowFlags uint64
WindowFlags the flags on a window.
const ( WindowFullscreen WindowFlags = 0x0000000000000001 // Window is in fullscreen mode WindowOpenGL WindowFlags = 0x0000000000000002 // Window usable with OpenGL context WindowOccluded WindowFlags = 0x0000000000000004 // Window is occluded WindowHidden WindowFlags = 0x0000000000000008 // Window is neither mapped onto the desktop nor shown in the taskbar/dock/window list; SDL_ShowWindow() is required for it to become visible WindowBorderless WindowFlags = 0x0000000000000010 // No window decoration WindowResizable WindowFlags = 0x0000000000000020 // Window can be resized WindowMinimized WindowFlags = 0x0000000000000040 // Window is minimized WindowMaximized WindowFlags = 0x0000000000000080 // Window is maximized WindowMouseGrabbed WindowFlags = 0x0000000000000100 // Window has grabbed mouse input WindowInputFocus WindowFlags = 0x0000000000000200 // Window has input focus WindowMouseFocus WindowFlags = 0x0000000000000400 // Window has mouse focus WindowExternal WindowFlags = 0x0000000000000800 // Window not created by SDL WindowModal WindowFlags = 0x0000000000001000 // Window is modal WindowHighPixelDensity WindowFlags = 0x0000000000002000 // Window uses high pixel density back buffer if possible WindowMouseCapture WindowFlags = 0x0000000000004000 // Window has mouse captured (unrelated to MOUSE_GRABBED) WindowMouseRelativeMode WindowFlags = 0x0000000000008000 // Window has relative mode enabled WindowAlwaysOnTop WindowFlags = 0x0000000000010000 // Window should always be above others WindowUtility WindowFlags = 0x0000000000020000 // Window should be treated as a utility window, not showing in the task bar and window list WindowTooltip WindowFlags = 0x0000000000040000 // Window should be treated as a tooltip and does not get mouse or keyboard focus, requires a parent window WindowPopupMenu WindowFlags = 0x0000000000080000 // Window should be treated as a popup menu, requires a parent window WindowKeyboardGrabbed WindowFlags = 0x0000000000100000 // Window has grabbed keyboard input WindowFillDocument WindowFlags = 0x0000000000200000 // Window is in fill-document mode (Emscripten only), since SDL 3.4.0 WindowVulkan WindowFlags = 0x0000000010000000 // Window usable for Vulkan surface WindowMetal WindowFlags = 0x0000000020000000 // Window usable for Metal view WindowTransparent WindowFlags = 0x0000000040000000 // Window with transparent buffer WindowNotFocusable WindowFlags = 0x0000000080000000 // Window should not be focusable )
func GetWindowFlags ¶
func GetWindowFlags(window *Window) WindowFlags
GetWindowFlags returns a mask of the WindowFlags associated with window.
Example:
// true if the window has the "WindowResizable" flag
if sdl.GetWindowFlags(window)&sdl.WindowResizable == sdl.WindowResizable {
// ...
}
type WindowID ¶
type WindowID uint32
WindowID is a unique ID for a window.
func GetWindowID ¶
GetWindowID returns the ID of the window on success or 0 on failure.
Source Files
¶
- init.go
- sdl_assert.go
- sdl_asyncio.go
- sdl_atomic.go
- sdl_audio.go
- sdl_bits.go
- sdl_blendmode.go
- sdl_camera.go
- sdl_clipboard.go
- sdl_cpuinfo.go
- sdl_dialog.go
- sdl_endian.go
- sdl_error.go
- sdl_events.go
- sdl_filesystem.go
- sdl_gamepad.go
- sdl_gpu.go
- sdl_guid.go
- sdl_haptic.go
- sdl_hidapi.go
- sdl_hints.go
- sdl_init.go
- sdl_iostream.go
- sdl_joystick.go
- sdl_keyboard.go
- sdl_keycode.go
- sdl_locale.go
- sdl_log.go
- sdl_main.go
- sdl_messagebox.go
- sdl_metal.go
- sdl_misc.go
- sdl_mouse.go
- sdl_mutex.go
- sdl_pen.go
- sdl_pixels.go
- sdl_platform.go
- sdl_power.go
- sdl_process.go
- sdl_properties.go
- sdl_rect.go
- sdl_render.go
- sdl_scancode.go
- sdl_sensor.go
- sdl_stdinc.go
- sdl_storage.go
- sdl_surface.go
- sdl_system.go
- sdl_thread.go
- sdl_time.go
- sdl_timer.go
- sdl_touch.go
- sdl_tray.go
- sdl_version.go
- sdl_video.go