Documentation
¶
Index ¶
- Constants
- func BitsPerPixel(format int) int
- func ClearError()
- func CloseAudioDevice(device AudioDeviceID)
- func FreePalette(palette *Palette)
- func FreeRW(area *RWOps)
- func GameControllerClose(controller *GameController)
- func GameControllerEventState(state int) int
- func GameControllerHasSensor(controller *GameController, typ SensorType) bool
- func GameControllerIsSensorEnabled(controller *GameController, typ SensorType) bool
- func GameControllerMapping(gameController *GameController) (string, error)
- func GameControllerMappingForIndex(mappingIndex int) string
- func GameControllerNumMappings() int
- func GameControllerSetSensorEnabled(controller *GameController, typ SensorType, enabled bool) error
- func GetAudioDeviceName(device int, isCapture bool) (string, error)
- func GetAudioDriver(index int) (string, error)
- func GetDisplayBounds(displayIndex int, rect *Rect) error
- func GetDisplayUsableBounds(displayIndex int, rect *Rect) error
- func GetError() error
- func GetKeyboardState() []uint8
- func GetMouseState(x, y *int) uint32
- func GetNumAudioDevices(isCapture bool) int
- func GetNumAudioDrivers() int
- func GetNumRenderDrivers() (int, error)
- func GetNumTouchDevices() int
- func GetNumVideoDisplays() (int, error)
- func GetNumVideoDrivers() (int, error)
- func GetRelativeMouseMode() bool
- func GetRelativeMouseState(x, y *int) uint32
- func GetRenderDriverInfo(index int, info *RendererInfo) error
- func GetRendererInfo(renderer *Renderer, info *RendererInfo) error
- func GetRevision() string
- func GetVideoDriver(index int) string
- func HasIntersection(a, b Rect) bool
- func Init(flags InitFlag) error
- func InitSubSystem(flags InitFlag) error
- func IsGameController(joystickIndex int) bool
- func JoystickClose(joystick *Joystick)
- func LoadDollarTemplates(touchID TouchID, src *RWOps) (int, error)
- func LoadWAVRW(ops *RWOps, freeSrc bool, spec *AudioSpec) ([]byte, error)
- func MapRGB(format *PixelFormatS, r, g, b uint8) uint32
- func MapRGBA(format *PixelFormatS, r, g, b, a uint8) uint32
- func PauseAudioDevice(device AudioDeviceID, pause bool)
- func PixelLayout(format int) int
- func PixelOrder(format int) int
- func PointInRect(point Point, rect Rect) bool
- func PumpEvents()
- func PushEvent(event Event) (filtered bool, err error)
- func QueueAudio(device AudioDeviceID, data unsafe.Pointer, length int) error
- func Quit()
- func QuitSubSystem(flags InitFlag)
- func RecordGesture(touchID TouchID) bool
- func SaveAllDollarTemplates(dst *RWOps) (int, error)
- func SaveDollarTemplate(gestureID GestureID, dst *RWOps) error
- func SetError(format string, a ...interface{})
- func SetPaletteColors(palette *Palette, offset int, colors []Color) error
- func SetPixelFormatPalette(format *PixelFormatS, palette *Palette) error
- func SetRelativeMouseMode(enabled bool) error
- func VersionAtLeast(major, minor, patch uint8) bool
- func VersionNum(major, minor, patch uint8) int
- func VulkanGetDrawableSize(window *Window, w, h *int)
- func WarpMouseInWindow(window *Window, x, y int)
- func WindowPositionCenteredDisplay(displayIndex int) int
- func WindowPositionUndefinedDisplay(displayIndex int) int
- type AudioCallback
- type AudioDeviceEvent
- type AudioDeviceID
- type AudioFormat
- type AudioSpec
- type AudioStream
- type Color
- type CommonEvent
- type ControllerAxisEvent
- type ControllerButtonEvent
- type ControllerDeviceEvent
- type ControllerSensorEvent
- type ControllerTouchpadEvent
- type Destroyable
- type DollarGestureEvent
- type Event
- type EventAction
- type EventType
- type Finger
- type FingerID
- type GameController
- type GestureID
- type InitFlag
- type Joystick
- type JoystickID
- type KeyCode
- type KeyModifiers
- type KeySymbol
- type KeyboardEvent
- type MouseButtonEvent
- type MouseButtons
- type MouseMotionEvent
- type MultiGestureEvent
- type Palette
- type PixelFormat
- type PixelFormatS
- type PixelType
- type Point
- type RWOps
- type RWOpsType
- type Rect
- type Renderer
- func (r *Renderer) Clear() error
- func (r *Renderer) Copy(texture *Texture, srcRect, dstRect *Rect) error
- func (r *Renderer) CopyEx(texture *Texture, srcRect, dstRect *Rect, angle float64, center *Point, ...) error
- func (r *Renderer) CreateTextureFromSurface(surface *Surface) (*Texture, error)
- func (r *Renderer) Destroy()
- func (r *Renderer) DrawLine(x1, y1, x2, y2 int) error
- func (r *Renderer) DrawLines(points []*Point) error
- func (r *Renderer) DrawPoint(x, y int) error
- func (r *Renderer) DrawPoints(points []*Point) error
- func (r *Renderer) DrawRect(rect *Rect) error
- func (r *Renderer) DrawRects(rects []*Rect) error
- func (r *Renderer) FillRect(rect *Rect) error
- func (r *Renderer) FillRects(rects []*Rect) error
- func (r *Renderer) GetDrawColor() (red, green, blue, alpha uint8, err error)
- func (r *Renderer) Present()
- func (r *Renderer) SetDrawColor(red, green, blue, alpha uint8) error
- type RendererFlags
- type RendererFlip
- type RendererInfo
- type ScanCode
- type SensorID
- type SensorType
- type SubsystemType
- type Surface
- func (s *Surface) AlphaMod() (a uint8, err error)
- func (s *Surface) At(x, y int) color.Color
- func (s *Surface) BlitSurface(srcRect *Rect, dst *Surface, dstRect *Rect) error
- func (s *Surface) Bounds() image.Rectangle
- func (s *Surface) ClipRect() Rect
- func (s *Surface) ColorMod() (r, g, b uint8, err error)
- func (s *Surface) ColorModel() color.Model
- func (s *Surface) Convert(format *PixelFormatS) (*Surface, error)
- func (s *Surface) ConvertFormat(format PixelFormat) (*Surface, error)
- func (s *Surface) FillRect(rect *Rect, color uint32) error
- func (s *Surface) FillRects(rects []*Rect, color uint32) error
- func (s Surface) Format() PixelFormatS
- func (s *Surface) Free()
- func (s *Surface) Height() int
- func (s *Surface) Image() draw.Image
- func (s *Surface) Lock() error
- func (s *Surface) Pitch() int
- func (s *Surface) Pixels() []byte
- func (s *Surface) SetAlphaMod(a uint8) error
- func (s *Surface) SetClipRect(r *Rect) bool
- func (s *Surface) SetColorMod(r, g, b uint8) error
- func (s *Surface) SetPixelFormatPalette(palette *Palette) error
- func (s *Surface) Unlock()
- func (s *Surface) Width() int
- type Texture
- type TextureAccess
- type TextureModulate
- type TouchFingerEvent
- type TouchID
- type Version
- type WMInfo
- type WMInfoCocoa
- type WMInfoWin32
- type WMInfoXlib
- type Window
- type WindowEvent
- type WindowEventID
- type WindowFlags
Constants ¶
const ( Query = -1 Ignore = 0 Disable = 0 Enable = 1 )
const ( KeyCodeUnknown KeyCode = 0 KeyCodeReturn KeyCode = '\r' KeyCodeEscape KeyCode = '\033' KeyCodeBackspace KeyCode = '\b' KeyCodeTab KeyCode = '\t' KeyCodeSpace KeyCode = ' ' KeyCodeExclamationMark KeyCode = '!' KeyCodeDoubleQuote KeyCode = '"' KeyCodeHash KeyCode = '#' KeyCodePercent KeyCode = '%' KeyCodeDollar KeyCode = '$' KeyCodeAmpersand KeyCode = '&' KeyCodeQuote KeyCode = '\'' KeyCodeLeftParenthesis KeyCode = '(' KeyCodeRightParenthesis KeyCode = ')' KeyCodeAsterisk KeyCode = '*' KeyCodePlus KeyCode = '+' KeyCodeComma KeyCode = ',' KeyCodeMinus KeyCode = '-' KeyCodePeriod KeyCode = '.' KeyCodeSlash KeyCode = '/' KeyCode0 KeyCode = '0' KeyCode1 KeyCode = '1' KeyCode2 KeyCode = '2' KeyCode3 KeyCode = '3' KeyCode4 KeyCode = '4' KeyCode5 KeyCode = '5' KeyCode6 KeyCode = '6' KeyCode7 KeyCode = '7' KeyCode8 KeyCode = '8' KeyCode9 KeyCode = '9' KeyCodeColon KeyCode = ':' KeyCodeSemilon KeyCode = ';' KeyCodeLess KeyCode = '<' KeyCodeEquals KeyCode = '=' KeyCodeGreater KeyCode = '>' KeyCodeQuestionMark KeyCode = '?' KeyCodeAt KeyCode = '@' KeyCodeLeftBracket KeyCode = '[' KeyCodeBackslash KeyCode = '\\' KeyCodeRightBracket KeyCode = ']' KeyCodeCaret KeyCode = '^' KeyCodeUnderscore KeyCode = '_' KeyCodeBackquote KeyCode = '`' KeyCodeA KeyCode = 'a' KeyCodeB KeyCode = 'b' KeyCodeC KeyCode = 'c' KeyCodeD KeyCode = 'd' KeyCodeE KeyCode = 'e' KeyCodeF KeyCode = 'f' KeyCodeG KeyCode = 'g' KeyCodeH KeyCode = 'h' KeyCodeI KeyCode = 'i' KeyCodeJ KeyCode = 'j' KeyCodeK KeyCode = 'k' KeyCodeL KeyCode = 'l' KeyCodeM KeyCode = 'm' KeyCodeN KeyCode = 'n' KeyCodeO KeyCode = 'o' KeyCodeP KeyCode = 'p' KeyCodeQ KeyCode = 'q' KeyCodeR KeyCode = 'r' KeyCodeS KeyCode = 's' KeyCodeT KeyCode = 't' KeyCodeU KeyCode = 'u' KeyCodeV KeyCode = 'v' KeyCodeW KeyCode = 'w' KeyCodeX KeyCode = 'x' KeyCodeY KeyCode = 'y' KeyCodeZ KeyCode = 'z' KeyCodeCapsLock = KeyCodeToScanCodeMask | KeyCode(ScanCodeCapsLock) KeyCodeF1 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF1) KeyCodeF2 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF2) KeyCodeF3 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF3) KeyCodeF4 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF4) KeyCodeF5 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF5) KeyCodeF6 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF6) KeyCodeF7 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF7) KeyCodeF8 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF8) KeyCodeF9 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF9) KeyCodeF10 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF10) KeyCodeF11 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF11) KeyCodeF12 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF12) KeyCodePrintScreen = KeyCodeToScanCodeMask | KeyCode(ScanCodePrintScreen) KeyCodeScrollLock = KeyCodeToScanCodeMask | KeyCode(ScanCodeScrollLock) KeyCodePause = KeyCodeToScanCodeMask | KeyCode(ScanCodePause) KeyCodeInsert = KeyCodeToScanCodeMask | KeyCode(ScanCodeInsert) KeyCodeHome = KeyCodeToScanCodeMask | KeyCode(ScanCodeInsert) KeyCodePageUp = KeyCodeToScanCodeMask | KeyCode(ScanCodePageUp) KeyCodeDelete KeyCode = '\177' KeyCodeEnd = KeyCodeToScanCodeMask | KeyCode(ScanCodeEnd) KeyCodePageDown = KeyCodeToScanCodeMask | KeyCode(ScanCodePageDown) KeyCodeRight = KeyCodeToScanCodeMask | KeyCode(ScanCodeRight) KeyCodeLeft = KeyCodeToScanCodeMask | KeyCode(ScanCodeLeft) KeyCodeDown = KeyCodeToScanCodeMask | KeyCode(ScanCodeDown) KeyCodeUp = KeyCodeToScanCodeMask | KeyCode(ScanCodeUp) KeyCodeNumLockClear = KeyCodeToScanCodeMask | KeyCode(ScanCodeNumLockClear) KeyCodeKeyPadDivide = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadDivide) KeyCodeKeyPadMultiply = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadMultiply) KeyCodeKeyPadMinus = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadMinus) KeyCodeKeyPadPlus = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadPlus) KeyCodeKeyPadEnter = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadEnter) KeyCodeKeyPad1 = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPad1) KeyCodeKeyPad2 = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPad2) KeyCodeKeyPad3 = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPad3) KeyCodeKeyPad4 = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPad4) KeyCodeKeyPad5 = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPad5) KeyCodeKeyPad6 = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPad6) KeyCodeKeyPad7 = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPad7) KeyCodeKeyPad8 = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPad8) KeyCodeKeyPad9 = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPad9) KeyCodeKeyPad0 = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPad0) KeyCodeKeyPadPeriod = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadPeriod) KeyCodeApplication = KeyCodeToScanCodeMask | KeyCode(ScanCodeApplication) KeyCodePower = KeyCodeToScanCodeMask | KeyCode(ScanCodePower) KeyCodeKeyPadEquals = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadEquals) KeyCodeF13 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF13) KeyCodeF14 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF14) KeyCodeF15 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF15) KeyCodeF16 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF16) KeyCodeF17 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF17) KeyCodeF18 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF18) KeyCodeF19 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF19) KeyCodeF20 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF20) KeyCodeF21 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF21) KeyCodeF22 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF22) KeyCodeF23 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF23) KeyCodeF24 = KeyCodeToScanCodeMask | KeyCode(ScanCodeF24) KeyCodeExecute = KeyCodeToScanCodeMask | KeyCode(ScanCodeExecute) KeyCodeHelp = KeyCodeToScanCodeMask | KeyCode(ScanCodeHelp) KeyCodeMenu = KeyCodeToScanCodeMask | KeyCode(ScanCodeMenu) KeyCodeSelect = KeyCodeToScanCodeMask | KeyCode(ScanCodeSelect) KeyCodeStop = KeyCodeToScanCodeMask | KeyCode(ScanCodeStop) KeyCodeAgain = KeyCodeToScanCodeMask | KeyCode(ScanCodeAgain) KeyCodeUndo = KeyCodeToScanCodeMask | KeyCode(ScanCodeUndo) KeyCodeCut = KeyCodeToScanCodeMask | KeyCode(ScanCodeCut) KeyCodeCopy = KeyCodeToScanCodeMask | KeyCode(ScanCodeCopy) KeyCodePaste = KeyCodeToScanCodeMask | KeyCode(ScanCodePaste) KeyCodeFind = KeyCodeToScanCodeMask | KeyCode(ScanCodeFind) KeyCodeMute = KeyCodeToScanCodeMask | KeyCode(ScanCodeMute) KeyCodeVolumeUp = KeyCodeToScanCodeMask | KeyCode(ScanCodeVolumeUp) KeyCodeVolumeDown = KeyCodeToScanCodeMask | KeyCode(ScanCodeVolumeDown) KeyCodeKeyPadComma = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadComma) KeyCodeKeyPadEqualsAS400 = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadEqualsAS400) KeyCodeAlternateErase = KeyCodeToScanCodeMask | KeyCode(ScanCodeAlternateErase) KeyCodeSystemRequest = KeyCodeToScanCodeMask | KeyCode(ScanCodeSystemRequest) KeyCodeCancel = KeyCodeToScanCodeMask | KeyCode(ScanCodeCancel) KeyCodeClear = KeyCodeToScanCodeMask | KeyCode(ScanCodeClear) KeyCodePrior = KeyCodeToScanCodeMask | KeyCode(ScanCodePrior) KeyCodeReturn2 = KeyCodeToScanCodeMask | KeyCode(ScanCodeReturn2) KeyCodeSeparator = KeyCodeToScanCodeMask | KeyCode(ScanCodeSeparator) KeyCodeOut = KeyCodeToScanCodeMask | KeyCode(ScanCodeOut) KeyCodeOper = KeyCodeToScanCodeMask | KeyCode(ScanCodeOper) KeyCodeClearAgain = KeyCodeToScanCodeMask | KeyCode(ScanCodeClearAgain) KeyCodeCrSel = KeyCodeToScanCodeMask | KeyCode(ScanCodeCrSel) KeyCodeExSel = KeyCodeToScanCodeMask | KeyCode(ScanCodeExSel) KeyCodeKeyPad00 = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPad00) KeyCodeKeyPad000 = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPad000) KeyCodeThousandsSeparator = KeyCodeToScanCodeMask | KeyCode(ScanCodeThousandsSeparator) KeyCodeDecimalSeparator = KeyCodeToScanCodeMask | KeyCode(ScanCodeDecimalSeparator) KeyCodeCurrencyUnit = KeyCodeToScanCodeMask | KeyCode(ScanCodeCurrencyUnit) KeyCodeCurrencySubUnit = KeyCodeToScanCodeMask | KeyCode(ScanCodeCurrencySubUnit) KeyCodeKeyPadLeftParenthesis = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadLeftParenthesis) KeyCodeKeyPadRightParenthesis = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadRightParenthesis) KeyCodeKeyPadLeftBrace = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadLeftBrace) KeyCodeKeyPadRightBrace = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadRightBrace) KeyCodeKeyPadTab = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadTab) KeyCodeKeyPadBackspace = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadBackspace) KeyCodeKeyPadA = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadA) KeyCodeKeyPadB = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadB) KeyCodeKeyPadC = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadC) KeyCodeKeyPadD = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadD) KeyCodeKeyPadE = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadE) KeyCodeKeyPadF = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadF) KeyCodeKeyPadXor = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadXor) KeyCodeKeyPadPower = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadPower) KeyCodeKeyPadPercent = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadPercent) KeyCodeKeyPadLess = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadLess) KeyCodeKeyPadGreater = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadGreater) KeyCodeKeyPadAmpersand = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadAmpersand) KeyCodeKeyPadDoubleAmpersand = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadDoubleAmpersand) KeyCodeKeyPadVerticalBar = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadVerticalBar) KeyCodeKeyPadDoubleVerticalBar = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadDoubleVerticalBar) KeyCodeKeyPadColon = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadColon) KeyCodeKeyPadHash = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadHash) KeyCodeKeyPadSpace = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadSpace) KeyCodeKeyPadAt = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadAt) KeyCodeKeyPadExclamationMark = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadExclamationMark) KeyCodeKeyPadMemoryStore = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadMemoryStore) KeyCodeKeyPadMemoryRecall = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadMemoryRecall) KeyCodeKeyPadMemoryClear = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadMemoryClear) KeyCodeKeyPadMemoryAdd = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadMemoryAdd) KeyCodeKeyPadMemorySubtract = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadMemorySubtract) KeyCodeKeyPadMemoryMultiply = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadMemoryMultiply) KeyCodeKeyPadMemoryDivide = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadMemoryDivide) KeyCodeKeyPadPlusMinus = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadPlusMinus) KeyCodeKeyPadClear = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadClear) KeyCodeKeyPadClearEntry = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadClearEntry) KeyCodeKeyPadBinary = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadBinary) KeyCodeKeyPadOctal = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadOctal) KeyCodeKeyPadDecimal = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadDecimal) KeyCodeKeyPadHexadecimal = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyPadHexadecimal) KeyCodeLeftControl = KeyCodeToScanCodeMask | KeyCode(ScanCodeLeftControl) KeyCodeLeftShift = KeyCodeToScanCodeMask | KeyCode(ScanCodeLeftShift) KeyCodeLeftAlt = KeyCodeToScanCodeMask | KeyCode(ScanCodeLeftAlt) KeyCodeLeftGUI = KeyCodeToScanCodeMask | KeyCode(ScanCodeLeftGUI) KeyCodeRightControl = KeyCodeToScanCodeMask | KeyCode(ScanCodeRightControl) KeyCodeRightShift = KeyCodeToScanCodeMask | KeyCode(ScanCodeRightShift) KeyCodeRightAlt = KeyCodeToScanCodeMask | KeyCode(ScanCodeRightAlt) KeyCodeRightGUI = KeyCodeToScanCodeMask | KeyCode(ScanCodeRightGUI) KeyCodeMode = KeyCodeToScanCodeMask | KeyCode(ScanCodeMode) KeyCodeAudioNext = KeyCodeToScanCodeMask | KeyCode(ScanCodeAudioNext) KeyCodeAudioPrevious = KeyCodeToScanCodeMask | KeyCode(ScanCodeAudioPrevious) KeyCodeAudioStop = KeyCodeToScanCodeMask | KeyCode(ScanCodeAudioStop) KeyCodeAudioPlay = KeyCodeToScanCodeMask | KeyCode(ScanCodeAudioPlay) KeyCodeAudioMute = KeyCodeToScanCodeMask | KeyCode(ScanCodeAudioMute) KeyCodeMediaSelect = KeyCodeToScanCodeMask | KeyCode(ScanCodeMediaSelect) KeyCodeWWW = KeyCodeToScanCodeMask | KeyCode(ScanCodeWWW) KeyCodeMail = KeyCodeToScanCodeMask | KeyCode(ScanCodeMail) KeyCodeCalculator = KeyCodeToScanCodeMask | KeyCode(ScanCodeCalculator) KeyCodeComputer = KeyCodeToScanCodeMask | KeyCode(ScanCodeComputer) KeyCodeApplicationControlSearch = KeyCodeToScanCodeMask | KeyCode(ScanCodeApplicationControlSearch) KeyCodeApplicationControlHome = KeyCodeToScanCodeMask | KeyCode(ScanCodeApplicationControlHome) KeyCodeApplicationControlBack = KeyCodeToScanCodeMask | KeyCode(ScanCodeApplicationControlBack) KeyCodeApplicationControlForward = KeyCodeToScanCodeMask | KeyCode(ScanCodeApplicationControlForward) KeyCodeApplicationControlStop = KeyCodeToScanCodeMask | KeyCode(ScanCodeApplicationControlStop) KeyCodeApplicationControlRefresh = KeyCodeToScanCodeMask | KeyCode(ScanCodeApplicationControlRefresh) KeyCodeApplicationControlBookmarks = KeyCodeToScanCodeMask | KeyCode(ScanCodeApplicationControlBookmarks) KeyCodeBrightnessDown = KeyCodeToScanCodeMask | KeyCode(ScanCodeBrightnessDown) KeyCodeBrightnessUp = KeyCodeToScanCodeMask | KeyCode(ScanCodeBrightnessUp) KeyCodeDisplaySwitch = KeyCodeToScanCodeMask | KeyCode(ScanCodeDisplaySwitch) KeyCodeKeyboardIlluminationToggle = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyboardIlluminationToggle) KeyCodeKeyboardIlluminationDown = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyboardIlluminationDown) KeyCodeKeyboardIlluminationUp = KeyCodeToScanCodeMask | KeyCode(ScanCodeKeyboardIlluminationUp) KeyCodeEject = KeyCodeToScanCodeMask | KeyCode(ScanCodeEject) KeyCodeSleep = KeyCodeToScanCodeMask | KeyCode(ScanCodeSleep) KeyCodeApplication1 = KeyCodeToScanCodeMask | KeyCode(ScanCodeApplication1) KeyCodeApplication2 = KeyCodeToScanCodeMask | KeyCode(ScanCodeApplication2) KeyCodeAudioRewind = KeyCodeToScanCodeMask | KeyCode(ScanCodeAudioRewind) KeyCodeAudioFastForward = KeyCodeToScanCodeMask | KeyCode(ScanCodeAudioFastForward) )
const ( KeyModifierControl = KeyModifierLeftControl | KeyModifierRightControl KeyModifierShift = KeyModifierLeftShift | KeyModifierRightShift KeyModifierAlt = KeyModifierLeftAlt | KeyModifierRightAlt KeyModifierGUI = KeyModifierLeftGUI | KeyModifierRightGUI )
const ( MouseButtonLeft = 1 MouseButtonMiddle = 2 MouseButtonRight = 3 MouseButtonExtra1 = 4 MouseButtonExtra2 = 5 )
const ( AlphaOpaque = 255 AlphaTransparent = 0 )
const ( BitmapOrderNone = iota BitmapOrder4321 BitmapOrder1234 )
const ( PackedOrderNone = iota PackedOrderXRGB PackedOrderRGBX PackedOrderARGB PackedOrderRGBA PackedOrderXBGR PackedOrderBGRX PackedOrderABGR PackedOrderBGRA )
const ( ArrayOrderNone = iota ArrayOrderRGB ArrayOrderRGBA ArrayOrderARGB ArrayOrderBGR ArrayOrderBGRA ArrayOrderABGR )
const ( PackedLayoutNone = iota PackedLayout332 PackedLayout4444 PackedLayout1555 PackedLayout5551 PackedLayout565 PackedLayout8888 PackedLayout2101010 PackedLayout1010102 )
const ( PixelFormatUnknown PixelFormat = 0 PixelFormatIndex1LSB = (1 << 28) | (PixelFormat(PixelTypeIndex1) << 24) | (BitmapOrder4321 << 20) | (PackedLayoutNone << 16) | (1 << 8) | 0 PixelFormatIndex1MSB = (1 << 28) | (PixelFormat(PixelTypeIndex1) << 24) | (BitmapOrder1234 << 20) | (PackedLayoutNone << 16) | (1 << 8) | 0 PixelFormatIndex4LSB = (1 << 28) | (PixelFormat(PixelTypeIndex4) << 24) | (BitmapOrder4321 << 20) | (PackedLayoutNone << 16) | (4 << 8) | 0 PixelFormatIndex4MSB = (1 << 28) | (PixelFormat(PixelTypeIndex4) << 24) | (BitmapOrder1234 << 20) | (PackedLayoutNone << 16) | (4 << 8) | 0 PixelFormatIndex8 = (1 << 28) | (PixelFormat(PixelTypeIndex8) << 24) | (BitmapOrderNone << 20) | (PackedLayoutNone << 16) | (8 << 8) | 1 PixelFormatRGB332 = (1 << 28) | (PixelFormat(PixelTypePacked8) << 24) | (PackedOrderXRGB << 20) | (PackedLayout332 << 16) | (8 << 8) | 1 PixelFormatRGB444 = (1 << 28) | (PixelFormat(PixelTypePacked16) << 24) | (PackedOrderXRGB << 20) | (PackedLayout4444 << 16) | (12 << 8) | 2 PixelFormatRGB555 = (1 << 28) | (PixelFormat(PixelTypePacked16) << 24) | (PackedOrderXRGB << 20) | (PackedLayout1555 << 16) | (15 << 8) | 2 PixelFormatBGR555 = (1 << 28) | (PixelFormat(PixelTypePacked16) << 24) | (PackedOrderXBGR << 20) | (PackedLayout1555 << 16) | (15 << 8) | 2 PixelFormatARGB4444 = (1 << 28) | (PixelFormat(PixelTypePacked16) << 24) | (PackedOrderARGB << 20) | (PackedLayout4444 << 16) | (16 << 8) | 2 PixelFormatRGBA4444 = (1 << 28) | (PixelFormat(PixelTypePacked16) << 24) | (PackedOrderRGBA << 20) | (PackedLayout4444 << 16) | (16 << 8) | 2 PixelFormatABGR4444 = (1 << 28) | (PixelFormat(PixelTypePacked16) << 24) | (PackedOrderABGR << 20) | (PackedLayout4444 << 16) | (16 << 8) | 2 PixelFormatBGRA4444 = (1 << 28) | (PixelFormat(PixelTypePacked16) << 24) | (PackedOrderBGRA << 20) | (PackedLayout4444 << 16) | (16 << 8) | 2 PixelFormatARGB1555 = (1 << 28) | (PixelFormat(PixelTypePacked16) << 24) | (PackedOrderARGB << 20) | (PackedLayout1555 << 16) | (16 << 8) | 2 PixelFormatRGBA5551 = (1 << 28) | (PixelFormat(PixelTypePacked16) << 24) | (PackedOrderRGBA << 20) | (PackedLayout5551 << 16) | (16 << 8) | 2 PixelFormatABGR1555 = (1 << 28) | (PixelFormat(PixelTypePacked16) << 24) | (PackedOrderABGR << 20) | (PackedLayout1555 << 16) | (16 << 8) | 2 PixelFormatBGRA5551 = (1 << 28) | (PixelFormat(PixelTypePacked16) << 24) | (PackedOrderBGRA << 20) | (PackedLayout5551 << 16) | (16 << 8) | 2 PixelFormatRGB565 = (1 << 28) | (PixelFormat(PixelTypePacked16) << 24) | (PackedOrderXRGB << 20) | (PackedLayout565 << 16) | (16 << 8) | 2 PixelFormatBGR565 = (1 << 28) | (PixelFormat(PixelTypePacked16) << 24) | (PackedOrderXBGR << 20) | (PackedLayout565 << 16) | (16 << 8) | 2 PixelFormatRGB24 = (1 << 28) | (PixelFormat(PixelTypeArrayUnsigned8) << 24) | (ArrayOrderRGB << 20) | (PackedLayoutNone << 16) | (24 << 8) | 3 PixelFormatBGR24 = (1 << 28) | (PixelFormat(PixelTypeArrayUnsigned8) << 24) | (ArrayOrderBGR << 20) | (PackedLayoutNone << 16) | (24 << 8) | 3 PixelFormatRGB888 = (1 << 28) | (PixelFormat(PixelTypePacked32) << 24) | (PackedOrderXRGB << 20) | (PackedLayout8888 << 16) | (24 << 8) | 4 PixelFormatRGBX8888 = (1 << 28) | (PixelFormat(PixelTypePacked32) << 24) | (PackedOrderRGBX << 20) | (PackedLayout8888 << 16) | (24 << 8) | 4 PixelFormatBGR888 = (1 << 28) | (PixelFormat(PixelTypePacked32) << 24) | (PackedOrderXBGR << 20) | (PackedLayout8888 << 16) | (24 << 8) | 4 PixelFormatBGRX8888 = (1 << 28) | (PixelFormat(PixelTypePacked32) << 24) | (PackedOrderBGRX << 20) | (PackedLayout8888 << 16) | (24 << 8) | 4 PixelFormatARGB8888 = (1 << 28) | (PixelFormat(PixelTypePacked32) << 24) | (PackedOrderARGB << 20) | (PackedLayout8888 << 16) | (32 << 8) | 4 PixelFormatRGBA8888 = (1 << 28) | (PixelFormat(PixelTypePacked32) << 24) | (PackedOrderRGBA << 20) | (PackedLayout8888 << 16) | (32 << 8) | 4 PixelFormatABGR8888 = (1 << 28) | (PixelFormat(PixelTypePacked32) << 24) | (PackedOrderABGR << 20) | (PackedLayout8888 << 16) | (32 << 8) | 4 PixelFormatBGRA8888 = (1 << 28) | (PixelFormat(PixelTypePacked32) << 24) | (PackedOrderBGRA << 20) | (PackedLayout8888 << 16) | (32 << 8) | 4 PixelFormatARGB2101010 = (1 << 28) | (PixelFormat(PixelTypePacked32) << 24) | (PackedOrderARGB << 20) | (PackedLayout2101010 << 16) | (32 << 8) | 4 // Planar mode: Y + V + U (3 planes) PixelFormatYV12 PixelFormat = ('2' << 24) | ('1' << 16) | ('V' << 8) | 'Y' // Planar mode: Y + U + V (3 planes) PixelFormatIYUV PixelFormat = ('V' << 24) | ('U' << 16) | ('Y' << 8) | 'I' // Packed mode: Y0+U0+Y1+V0 (1 plane) PixelFormatYUY2 PixelFormat = ('2' << 24) | ('Y' << 16) | ('U' << 8) | 'Y' // Packed mode: U0+Y0+V0+Y1 (1 plane) PixelFormatUYVY PixelFormat = ('Y' << 24) | ('V' << 16) | ('Y' << 8) | 'U' // Packed mode: Y0+V0+Y1+U0 (1 plane) PixelFormatYVYU PixelFormat = ('U' << 24) | ('Y' << 16) | ('V' << 8) | 'Y' // Planar mode: Y + U/V interleaved (2 planes) PixelFormatNV12 PixelFormat = ('2' << 24) | ('1' << 16) | ('V' << 8) | 'N' // Planar mode: Y + V/U interleaved (2 planes) PixelFormatNV21 PixelFormat = ('1' << 24) | ('2' << 16) | ('V' << 8) | 'N' // Android video texture format PixelFormatExternalOES PixelFormat = (' ' << 24) | ('S' << 16) | ('E' << 8) | 'O' )
const ( WindowPositionCenteredMask int = 0x2fff0000 WindowPositionCentered int = WindowPositionCenteredMask WindowPositionUndefinedMask int = 0x1fff0000 WindowPositionUndefined int = WindowPositionUndefinedMask )
const (
KeyCodeToScanCodeMask = 1 << 30
)
const (
NumScanCodes = 512
)
Variables ¶
This section is empty.
Functions ¶
func BitsPerPixel ¶
func ClearError ¶
func ClearError()
func CloseAudioDevice ¶ added in v0.1.1
func CloseAudioDevice(device AudioDeviceID)
func FreePalette ¶ added in v0.1.1
func FreePalette(palette *Palette)
func GameControllerClose ¶ added in v0.1.1
func GameControllerClose(controller *GameController)
func GameControllerEventState ¶ added in v0.1.1
func GameControllerHasSensor ¶ added in v0.1.1
func GameControllerHasSensor(controller *GameController, typ SensorType) bool
func GameControllerIsSensorEnabled ¶ added in v0.1.1
func GameControllerIsSensorEnabled(controller *GameController, typ SensorType) bool
func GameControllerMapping ¶ added in v0.1.1
func GameControllerMapping(gameController *GameController) (string, error)
func GameControllerMappingForIndex ¶ added in v0.1.1
func GameControllerNumMappings ¶ added in v0.1.1
func GameControllerNumMappings() int
func GameControllerSetSensorEnabled ¶ added in v0.1.1
func GameControllerSetSensorEnabled(controller *GameController, typ SensorType, enabled bool) error
func GetAudioDriver ¶ added in v0.1.1
func GetDisplayBounds ¶
func GetDisplayUsableBounds ¶ added in v0.1.1
GetDisplayUsableBounds gets the usable desktop area represented by a display.
The primary display (`displayIndex` zero) is always located at 0,0.
This is the same area as GetDisplayBounds reports, but with portions reserved by the system removed. For example, on Apple's macOS, this subtracts the area occupied by the menu bar and dock.
Setting a window to be fullscreen generally bypasses these unusable areas, so these are good guidelines for the maximum space available to a non-fullscreen window.
The parameter `rect` is ignored if it is nil.
This function also returns -1 if the parameter `displayIndex` is out of range.
displayIndex is the index of the display to query the usable bounds from. rect is the Rect structure filled in with the display bounds
This function is available since SDL 2.0.5.
func GetKeyboardState ¶ added in v0.1.1
func GetKeyboardState() []uint8
func GetMouseState ¶
func GetNumAudioDevices ¶ added in v0.1.1
func GetNumAudioDrivers ¶ added in v0.1.1
func GetNumAudioDrivers() int
func GetNumRenderDrivers ¶
func GetNumTouchDevices ¶
func GetNumTouchDevices() int
func GetNumVideoDisplays ¶
func GetNumVideoDrivers ¶
func GetRelativeMouseMode ¶ added in v0.1.1
func GetRelativeMouseMode() bool
func GetRelativeMouseState ¶ added in v0.1.1
func GetRenderDriverInfo ¶
func GetRenderDriverInfo(index int, info *RendererInfo) error
func GetRendererInfo ¶
func GetRendererInfo(renderer *Renderer, info *RendererInfo) error
func GetRevision ¶
func GetRevision() string
func GetVideoDriver ¶
func HasIntersection ¶
func InitSubSystem ¶
func IsGameController ¶ added in v0.1.1
func JoystickClose ¶ added in v0.1.1
func JoystickClose(joystick *Joystick)
func MapRGB ¶
func MapRGB(format *PixelFormatS, r, g, b uint8) uint32
func MapRGBA ¶
func MapRGBA(format *PixelFormatS, r, g, b, a uint8) uint32
func PauseAudioDevice ¶ added in v0.1.1
func PauseAudioDevice(device AudioDeviceID, pause bool)
func PixelLayout ¶
func PixelOrder ¶
func PointInRect ¶
func PumpEvents ¶ added in v0.1.1
func PumpEvents()
func QueueAudio ¶ added in v0.1.1
func QueueAudio(device AudioDeviceID, data unsafe.Pointer, length int) error
func QuitSubSystem ¶
func QuitSubSystem(flags InitFlag)
func RecordGesture ¶
func SaveAllDollarTemplates ¶
func SaveDollarTemplate ¶
func SetPaletteColors ¶ added in v0.1.1
func SetPixelFormatPalette ¶ added in v0.1.1
func SetPixelFormatPalette(format *PixelFormatS, palette *Palette) error
func SetRelativeMouseMode ¶ added in v0.1.1
func VersionAtLeast ¶
func VersionNum ¶
func VulkanGetDrawableSize ¶ added in v0.1.1
func WarpMouseInWindow ¶ added in v0.1.1
Types ¶
type AudioCallback ¶ added in v0.1.1
type AudioDeviceEvent ¶
func (AudioDeviceEvent) String ¶
func (e AudioDeviceEvent) String() string
type AudioFormat ¶ added in v0.1.1
type AudioFormat uint16
const ( AudioU8 AudioFormat = 0x0008 AudioS8 AudioFormat = 0x8008 AudioU16LSB AudioFormat = 0x0010 AudioS16LSB AudioFormat = 0x8010 AudioU16MSB AudioFormat = 0x1010 AudioS16MSB AudioFormat = 0x9010 AudioU16 = AudioU16LSB AudioS16 = AudioS16LSB AudioS32LSB AudioFormat = 0x8020 AudioS32MSB AudioFormat = 0x9020 AudioS32 = AudioS32LSB AudioF32LSB AudioFormat = 0x8120 AudioF32MSB AudioFormat = 0x9120 AudioF32 = AudioF32LSB )
type AudioSpec ¶ added in v0.1.1
type AudioSpec struct { Frequency int32 Format AudioFormat Channels uint8 Silence uint8 Samples uint16 Padding uint16 Size uint32 Callback AudioCallback UserData unsafe.Pointer }
type AudioStream ¶ added in v0.1.1
type AudioStream interface { Put([]byte) error Get([]byte) (int, error) Available() int Flush() error Clear() Free() io.Writer io.Reader io.Closer }
func NewAudioStream ¶ added in v0.1.1
func NewAudioStream(srcFormat AudioFormat, srcChannels, srcRate int, dstFormat AudioFormat, dstChannels, dstRate int) (AudioStream, error)
type CommonEvent ¶
func PollEvent ¶
func PollEvent() *CommonEvent
func (CommonEvent) String ¶
func (e CommonEvent) String() string
type ControllerAxisEvent ¶ added in v0.1.1
type ControllerAxisEvent struct { Type EventType Timestamp time.Time Which JoystickID Axis uint8 Value int16 // contains filtered or unexported fields }
func (ControllerAxisEvent) String ¶ added in v0.1.1
func (e ControllerAxisEvent) String() string
type ControllerButtonEvent ¶ added in v0.1.1
type ControllerButtonEvent struct { Type EventType Timestamp time.Time Which JoystickID Button uint8 State uint8 // contains filtered or unexported fields }
func (ControllerButtonEvent) String ¶ added in v0.1.1
func (e ControllerButtonEvent) String() string
type ControllerDeviceEvent ¶ added in v0.1.1
func (ControllerDeviceEvent) String ¶ added in v0.1.1
func (e ControllerDeviceEvent) String() string
type ControllerSensorEvent ¶ added in v0.1.1
type ControllerSensorEvent struct { Type EventType Timestamp time.Time Which JoystickID Sensor SensorType Data [3]float32 }
func (ControllerSensorEvent) String ¶ added in v0.1.1
func (e ControllerSensorEvent) String() string
type ControllerTouchpadEvent ¶ added in v0.1.1
type ControllerTouchpadEvent struct { Type EventType Timestamp time.Time Which JoystickID Touchpad int32 Finger int32 X float32 Y float32 Pressure float32 }
func (ControllerTouchpadEvent) String ¶ added in v0.1.1
func (e ControllerTouchpadEvent) String() string
type Destroyable ¶
type Destroyable interface {
Destroy()
}
type DollarGestureEvent ¶
type DollarGestureEvent struct { Type EventType Timestamp time.Time TouchID TouchID GestureID GestureID NumFingers uint32 Error float32 X float32 Y float32 }
func (DollarGestureEvent) String ¶
func (e DollarGestureEvent) String() string
type Event ¶
type Event interface {
// contains filtered or unexported methods
}
func PeepEvents ¶ added in v0.1.1
func PeepEvents(n uint, action EventAction, min, max EventType) ([]Event, error)
type EventAction ¶ added in v0.1.1
type EventAction uint32
const ( AddEvent EventAction = C.SDL_ADDEVENT PeekEvent EventAction = C.SDL_PEEKEVENT GetEvent EventAction = C.SDL_GETEVENT )
type EventType ¶
type EventType uint32
const ( EventControllerAxisMotion EventType = 0x650 + iota EventControllerButtonDown EventControllerButtonUp EventControllerDeviceAdded EventControllerDeviceRemoved EventControllerDeviceRemapped EventControllerTouchpadDown EventControllerTouchpadMotion EventControllerTouchpadUp EventControllerSensorUpdate )
const (
EventLastEvent EventType = 0xffff
)
type GameController ¶ added in v0.1.1
type GameController = C.SDL_GameController
func GameControllerFromInstanceID ¶ added in v0.1.1
func GameControllerFromInstanceID(joyID JoystickID) (*GameController, error)
func GameControllerOpen ¶ added in v0.1.1
func GameControllerOpen(joystickIndex int) (*GameController, error)
type InitFlag ¶
type InitFlag uint32
const ( InitTimer InitFlag = 0x00000001 InitAudio InitFlag = 0x00000010 InitVideo InitFlag = 0x00000020 InitJoystick InitFlag = 0x00000200 InitHaptic InitFlag = 0x00001000 InitGameController InitFlag = 0x00002000 InitEvents InitFlag = 0x00004000 InitNoParachute InitFlag = 0x00100000 InitEverything InitFlag = InitTimer | InitAudio | InitVideo | InitJoystick | InitHaptic | InitGameController | InitEvents )
type JoystickID ¶ added in v0.1.1
type JoystickID int32
func JoystickInstanceID ¶ added in v0.1.1
func JoystickInstanceID(joystick *Joystick) (JoystickID, error)
type KeyModifiers ¶
type KeyModifiers uint16
const ( KeyModifierLeftShift KeyModifiers = 0x0001 << iota KeyModifierRightShift )
const ( KeyModifierLeftControl KeyModifiers = 0x0040 << iota KeyModifierRightControl KeyModifierLeftAlt KeyModifierRightAlt KeyModifierLeftGUI KeyModifierRightGUI KeyModifierNumLock KeyModifierCapsLock KeyModifierMode KeyModifierReserved )
const (
KeyModifierNone KeyModifiers = 0
)
type KeySymbol ¶
type KeySymbol struct { Scancode ScanCode Keycode KeyCode Modifiers KeyModifiers }
type KeyboardEvent ¶
type KeyboardEvent struct { Type EventType Timestamp time.Time WindowID int Pressed bool Repeat uint KeySymbol KeySymbol }
func (KeyboardEvent) String ¶
func (e KeyboardEvent) String() string
type MouseButtonEvent ¶
type MouseButtonEvent struct { Type EventType Timestamp time.Time WindowID int Which int Button int Pressed bool Clicks int X int Y int }
func (MouseButtonEvent) String ¶
func (e MouseButtonEvent) String() string
type MouseButtons ¶
func (MouseButtons) String ¶
func (b MouseButtons) String() string
type MouseMotionEvent ¶
type MouseMotionEvent struct { Type EventType Timestamp time.Time WindowID int Which int Buttons MouseButtons X int Y int DeltaX int DeltaY int }
func (MouseMotionEvent) String ¶
func (e MouseMotionEvent) String() string
type MultiGestureEvent ¶
type MultiGestureEvent struct { Type EventType Timestamp time.Time TouchID TouchID Angle float32 Distance float32 X float32 Y float32 NumFingers uint16 Padding uint16 }
func (MultiGestureEvent) String ¶
func (e MultiGestureEvent) String() string
type Palette ¶
type Palette struct {
// contains filtered or unexported fields
}
func AllocPalette ¶ added in v0.1.1
type PixelFormat ¶
type PixelFormat uint32
var ( PixelFormatRGBA32 PixelFormat PixelFormatARGB32 PixelFormat PixelFormatBGRA32 PixelFormat PixelFormatABGR32 PixelFormat )
func (PixelFormat) IsFourCC ¶
func (f PixelFormat) IsFourCC() bool
func (PixelFormat) PixelType ¶
func (f PixelFormat) PixelType(format int) PixelType
func (PixelFormat) String ¶ added in v0.1.1
func (f PixelFormat) String() string
type PixelFormatS ¶
type PixelFormatS struct { RMask uint32 GMask uint32 BMask uint32 AMask uint32 RLoss uint8 GLoss uint8 BLoss uint8 ALoss uint8 RShift uint8 GShift uint8 BShift uint8 AShift uint8 // contains filtered or unexported fields }
func AllocFormat ¶
func AllocFormat(format PixelFormat) (*PixelFormatS, error)
func (PixelFormatS) BytesPerPixel ¶
func (f PixelFormatS) BytesPerPixel() int
func (PixelFormatS) Format ¶
func (f PixelFormatS) Format() PixelFormat
func (*PixelFormatS) Free ¶
func (f *PixelFormatS) Free()
func (PixelFormatS) Palette ¶ added in v0.1.1
func (f PixelFormatS) Palette() []Color
func (*PixelFormatS) SetPalette ¶ added in v0.1.1
func (f *PixelFormatS) SetPalette(palette *Palette) error
type Renderer ¶
type Renderer C.struct_SDL_Renderer
func CreateRenderer ¶
func CreateRenderer(window *Window, index int, flags RendererFlags) (*Renderer, error)
func (*Renderer) CreateTextureFromSurface ¶
func (*Renderer) DrawPoints ¶
func (*Renderer) GetDrawColor ¶
func (*Renderer) SetDrawColor ¶
type RendererFlags ¶
type RendererFlags uint32
const ( RendererSoftware RendererFlags = 1 << iota RendererAccelerated RendererPresentVSync RendererTargetTexture )
type RendererFlip ¶
type RendererFlip uint32
const ( FlipNone RendererFlip = iota FlipHorizontal FlipVertical )
type RendererInfo ¶
type RendererInfo struct { Flags RendererFlags NumTextureFormats uint32 TextureFormats [16]PixelFormat MaxTextureWidth int32 MaxTextureHeight int32 Name string // contains filtered or unexported fields }
type ScanCode ¶
type ScanCode uint
const ( ScanCodeA ScanCode = 4 + iota ScanCodeB ScanCodeC ScanCodeD ScanCodeE ScanCodeF ScanCodeG ScanCodeH ScanCodeI ScanCodeJ ScanCodeK ScanCodeL ScanCodeM ScanCodeN ScanCodeO ScanCodeP ScanCodeQ ScanCodeR ScanCodeS ScanCodeT ScanCodeU ScanCodeV ScanCodeW ScanCodeX ScanCodeY ScanCodeZ ScanCode1 ScanCode2 ScanCode3 ScanCode4 ScanCode5 ScanCode6 ScanCode7 ScanCode8 ScanCode9 ScanCode0 ScanCodeReturn ScanCodeEscape ScanCodeBackspace ScanCodeTab ScanCodeSpace ScanCodeMinus ScanCodeEquals ScanCodeLeftBracket ScanCodeRightBracket ScanCodeBackslash ScanCodeNonUSHash ScanCodeSemicolon ScanCodeApostrophe ScanCodeGrave ScanCodeComma ScanCodePeriod ScanCodeSlash ScanCodeCapsLock ScanCodeF1 ScanCodeF2 ScanCodeF3 ScanCodeF4 ScanCodeF5 ScanCodeF6 ScanCodeF7 ScanCodeF8 ScanCodeF9 ScanCodeF10 ScanCodeF11 ScanCodeF12 ScanCodePrintScreen ScanCodeScrollLock ScanCodePause ScanCodeInsert ScanCodeHome ScanCodePageUp ScanCodeDelete ScanCodeEnd ScanCodePageDown ScanCodeRight ScanCodeLeft ScanCodeDown ScanCodeUp ScanCodeNumLockClear ScanCodeKeyPadDivide ScanCodeKeyPadMultiply ScanCodeKeyPadMinus ScanCodeKeyPadPlus ScanCodeKeyPadEnter ScanCodeKeyPad1 ScanCodeKeyPad2 ScanCodeKeyPad3 ScanCodeKeyPad4 ScanCodeKeyPad5 ScanCodeKeyPad6 ScanCodeKeyPad7 ScanCodeKeyPad8 ScanCodeKeyPad9 ScanCodeKeyPad0 ScanCodeKeyPadPeriod ScanCodeNonUSBackslash ScanCodeApplication ScanCodePower ScanCodeKeyPadEquals ScanCodeF13 ScanCodeF14 ScanCodeF15 ScanCodeF16 ScanCodeF17 ScanCodeF18 ScanCodeF19 ScanCodeF20 ScanCodeF21 ScanCodeF22 ScanCodeF23 ScanCodeF24 ScanCodeExecute ScanCodeHelp ScanCodeMenu ScanCodeSelect ScanCodeStop ScanCodeAgain ScanCodeUndo ScanCodeCut ScanCodeCopy ScanCodePaste ScanCodeFind ScanCodeMute ScanCodeVolumeUp ScanCodeVolumeDown ScanCodeKeyPadComma ScanCodeKeyPadEqualsAS400 ScanCodeInternational1 ScanCodeInternational2 ScanCodeInternational3 ScanCodeInternational4 ScanCodeInternational5 ScanCodeInternational6 ScanCodeInternational7 ScanCodeInternational8 ScanCodeInternational9 ScanCodeLanguage1 ScanCodeLanguage2 ScanCodeLanguage3 ScanCodeLanguage4 ScanCodeLanguage5 ScanCodeLanguage6 ScanCodeLanguage7 ScanCodeLanguage8 ScanCodeLanguage9 ScanCodeAlternateErase ScanCodeSystemRequest ScanCodeCancel ScanCodeClear ScanCodePrior ScanCodeReturn2 ScanCodeSeparator ScanCodeOut ScanCodeOper ScanCodeClearAgain ScanCodeCrSel ScanCodeExSel )
const ( ScanCodeKeyPad00 ScanCode = 176 + iota ScanCodeKeyPad000 ScanCodeThousandsSeparator ScanCodeDecimalSeparator ScanCodeCurrencyUnit ScanCodeCurrencySubUnit ScanCodeKeyPadLeftParenthesis ScanCodeKeyPadRightParenthesis ScanCodeKeyPadLeftBrace ScanCodeKeyPadRightBrace ScanCodeKeyPadTab ScanCodeKeyPadBackspace ScanCodeKeyPadA ScanCodeKeyPadB ScanCodeKeyPadC ScanCodeKeyPadD ScanCodeKeyPadE ScanCodeKeyPadF ScanCodeKeyPadXor ScanCodeKeyPadPower ScanCodeKeyPadPercent ScanCodeKeyPadLess ScanCodeKeyPadGreater ScanCodeKeyPadAmpersand ScanCodeKeyPadDoubleAmpersand ScanCodeKeyPadVerticalBar ScanCodeKeyPadDoubleVerticalBar ScanCodeKeyPadColon ScanCodeKeyPadHash ScanCodeKeyPadSpace ScanCodeKeyPadAt ScanCodeKeyPadExclamationMark ScanCodeKeyPadMemoryStore ScanCodeKeyPadMemoryRecall ScanCodeKeyPadMemoryClear ScanCodeKeyPadMemoryAdd ScanCodeKeyPadMemorySubtract ScanCodeKeyPadMemoryMultiply ScanCodeKeyPadMemoryDivide ScanCodeKeyPadPlusMinus ScanCodeKeyPadClear ScanCodeKeyPadClearEntry ScanCodeKeyPadBinary ScanCodeKeyPadOctal ScanCodeKeyPadDecimal ScanCodeKeyPadHexadecimal )
const ( ScanCodeMode ScanCode = 257 + iota ScanCodeAudioNext ScanCodeAudioPrevious ScanCodeAudioStop ScanCodeAudioPlay ScanCodeAudioMute ScanCodeMediaSelect ScanCodeWWW ScanCodeMail ScanCodeCalculator ScanCodeComputer ScanCodeApplicationControlSearch ScanCodeApplicationControlHome ScanCodeApplicationControlBack ScanCodeApplicationControlForward ScanCodeApplicationControlStop ScanCodeApplicationControlRefresh ScanCodeApplicationControlBookmarks ScanCodeBrightnessDown ScanCodeBrightnessUp ScanCodeDisplaySwitch ScanCodeKeyboardIlluminationToggle ScanCodeKeyboardIlluminationDown ScanCodeKeyboardIlluminationUp ScanCodeEject ScanCodeSleep ScanCodeApplication1 ScanCodeApplication2 ScanCodeAudioRewind ScanCodeAudioFastForward )
const (
ScanCodeUnknown ScanCode = 0
)
type SensorType ¶ added in v0.1.1
type SensorType uint32
const ( SensorUnknown SensorType = iota SensorAccelerometer SensorGyroscope SensorInvalid SensorType = math.MaxUint32 )
type SubsystemType ¶
type SubsystemType C.SDL_SYSWM_TYPE
const ( SubsystemUnknown SubsystemType = C.SDL_SYSWM_UNKNOWN SubsystemWindows SubsystemType = C.SDL_SYSWM_WINDOWS SubsystemX11 SubsystemType = C.SDL_SYSWM_X11 SubsystemDirectFB SubsystemType = C.SDL_SYSWM_DIRECTFB SubsystemCocoa SubsystemType = C.SDL_SYSWM_COCOA SubsystemUIKit SubsystemType = C.SDL_SYSWM_UIKIT SubsystemWayland SubsystemType = C.SDL_SYSWM_WAYLAND SubsystemMir SubsystemType = C.SDL_SYSWM_MIR SubsystemWinRT SubsystemType = C.SDL_SYSWM_WINRT SubsystemAndroid SubsystemType = C.SDL_SYSWM_ANDROID SubsystemVivante SubsystemType = C.SDL_SYSWM_VIVANTE )
func (SubsystemType) String ¶
func (s SubsystemType) String() string
type Surface ¶
type Surface C.struct_SDL_Surface
func ConvertSurface ¶ added in v0.1.1
func ConvertSurface(src *Surface, format *PixelFormatS) (*Surface, error)
func ConvertSurfaceFormat ¶ added in v0.1.1
func ConvertSurfaceFormat(src *Surface, format PixelFormat) (*Surface, error)
func CreateRGBSurfaceWithFormat ¶ added in v0.1.1
func CreateRGBSurfaceWithFormat(flags uint32, width, height, depth int, format PixelFormat) (*Surface, error)
func (*Surface) BlitSurface ¶
func (*Surface) ColorModel ¶
func (*Surface) Convert ¶ added in v0.1.1
func (s *Surface) Convert(format *PixelFormatS) (*Surface, error)
func (*Surface) ConvertFormat ¶ added in v0.1.1
func (s *Surface) ConvertFormat(format PixelFormat) (*Surface, error)
func (Surface) Format ¶
func (s Surface) Format() PixelFormatS
func (*Surface) SetAlphaMod ¶
func (*Surface) SetClipRect ¶
func (*Surface) SetColorMod ¶
func (*Surface) SetPixelFormatPalette ¶ added in v0.1.1
type Texture ¶
type Texture C.struct_SDL_Texture
type TextureAccess ¶
type TextureAccess uint32
const ( TextureAccessStatic TextureAccess = iota TextureAccessStreaming TextureAccessTarget )
type TextureModulate ¶
type TextureModulate uint32
const ( TextureModulateNone TextureModulate = iota TextureModulateColor TextureModulateAlpha )
type TouchFingerEvent ¶
type TouchFingerEvent struct { Type EventType Timestamp time.Time TouchID TouchID FingerID FingerID X float32 Y float32 DeltaX float32 DeltaY float32 Pressure float32 }
func (TouchFingerEvent) String ¶
func (e TouchFingerEvent) String() string
type Version ¶
func GetVersion ¶
func GetVersion() Version
type WMInfo ¶
type WMInfo struct { Version Version Subsystem SubsystemType // contains filtered or unexported fields }
type WMInfoCocoa ¶
type WMInfoCocoa struct { Version Version Subsystem SubsystemType Window uintptr }
type WMInfoWin32 ¶
type WMInfoWin32 struct { Version Version Subsystem SubsystemType Window uintptr DeviceContext uintptr Instance uintptr }
type WMInfoXlib ¶
type WMInfoXlib struct { Version Version Subsystem SubsystemType Display uintptr Window uintptr }
type Window ¶
type Window C.struct_SDL_Window
func CreateWindow ¶
func CreateWindow(title string, x, y, w, h int, flags WindowFlags) (*Window, error)
func (*Window) PixelFormat ¶
func (w *Window) PixelFormat() (PixelFormat, error)
func (*Window) UpdateSurface ¶
type WindowEvent ¶
type WindowEvent struct { Type EventType Timestamp time.Time WindowID int Event WindowEventID Data1 int Data2 int }
func (WindowEvent) String ¶
func (e WindowEvent) String() string
type WindowEventID ¶
type WindowEventID uint8
const ( WindowEventNone WindowEventID = iota WindowEventShown WindowEventHidden WindowEventExposed WindowEventMoved WindowEventResized WindowEventSizeChanged WindowEventMinimized WindowEventMaximized WindowEventRestored WindowEventMouseEntered WindowEventMouseLeft WindowEventFocusGained WindowEventFocusLost WindowEventClose WindowEventTakeFocus WindowEventHitTest )
func (WindowEventID) String ¶
func (i WindowEventID) String() string
type WindowFlags ¶
type WindowFlags uint32
const ( WindowFullscreen WindowFlags = 1 << iota WindowOpenGL WindowShown WindowHidden WindowBorderless WindowResizable WindowMinimized WindowMaximized WindowInputGrabbed WindowInputFocus WindowMouseFocus WindowForeign WindowFullscreenDesktop WindowFlags = 1<<iota + 1 WindowAllowHighDPI WindowFlags = 1 << iota WindowMouseCapture WindowAlwaysOnTop WindowSkipTaskbar WindowUtility WindowTooltip WindowPopupMenu WindowVulkan WindowFlags = 1 << 28 )