From 56e9db7f20d3db798b02681097c1da4b0adce3c8 Mon Sep 17 00:00:00 2001 From: Yxure <93406322+Yxure@users.noreply.github.com> Date: Sat, 6 Jan 2024 10:11:04 +0100 Subject: [PATCH 1/4] Rectangle constructors and properties using Vector2 (#216) --- Raylib-cs/types/Rectangle.cs | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/Raylib-cs/types/Rectangle.cs b/Raylib-cs/types/Rectangle.cs index 3f1c7ab..9f6eb21 100644 --- a/Raylib-cs/types/Rectangle.cs +++ b/Raylib-cs/types/Rectangle.cs @@ -1,3 +1,4 @@ +using System.Numerics; using System.Runtime.InteropServices; namespace Raylib_cs; @@ -21,6 +22,50 @@ public partial struct Rectangle this.Height = height; } + public Rectangle(Vector2 position, float width, float height) + { + this.X = position.X; + this.Y = position.Y; + this.Width = width; + this.Height = height; + } + + public Rectangle(float x, float y, Vector2 size) + { + this.X = x; + this.Y = y; + this.Width = size.X; + this.Height = size.Y; + } + + public Rectangle(Vector2 position, Vector2 size) + { + this.X = position.X; + this.Y = position.Y; + this.Width = size.X; + this.Height = size.Y; + } + + public Vector2 Position + { + readonly get { return new Vector2(X,Y); } + set + { + X = value.X; + Y = value.Y; + } + } + + public Vector2 Size + { + readonly get { return new Vector2(Width,Height); } + set + { + Width = value.X; + Height = value.Y; + } + } + public override string ToString() { return $"{{X:{X} Y:{Y} Width:{Width} Height:{Height}}}"; From 269b6fe67fd99fc5fa0281d028746cf163d9d4d6 Mon Sep 17 00:00:00 2001 From: MrScautHD <65916181+MrScautHD@users.noreply.github.com> Date: Sat, 6 Jan 2024 13:52:18 +0100 Subject: [PATCH 2/4] Update Desktop to OpenGL 4.3 (#217) Update Desktop to OpenGL 4.3 for linux and windows platforms --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c3e7899..e91f350 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,7 +123,9 @@ jobs: -B build \ -D CMAKE_BUILD_TYPE=Release \ -D BUILD_SHARED_LIBS=ON \ - -D BUILD_EXAMPLES=OFF + -D BUILD_EXAMPLES=OFF \ + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" \ + -D GRAPHICS=GRAPHICS_API_OPENGL_43 cmake --build build --config Release - name: upload build @@ -190,7 +192,9 @@ jobs: -B build \ -D CMAKE_BUILD_TYPE=Release \ -D BUILD_SHARED_LIBS=ON \ - -D BUILD_EXAMPLES=OFF + -D BUILD_EXAMPLES=OFF \ + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" \ + -D GRAPHICS=GRAPHICS_API_OPENGL_43 cmake --build build --config Release - name: upload build From 35f35bb4d5ea6cc839ef303409cbb6b472cc6290 Mon Sep 17 00:00:00 2001 From: German Hoyos Date: Sun, 7 Jan 2024 04:43:58 -0700 Subject: [PATCH 3/4] Update README.md (#218) Added an additional step for more clarity, this just explains that a .NET app should be created before running the add package command for Raylib-cs. --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 4cc4b8a..5d93ab7 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,13 @@ Raylib-cs targets net5.0 and net6.0 and uses the [official 4.5.0 release](https: This is the prefered method to get started. +1) Pick a folder in which you would like to start a raylib project for example "MyRaylibCSProj" +2) Then from a terminal (for example a VSCode terminal), whilst in the folder dir you just created + run the following commands. (Please keep in mind you should have .NET already installed on your system) + +``` +dotnet new console +``` ``` dotnet add package Raylib-cs ``` From a94a92afb6c6d171a67a7bc531fe3ce1606edd8e Mon Sep 17 00:00:00 2001 From: ChrisDill Date: Sun, 7 Jan 2024 22:28:16 +0000 Subject: [PATCH 4/4] Revert default graphics version change (#219) --- .github/workflows/build.yml | 6 ++---- Raylib-cs.Native/Raylib-cs.Native.csproj | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e91f350..c98627b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -124,8 +124,7 @@ jobs: -D CMAKE_BUILD_TYPE=Release \ -D BUILD_SHARED_LIBS=ON \ -D BUILD_EXAMPLES=OFF \ - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" \ - -D GRAPHICS=GRAPHICS_API_OPENGL_43 + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" cmake --build build --config Release - name: upload build @@ -193,8 +192,7 @@ jobs: -D CMAKE_BUILD_TYPE=Release \ -D BUILD_SHARED_LIBS=ON \ -D BUILD_EXAMPLES=OFF \ - -D CMAKE_C_FLAGS="${{ matrix.cflags }}" \ - -D GRAPHICS=GRAPHICS_API_OPENGL_43 + -D CMAKE_C_FLAGS="${{ matrix.cflags }}" cmake --build build --config Release - name: upload build diff --git a/Raylib-cs.Native/Raylib-cs.Native.csproj b/Raylib-cs.Native/Raylib-cs.Native.csproj index 2ac0971..1fbe25a 100644 --- a/Raylib-cs.Native/Raylib-cs.Native.csproj +++ b/Raylib-cs.Native/Raylib-cs.Native.csproj @@ -33,6 +33,7 @@ +