Initial release: RadiantWave v1.0

This commit is contained in:
NeilClack
2026-03-12 08:05:10 -05:00
commit 403ec4db89
555 changed files with 437856 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
package sdl
// #include "sdl_wrapper.h"
import "C"
import "unsafe"
// SetClipboardText puts UTF-8 text into the clipboard.
// (https://wiki.libsdl.org/SDL_SetClipboardText)
func SetClipboardText(text string) error {
_text := C.CString(text)
defer C.free(unsafe.Pointer(_text))
if C.SDL_SetClipboardText(_text) < 0 {
return GetError()
}
return nil
}
// GetClipboardText returns UTF-8 text from the clipboard.
// (https://wiki.libsdl.org/SDL_GetClipboardText)
func GetClipboardText() (string, error) {
text := C.SDL_GetClipboardText()
if text == nil {
return "", GetError()
}
defer C.SDL_free(unsafe.Pointer(text))
_text := C.GoString(text)
return _text, nil
}
// HasClipboardText reports whether the clipboard exists and contains a text string that is non-empty.
// (https://wiki.libsdl.org/SDL_HasClipboardText)
func HasClipboardText() bool {
return C.SDL_HasClipboardText() > 0
}