Merge remote-tracking branch 'offical/master'

This commit is contained in:
ed
2024-06-06 10:31:33 -04:00
183 changed files with 9801 additions and 6663 deletions
+17 -43
View File
@@ -5,47 +5,21 @@ import "core:c"
RAYGUI_SHARED :: #config(RAYGUI_SHARED, true)
when ODIN_OS == .Windows {
when RAYGUI_SHARED {
foreign import lib {
"windows/rayguidll.lib",
}
} else {
foreign import lib {
"windows/raygui.lib",
}
foreign import lib {
"windows/rayguidll.lib" when RAYGUI_SHARED else "windows/raygui.lib",
}
} else when ODIN_OS == .Linux {
when RAYGUI_SHARED {
foreign import lib "linux/libraygui.so"
} else {
foreign import lib "linux/libraygui.a"
foreign import lib {
"linux/libraygui.so" when RAYGUI_SHARED else "linux/libraygui.a",
}
} else when ODIN_OS == .Darwin {
when ODIN_ARCH == .arm64 {
when RAYGUI_SHARED {
foreign import lib {
"macos-arm64/libraygui.dylib",
}
} else {
foreign import lib {
"macos-arm64/libraygui.a",
// "system:Cocoa.framework",
// "system:OpenGL.framework",
// "system:IOKit.framework",
}
foreign import lib {
"macos-arm64/libraygui.dylib" when RAYGUI_SHARED else "macos-arm64/libraygui.a",
}
} else {
when RAYGUI_SHARED {
foreign import lib {
"macos/libraygui.dylib",
}
} else {
foreign import lib {
"macos/libraygui.a",
// "system:Cocoa.framework",
// "system:OpenGL.framework",
// "system:IOKit.framework",
}
foreign import lib {
"macos/libraygui.dylib" when RAYGUI_SHARED else "macos/libraygui.a",
}
}
} else {
@@ -56,8 +30,8 @@ RAYGUI_VERSION :: "4.0"
// Style property
GuiStyleProp :: struct {
controlId: u16,
propertyId: u16,
controlId: u16,
propertyId: u16,
propertyValue: c.int,
}
@@ -226,7 +200,7 @@ GuiColorPickerProperty :: enum c.int {
HUEBAR_SELECTOR_OVERFLOW, // ColorPicker right hue bar selector overflow
}
SCROLLBAR_LEFT_SIDE :: 0
SCROLLBAR_LEFT_SIDE :: 0
SCROLLBAR_RIGHT_SIDE :: 1
//----------------------------------------------------------------------------------
@@ -262,8 +236,8 @@ foreign lib {
// Style set/get functions
GuiSetStyle :: proc(control: c.int, property: c.int, value: c.int) --- // Set one style property
GuiGetStyle :: proc(control: c.int, property: c.int) -> c.int --- // Get one style property
GuiSetStyle :: proc(control: GuiControl, property: GuiStyleProp, value: c.int) --- // Set one style property
GuiGetStyle :: proc(control: GuiControl, property: GuiStyleProp) -> c.int --- // Get one style property
// Styles loading functions
@@ -278,11 +252,11 @@ foreign lib {
// Icons functionality
GuiIconText :: proc(iconId: c.int, text: cstring) -> cstring --- // Get text with icon id prepended (if supported)
GuiIconText :: proc(iconId: GuiIconName, text: cstring) -> cstring --- // Get text with icon id prepended (if supported)
GuiSetIconScale :: proc(scale: c.int) --- // Set default icon drawing size
GuiGetIcons :: proc() -> [^]u32 --- // Get raygui icons data pointer
GuiLoadIcons :: proc(fileName: cstring, loadIconsName: bool) -> [^]cstring --- // Load raygui icons file (.rgi) into internal icons data
GuiDrawIcon :: proc(iconId: c.int, posX: c.int, posY: c.int, pixelSize: c.int, color: Color) --- // Draw icon using pixel size at specified position
GuiDrawIcon :: proc(iconId: GuiIconName, posX, posY: c.int, pixelSize: c.int, color: Color) --- // Draw icon using pixel size at specified position
// Controls
@@ -300,11 +274,11 @@ foreign lib {
GuiLabel :: proc(bounds: Rectangle, text: cstring) -> c.int --- // Label control, shows text
GuiButton :: proc(bounds: Rectangle, text: cstring) -> bool --- // Button control, returns true when clicked
GuiLabelButton :: proc(bounds: Rectangle, text: cstring) -> bool --- // Label button control, show true when clicked
GuiLabelButton :: proc(bounds: Rectangle, text: cstring) -> bool --- // Label button control, show true when clicked
GuiToggle :: proc(bounds: Rectangle, text: cstring, active: ^bool) -> c.int --- // Toggle Button control, returns true when active
GuiToggleGroup :: proc(bounds: Rectangle, text: cstring, active: ^c.int) -> c.int --- // Toggle Group control, returns active toggle index
GuiToggleSlider :: proc(bounds: Rectangle, text: cstring, active: ^c.int) -> c.int ---
GuiCheckBox :: proc(bounds: Rectangle, text: cstring, checked: ^bool) -> bool --- // Check Box control, returns true when active
GuiCheckBox :: proc(bounds: Rectangle, text: cstring, checked: ^bool) -> bool --- // Check Box control, returns true when active
GuiComboBox :: proc(bounds: Rectangle, text: cstring, active: ^c.int) -> c.int --- // Combo Box control, returns selected item index
GuiDropdownBox :: proc(bounds: Rectangle, text: cstring, active: ^c.int, editMode: bool) -> bool --- // Dropdown Box control, returns selected item
+24 -68
View File
@@ -97,76 +97,32 @@ MAX_TEXT_BUFFER_LENGTH :: #config(RAYLIB_MAX_TEXT_BUFFER_LENGTH, 1024)
RAYLIB_SHARED :: #config(RAYLIB_SHARED, true)
when ODIN_OS == .Windows {
when RAYLIB_SHARED {
@(extra_linker_flags="/NODEFAULTLIB:msvcrt")
foreign import lib {
"windows/raylibdll.lib",
"system:Winmm.lib",
"system:Gdi32.lib",
"system:User32.lib",
"system:Shell32.lib",
}
} else {
@(extra_linker_flags="/NODEFAULTLIB:libcmt")
foreign import lib {
"windows/raylib.lib",
"system:Winmm.lib",
"system:Gdi32.lib",
"system:User32.lib",
"system:Shell32.lib",
}
@(extra_linker_flags="/NODEFAULTLIB:" + ("msvcrt" when RAYLIB_SHARED else "libcmt"))
foreign import lib {
"windows/raylibdll.lib" when RAYLIB_SHARED else "windows/raylib.lib" ,
"system:Winmm.lib",
"system:Gdi32.lib",
"system:User32.lib",
"system:Shell32.lib",
}
} else when ODIN_OS == .Linux {
when RAYLIB_SHARED {
foreign import lib {
// Note(bumbread): I'm not sure why in `linux/` folder there are
// multiple copies of raylib.so, but since these bindings are for
// particular version of the library, I better specify it. Ideally,
// though, it's best specified in terms of major (.so.4)
"linux/libraylib.so.500",
"system:dl",
"system:pthread",
}
} else {
foreign import lib {
"linux/libraylib.a",
"system:dl",
"system:pthread",
}
foreign import lib {
// Note(bumbread): I'm not sure why in `linux/` folder there are
// multiple copies of raylib.so, but since these bindings are for
// particular version of the library, I better specify it. Ideally,
// though, it's best specified in terms of major (.so.4)
"linux/libraylib.so.500" when RAYLIB_SHARED else "linux/libraylib.a",
"system:dl",
"system:pthread",
}
} else when ODIN_OS == .Darwin {
when ODIN_ARCH == .arm64 {
when RAYLIB_SHARED {
foreign import lib {
"macos-arm64/libraylib.500.dylib",
"system:Cocoa.framework",
"system:OpenGL.framework",
"system:IOKit.framework",
}
} else {
foreign import lib {
"macos-arm64/libraylib.a",
"system:Cocoa.framework",
"system:OpenGL.framework",
"system:IOKit.framework",
}
}
} else {
when RAYLIB_SHARED {
foreign import lib {
"macos/libraylib.500.dylib",
"system:Cocoa.framework",
"system:OpenGL.framework",
"system:IOKit.framework",
}
} else {
foreign import lib {
"macos/libraylib.a",
"system:Cocoa.framework",
"system:OpenGL.framework",
"system:IOKit.framework",
}
}
foreign import lib {
"macos" +
"-arm64" when ODIN_ARCH == .arm64 else "" +
"/libraylib" + ".500.dylib" when RAYLIB_SHARED else ".a",
"system:Cocoa.framework",
"system:OpenGL.framework",
"system:IOKit.framework",
}
} else {
foreign import lib "system:raylib"
@@ -951,8 +907,8 @@ foreign lib {
SetWindowTitle :: proc(title: cstring) --- // Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB)
SetWindowPosition :: proc(x, y: c.int) --- // Set window position on screen (only PLATFORM_DESKTOP)
SetWindowMonitor :: proc(monitor: c.int) --- // Set monitor for the current window
SetWindowMinSize :: proc(width, height: c.int) --- // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
SetWindowMaxSize :: proc(width, height: c.int) --- // Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)
SetWindowMinSize :: proc(width, height: c.int) --- // Set window minimum dimensions (for WINDOW_RESIZABLE)
SetWindowMaxSize :: proc(width, height: c.int) --- // Set window maximum dimensions (for WINDOW_RESIZABLE)
SetWindowSize :: proc(width, height: c.int) --- // Set window dimensions
SetWindowOpacity :: proc(opacity: f32) --- // Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)
SetWindowFocused :: proc() --- // Set window focused (only PLATFORM_DESKTOP)
+5 -14
View File
@@ -122,20 +122,11 @@ when ODIN_OS == .Windows {
} else when ODIN_OS == .Linux {
foreign import lib "linux/libraylib.a"
} else when ODIN_OS == .Darwin {
when ODIN_ARCH == .arm64 {
foreign import lib {
"macos-arm64/libraylib.a",
"system:Cocoa.framework",
"system:OpenGL.framework",
"system:IOKit.framework",
}
} else {
foreign import lib {
"macos/libraylib.a",
"system:Cocoa.framework",
"system:OpenGL.framework",
"system:IOKit.framework",
}
foreign import lib {
"macos-arm64/libraylib.a" when ODIN_ARCH == .arm64 else "macos/libraylib.a",
"system:Cocoa.framework",
"system:OpenGL.framework",
"system:IOKit.framework",
}
} else {
foreign import lib "system:raylib"