Skip to content

Commit

Permalink
Update raygui to 3.6
Browse files Browse the repository at this point in the history
Update raygui to 3.6
  • Loading branch information
Minmoose authored May 12, 2023
2 parents 61757f5 + 175dd01 commit 9b6e547
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 46 deletions.
4 changes: 2 additions & 2 deletions Build/build-projects.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rm .\raylib-with-extras\ -Recurse
./premake5.exe vs2022
"Windows project built..."

./premake5.exe gmake2
"Linux project built..."
#./premake5.exe gmake2
#"Linux project built..."

#./premake5.exe xcode4
Binary file added Build/libluasocket.so
Binary file not shown.
Binary file added Build/premake5
Binary file not shown.
9 changes: 5 additions & 4 deletions Build/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@ project "raylib"
links {"winmm"}

filter "action:gmake*"
defines{"fPIC"}
targetdir "../Source/Raylib-CSharp-Vinculum/runtimes/linux-x64/native"
links {"pthread", "GL", "m", "lc", "fPIC", "dl", "rt", "X11"}
links {"pthread", "GL", "m", "c", "dl", "rt", "X11"}

filter{}

location "raylib-with-extras"
language "C++"
cppdialect "C++17"

includedirs { "../Libs/raylib/src","../Libs/raylib/src/external/glfw/include",
"../Libs/raylib-extra-shims/src", --extras .c files
"../Libs/physac/src/","../Libs/raygui/src/","../Libs/rres/src/" --extras .h files
includedirs { "../Libs/raylib/src","../Libs/raylib/src/external/glfw/include", -- raylib files
"raylib-extra-shims/src", -- shims .c files
"../Libs/physac/src/","../Libs/raygui/src/","../Libs/rres/src/" -- extra lib files
}
vpaths
{
Expand Down
48 changes: 24 additions & 24 deletions Build/raylib-with-extras/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ endif

RESCOMP = windres
TARGETDIR = ../../Source/Raylib-CSharp-Vinculum/runtimes/linux-x64/native
TARGET = $(TARGETDIR)/raylib.dll
INCLUDES += -I../../Libs/raylib/src -I../../Libs/raylib/src/external/glfw/include -I../../Libs/raylib-extra-shims/src -I../../Libs/physac/src -I../../Libs/raygui/src -I../../Libs/rres/src
TARGET = $(TARGETDIR)/libraylib.so
INCLUDES += -I../../Libs/raylib/src -I../../Libs/raylib/src/external/glfw/include -I../raylib-extra-shims/src -I../../Libs/physac/src -I../../Libs/raygui/src -I../../Libs/rres/src
FORCE_INCLUDE +=
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
ALL_CPPFLAGS += $(CPPFLAGS) -MD -MP $(DEFINES) $(INCLUDES)
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
LIBS += -lpthread -lGL -lm -llc -lfPIC -ldl -lrt -lX11
LIBS += -lpthread -lGL -lm -lc -ldl -lrt -lX11
LDDEPS +=
LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
define PREBUILDCMDS
Expand All @@ -37,17 +37,17 @@ endef

ifeq ($(config),debug_x64)
OBJDIR = obj/x64/Debug
DEFINES += -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -DBUILD_LIBTYPE_SHARED
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g -std=c++17
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -shared -Wl,--out-implib="../../Source/Raylib-CSharp-Vinculum/runtimes/linux-x64/native/raylib.lib"
DEFINES += -DDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -DBUILD_LIBTYPE_SHARED -DfPIC
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -fPIC -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -fPIC -g -std=c++17
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -shared -Wl,-soname=libraylib.so

else ifeq ($(config),release_x64)
OBJDIR = obj/x64/Release
DEFINES += -DNDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -DBUILD_LIBTYPE_SHARED
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 -std=c++17
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -shared -Wl,--out-implib="../../Source/Raylib-CSharp-Vinculum/runtimes/linux-x64/native/raylib.lib" -s
DEFINES += -DNDEBUG -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_33 -DBUILD_LIBTYPE_SHARED -DfPIC
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 -fPIC
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 -fPIC -std=c++17
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -shared -Wl,-soname=libraylib.so -s

endif

Expand Down Expand Up @@ -120,7 +120,7 @@ ifeq (posix,$(SHELLTYPE))
$(SILENT) rm -rf $(OBJDIR)
else
$(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
$(SILENT) if exist $(subst /,\\,$(GENERATED)) rmdir /s /q $(subst /,\\,$(GENERATED))
$(SILENT) if exist $(subst /,\\,$(GENERATED)) del /s /q $(subst /,\\,$(GENERATED))
$(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
endif

Expand All @@ -147,37 +147,37 @@ endif
# #############################################

$(OBJDIR)/physac.o: ../raylib-extra-shims/src/physac.c
@echo $(notdir $<)
@echo "$(notdir $<)"
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/raygui.o: ../raylib-extra-shims/src/raygui.c
@echo $(notdir $<)
@echo "$(notdir $<)"
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/rres.o: ../raylib-extra-shims/src/rres.c
@echo $(notdir $<)
@echo "$(notdir $<)"
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/raudio.o: ../../Libs/raylib/src/raudio.c
@echo $(notdir $<)
@echo "$(notdir $<)"
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/rcore.o: ../../Libs/raylib/src/rcore.c
@echo $(notdir $<)
@echo "$(notdir $<)"
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/rglfw.o: ../../Libs/raylib/src/rglfw.c
@echo $(notdir $<)
@echo "$(notdir $<)"
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/rmodels.o: ../../Libs/raylib/src/rmodels.c
@echo $(notdir $<)
@echo "$(notdir $<)"
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/rshapes.o: ../../Libs/raylib/src/rshapes.c
@echo $(notdir $<)
@echo "$(notdir $<)"
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/rtext.o: ../../Libs/raylib/src/rtext.c
@echo $(notdir $<)
@echo "$(notdir $<)"
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/rtextures.o: ../../Libs/raylib/src/rtextures.c
@echo $(notdir $<)
@echo "$(notdir $<)"
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/utils.o: ../../Libs/raylib/src/utils.c
@echo $(notdir $<)
@echo "$(notdir $<)"
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"

-include $(OBJECTS:%.o=%.d)
Expand Down
2 changes: 1 addition & 1 deletion Libs/raygui
70 changes: 55 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ Maybe! This repo is a fork of [Raylib-CsLo](https://github.com/NotNotTech/Raylib

## 🏗️ via Source

> **Attention:**
> The current build system is only usable on Windows 10/11, this is temporary.
> **Warning**:
> The Linux build system only builds raylib, not the Vinculum project,
> to complete the build process you must use Windows, this is temporary.
<details>

Expand All @@ -62,19 +63,59 @@ Maybe! This repo is a fork of [Raylib-CsLo](https://github.com/NotNotTech/Raylib
- Visual C++ Toolset
- MSVC v142 (or higher) x64/x86

1. Clone this repo using the git command below. **(Note: Downloading this repo as a zip file will not work,** it is important you use `git clone --recursive` to get all of the submodules)
```
git clone --recursive https://github.com/ZeroElectric/Raylib-CSharp-Vinculum.git
```
> **Note:**
> If you didn't or forgot to use `--recursive`, you can run `git submodule update --init --recursive` to fix it
- Clone this repo using the git command below. **(Note: Downloading this repo as a zip file will not work,** it is important you use `git clone --recursive` to get all of the submodules)
```
git clone --recursive https://github.com/ZeroElectric/Raylib-CSharp-Vinculum.git
```

> **Note:**
> If you didn't or forgot to use `--recursive`, you can run `git submodule update --init --recursive` to fix it
### Building the library

- Run `build.bat` and wait for the build to complete
- Reference `Raylib-CSharp-Vinculum.dll` from `Output\bin` and import the folder `runtimes` into your project's root directory
- Compiled 'Examples' will be in `Output\example-bin`

>If the build wasn't successful make a new issue with the error it gave you
</details>

<details>

<summary>Building for Linux</summary>

#### Note: This build system is designed for Debian based distros.

### Prerequisites

- **.NET SDK (NET7+)**
- You can find more info on how to install .NET on Linux [here](https://learn.microsoft.com/en-us/dotnet/core/install/linux)

- **Install Build-Essential for linux**
```
sudo apt install build-essential git
```

- **Install required libraries**
```
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
```

- Clone this repo using the git command below. **(Note: Downloading this repo as a zip file will not work,** it is important you use `git clone --recursive` to get all of the submodules)
```
git clone --recursive https://github.com/ZeroElectric/Raylib-CSharp-Vinculum.git
```

> **Note:**
> If you didn't or forgot to use `--recursive`, you can run `git submodule update --init --recursive` to fix it
### Building the library

- Run `build.sh`, wait for the build to complete
- Compiled 'libraylib.so' will be in `Source/Raylib-CSharp-Vinculum/runtimes/linux-x64/native`


</details>

# Differences from [Raylib-CsLo](https://github.com/NotNotTech/Raylib-CsLo)
Expand All @@ -83,7 +124,7 @@ git clone --recursive https://github.com/ZeroElectric/Raylib-CSharp-Vinculum.git

#### Other changes:
- Greatly optimized the project layout,
- New build system, now you just run build.bat from the root folder to build the library.
- New build system, now just run build from the root folder to build the library.

# Examples

Expand Down Expand Up @@ -137,7 +178,7 @@ public static class Program
# ❓ FAQ & Tips

### **Make sure your matricies aren't corrupt!**
- Raylib is built upon OpenGL which uses column-major matricies, while .Net uses row-major. When passing your final calculated matricies to raylib for rendering, call `Matrix4x4.Transpose(yourMatrix)` first.
- `raylib` is built upon OpenGL which uses column-major matricies, while .Net uses row-major. When passing your final calculated matricies to raylib for rendering, call `Matrix4x4.Transpose(yourMatrix)` first.

### **How do I convert a string to `sbyte*`?**
- Most methods that take `sbyte*` have a `string` wrapper, so be sure to look at the overloads you can call.
Expand All @@ -153,7 +194,7 @@ public static class Program
```

### **Do I have to cast enums to `int`?**
- The autogen bindings are left untouched, however convenience wrappers have been added. Usually these will automatically "work" via method overloads, but when this is not possible, try adding an underscore `_` to the end of the method or property, for example:
- The autogen bindings are left untouched, however convenience wrappers have been added. Usually these will automatically "work" via method overloads, but when this is not possible, try adding an underscore `_` to the end of the method or property, for example:
```csharp
Camera3D.projection_ = CameraProjection.CAMERA_ORTHOGRAPHIC;

Expand All @@ -168,7 +209,7 @@ public static class Program
### **I ran the Example project in a profiler. What are all these `sbyte[]` arrays being allocated?**
- A pool of `sbyte[]` arrays are allocated for string marshalling purposes, to avoid runtime allocations.

### TIP: You might want to use the `global using directive` to create aliases like the following to make C# code function more like the raylib C examples.
### TIP: You might want to use the `global using directive` to create aliases like the following to make C# function more like the raylib C examples.
```csharp
global using static ZeroElectric.Vinculum.Raylib;
global using static ZeroElectric.Vinculum.RayMath;
Expand All @@ -185,10 +226,9 @@ public static class Program

# Known Issues

- When using `RayGui`, if you close a raylib window after calling `RayGui.GuiLoadStyleDefault()` and then open a new raylib window (within the same running instance), multiple rayGui ui elements will be broken,
- `Texture2D` doesn't exist, it's just an alias for `Texture` so use that instead,
- When using `raygui`, if you close a raylib window after calling `RayGui.GuiLoadStyleDefault()` and then open a new raylib window (within the same running instance), multiple rayGui ui elements will be broken,
- `Texture2D` doesn't exist, it's just an alias for `Texture`, use that instead,
- `LogCustom()` is ported but doesn't support variable length arguments,
- The Linux build supplied by the nuget pakage was built under `debug` mode,
- The `Text.Unicode` example doesn't render unicode properly.

# License
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
13 changes: 13 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

echo "Building raylib..."

cd Build/

./premake5 gmake2

make config=release_x64 clean

make config=release_x64

echo "Building Complete!"

0 comments on commit 9b6e547

Please sign in to comment.