imgui wrapper
This commit is contained in:
+20
-1
@@ -16,7 +16,16 @@ const (
|
||||
EventQuit uint32 = 0x100
|
||||
EventWindowResized uint32 = 0x206
|
||||
EventPixelSizeChanged uint32 = 0x207
|
||||
EventKeyDown uint32 = 0x300
|
||||
|
||||
EventKeyDown uint32 = 0x300
|
||||
EventKeyUp uint32 = 0x301
|
||||
|
||||
EventMouseMotion uint32 = 0x400
|
||||
EventMouseButtonDown uint32 = 0x401
|
||||
EventMouseButtonUp uint32 = 0x402
|
||||
EventMouseWheel uint32 = 0x403
|
||||
|
||||
EventTextInput uint32 = 0x303
|
||||
|
||||
KeyEscape uint32 = 0x1B
|
||||
KeyF uint32 = 0x66
|
||||
@@ -49,6 +58,9 @@ var (
|
||||
sdlDestroyAudioStream func(stream uintptr)
|
||||
sdlGetAudioPlaybackDevices func(count *int32) uintptr
|
||||
sdlGetAudioDeviceName func(devid uint32) uintptr
|
||||
|
||||
sdlStartTextInput func(window uintptr)
|
||||
sdlStopTextInput func(window uintptr)
|
||||
)
|
||||
|
||||
var loaded = false
|
||||
@@ -79,6 +91,9 @@ func Load() error {
|
||||
purego.RegisterLibFunc(&sdlDestroyAudioStream, h, "SDL_DestroyAudioStream")
|
||||
purego.RegisterLibFunc(&sdlGetAudioPlaybackDevices, h, "SDL_GetAudioPlaybackDevices")
|
||||
purego.RegisterLibFunc(&sdlGetAudioDeviceName, h, "SDL_GetAudioDeviceName")
|
||||
// input
|
||||
purego.RegisterLibFunc(&sdlStartTextInput, h, "SDL_StartTextInput")
|
||||
purego.RegisterLibFunc(&sdlStopTextInput, h, "SDL_StopTextInput")
|
||||
loaded = true
|
||||
return nil
|
||||
}
|
||||
@@ -174,3 +189,7 @@ func GetAudioPlaybackDevices() []AudioDevice {
|
||||
}
|
||||
return devs
|
||||
}
|
||||
|
||||
// Input wrappers
|
||||
func StartTextInput(window uintptr) { sdlStartTextInput(window) }
|
||||
func StopTextInput(window uintptr) { sdlStopTextInput(window) }
|
||||
|
||||
Reference in New Issue
Block a user