Fixed a single raygui binding

This commit is contained in:
Synthasmagoria 2026-07-24 11:18:22 +02:00
commit e5fccefec0
5 changed files with 28 additions and 22 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "libraries/back"]
path = libraries/back
url = https://github.com/laytan/back.git

1
libraries/back Submodule

@ -0,0 +1 @@
Subproject commit a21ef046ad624ff1bdc6e8de77c38e8c32eec86b

View file

@ -292,7 +292,7 @@ foreign lib {
// Advance controls set // Advance controls set
GuiListView :: proc(bounds: Rectangle, text: cstring, scrollIndex: ^c.int, active: ^c.int) -> c.int --- // List View control, returns selected list item index GuiListView :: proc(bounds: Rectangle, text: cstring, scrollIndex: ^c.int, active: ^c.int) -> c.int --- // List View control, returns selected list item index
GuiListViewEx :: proc(bounds: Rectangle, text:[^]cstring, count: c.int, scrollIndex: ^c.int, active: ^c.int, focus: ^c.int) -> c.int --- // List View with extended parameters GuiListViewEx :: proc(bounds: Rectangle, text:[^]cstring, count: c.int, scrollIndex: ^c.int, active: ^c.int, focus: ^c.int) -> c.int --- // List View with extended parameters
GuiMessageBox :: proc(bounds: Rectangle, title: cstring, message: cstring, buttons: cstring) -> c.int --- // Message Box control, displays a message GuiMessageBox :: proc(bounds: Rectangle, title: cstring, message: cstring, buttons: cstring, active: ^c.int) -> c.int --- // Message Box control, displays a message
GuiTextInputBox :: proc(bounds: Rectangle, title: cstring, message: cstring, buttons: cstring, text: cstring, textMaxSize: c.int, secretViewActive: ^bool) -> c.int --- // Text Input Box control, ask for text, supports secret GuiTextInputBox :: proc(bounds: Rectangle, title: cstring, message: cstring, buttons: cstring, text: cstring, textMaxSize: c.int, secretViewActive: ^bool) -> c.int --- // Text Input Box control, ask for text, supports secret
GuiColorPicker :: proc(bounds: Rectangle, text: cstring, color: ^Color) -> c.int --- // Color Picker control (multiple color controls) GuiColorPicker :: proc(bounds: Rectangle, text: cstring, color: ^Color) -> c.int --- // Color Picker control (multiple color controls)
GuiColorPanel :: proc(bounds: Rectangle, text: cstring, color: ^Color) -> c.int --- // Color Panel control GuiColorPanel :: proc(bounds: Rectangle, text: cstring, color: ^Color) -> c.int --- // Color Panel control

View file

@ -3,6 +3,7 @@ package main
import rl "libraries/raylib" import rl "libraries/raylib"
import "core:log" import "core:log"
import "libraries/back"
import "core:mem" import "core:mem"
import "core:c" import "core:c"
import "base:intrinsics" import "base:intrinsics"
@ -239,7 +240,7 @@ when ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64p32 {
// exe_dir := filepath.dir(string(exe_path)) // exe_dir := filepath.dir(string(exe_path))
// os.set_working_directory(exe_dir) // os.set_working_directory(exe_dir)
rl.ChangeDirectory(rl.GetApplicationDirectory()) rl.ChangeDirectory(rl.GetApplicationDirectory())
back.register_segfault_handler()
context.logger = log.create_console_logger() context.logger = log.create_console_logger()
init() init()

View file

@ -332,7 +332,8 @@ update :: proc() {
size := v2{224.0, 128.0} size := v2{224.0, 128.0}
position := v2(iv2{rl.GetRenderWidth(), rl.GetRenderHeight()} / 2.0) - size / 2.0 position := v2(iv2{rl.GetRenderWidth(), rl.GetRenderHeight()} / 2.0) - size / 2.0
area := rect2{**position, **size} area := rect2{**position, **size}
action := rl.GuiMessageBox(area, "Message", program_messages[program.message_type], "Confirm;Cancel") active := cast(^i32)&program.matrix_mode_perceived
action := rl.GuiMessageBox(area, "Message", program_messages[program.message_type], "Confirm;Cancel", active)
switch action { switch action {
case 0: case 0:
case 1: case 1: