diff --git a/raylib/go.mod b/raylib/go.mod index 2b4ab44..7807c9c 100644 --- a/raylib/go.mod +++ b/raylib/go.mod @@ -1,3 +1,3 @@ module github.com/gen2brain/raylib-go/raylib -go 1.19 +go 1.21 diff --git a/raylib/raudio.go b/raylib/raudio.go index e30e09c..60f5382 100644 --- a/raylib/raudio.go +++ b/raylib/raudio.go @@ -52,6 +52,13 @@ func SetMasterVolume(volume float32) { C.SetMasterVolume(cvolume) } +// GetMasterVolume - Set master volume (listener) +func GetMasterVolume() float32 { + ret := C.GetMasterVolume() + v := float32(ret) + return v +} + // LoadWave - Load wave data from file into RAM func LoadWave(fileName string) Wave { cfileName := C.CString(fileName) @@ -97,6 +104,14 @@ func LoadSoundFromWave(wave Wave) Sound { return v } +// LoadSoundAlias - Create a new sound that shares the same sample data as the source sound, does not own the sound data +func LoadSoundAlias(source Sound) Sound { + csound := source.cptr() + ret := C.LoadSoundAlias(*csound) + v := newSoundFromPointer(unsafe.Pointer(&ret)) + return v +} + // IsSoundReady - Checks if a sound is ready func IsSoundReady(sound Sound) bool { csound := sound.cptr() diff --git a/raylib/rcore.go b/raylib/rcore.go index b7d8c6e..d3232eb 100644 --- a/raylib/rcore.go +++ b/raylib/rcore.go @@ -197,6 +197,13 @@ func SetWindowMinSize(w, h int) { C.SetWindowMinSize(cw, ch) } +// SetWindowMaxSize - Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE) +func SetWindowMaxSize(w, h int) { + cw := (C.int)(w) + ch := (C.int)(h) + C.SetWindowMaxSize(cw, ch) +} + // SetWindowSize - Set window dimensions func SetWindowSize(w, h int) { cw := (C.int)(w) @@ -691,6 +698,14 @@ func IsKeyPressed(key int32) bool { return v } +// IsKeyPressedRepeat - Detect if a key has been pressed again (Only PLATFORM_DESKTOP) +func IsKeyPressedRepeat(key int32) bool { + ckey := (C.int)(key) + ret := C.IsKeyPressedRepeat(ckey) + v := bool(ret) + return v +} + // IsKeyDown - Detect if a key is being pressed func IsKeyDown(key int32) bool { ckey := (C.int)(key)