Skip to content

Commit

Permalink
Update to raylib 5.5 (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
JupiterRider authored Dec 21, 2024
1 parent 7b5b322 commit a3dfd57
Show file tree
Hide file tree
Showing 23 changed files with 504 additions and 124 deletions.
5 changes: 2 additions & 3 deletions Examples/Core/Picking3D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static int Main()
{
if (!collision.Hit)
{
ray = GetMouseRay(GetMousePosition(), camera);
ray = GetScreenToWorldRay(GetMousePosition(), camera);

// Check collision between ray and box
BoundingBox box = new(
Expand All @@ -68,7 +68,7 @@ public static int Main()
collision.Hit = false;
}

ray = GetMouseRay(GetMousePosition(), camera);
ray = GetScreenToWorldRay(GetMousePosition(), camera);
}
//----------------------------------------------------------------------------------

Expand Down Expand Up @@ -119,4 +119,3 @@ public static int Main()
return 0;
}
}

2 changes: 0 additions & 2 deletions Examples/Core/VrSimulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public static int Main()
VResolution = 1200,
HScreenSize = 0.133793f,
VScreenSize = 0.0669f,
VScreenCenter = 0.04678f,
EyeToScreenDistance = 0.041f,
LensSeparationDistance = 0.07f,
InterpupillaryDistance = 0.07f,
Expand Down Expand Up @@ -188,4 +187,3 @@ public static int Main()
return 0;
}
}

2 changes: 1 addition & 1 deletion Examples/Models/MeshPicking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public unsafe static int Main()
Color cursorColor = Color.White;

// Get ray and test against objects
ray = GetMouseRay(GetMousePosition(), camera);
ray = GetScreenToWorldRay(GetMousePosition(), camera);

// Check ray collision aginst ground quad
RayCollision groundHitInfo = GetRayCollisionQuad(ray, g0, g1, g2, g3);
Expand Down
2 changes: 1 addition & 1 deletion Examples/Models/ModelLoading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public unsafe static int Main()
if (IsMouseButtonPressed(MouseButton.Left))
{
// Check collision between ray and box
if (GetRayCollisionBox(GetMouseRay(GetMousePosition(), camera), bounds).Hit)
if (GetRayCollisionBox(GetScreenToWorldRay(GetMousePosition(), camera), bounds).Hit)
{
selected = !selected;
}
Expand Down
4 changes: 2 additions & 2 deletions Examples/Models/SkyboxDemo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ private static unsafe Texture2D GenTextureCubemap(Shader shader, Texture2D panor
// STEP 1: Setup framebuffer
//------------------------------------------------------------------------------------------
uint rbo = Rlgl.LoadTextureDepth(size, size, true);
cubemap.Id = Rlgl.LoadTextureCubemap(null, size, format);
cubemap.Id = Rlgl.LoadTextureCubemap(null, size, format, 1);

uint fbo = Rlgl.LoadFramebuffer(size, size);
uint fbo = Rlgl.LoadFramebuffer();
Rlgl.FramebufferAttach(
fbo,
rbo,
Expand Down
2 changes: 1 addition & 1 deletion Examples/Shaders/HybridRender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private static unsafe RenderTexture2D LoadRenderTextureDepthTex(int width, int h
RenderTexture2D target = new();

// Load an empty framebuffer
target.Id = Rlgl.LoadFramebuffer(width, height);
target.Id = Rlgl.LoadFramebuffer();

if (target.Id > 0)
{
Expand Down
2 changes: 1 addition & 1 deletion Examples/Shaders/WriteDepth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private static unsafe RenderTexture2D LoadRenderTextureDepthTex(int width, int h
RenderTexture2D target = new();

// Load an empty framebuffer
target.Id = Rlgl.LoadFramebuffer(width, height);
target.Id = Rlgl.LoadFramebuffer();

if (target.Id > 0)
{
Expand Down
2 changes: 1 addition & 1 deletion Examples/Shapes/DrawRectangleRounded.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static int Main()
}
if (drawRoundedLines)
{
DrawRectangleRoundedLines(rec, roundness, segments, (float)lineThick, ColorAlpha(Color.Maroon, 0.4f));
DrawRectangleRoundedLinesEx(rec, roundness, segments, (float)lineThick, ColorAlpha(Color.Maroon, 0.4f));
}

// Draw GUI controls
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ C# bindings for raylib, a simple and easy-to-use library to learn videogames pro
[![GitHub stars](https://img.shields.io/github/stars/chrisdill/raylib-cs?style=social)](https://github.com/chrisdill/raylib-cs/stargazers)
[![Build](https://github.com/chrisdill/raylib-cs/workflows/Build/badge.svg)](https://github.com/chrisdill/raylib-cs/actions?query=workflow%3ABuild)

Raylib-cs targets net6.0 and uses the [official 5.0 release](https://github.com/raysan5/raylib/releases/tag/5.0) to build the native libraries.
Raylib-cs targets net6.0 and uses the [official 5.5 release](https://github.com/raysan5/raylib/releases/tag/5.5) to build the native libraries.

## Status

Expand Down
8 changes: 4 additions & 4 deletions Raylib-cs/Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project>

<PropertyGroup>
<TargetRaylibTag>5.0</TargetRaylibTag>
<Version>6.1.1</Version>
<PackageVersion>6.1.1</PackageVersion>
<TargetRaylibTag>5.5</TargetRaylibTag>
<Version>7.0.0</Version>
<PackageVersion>7.0.0</PackageVersion>
</PropertyGroup>

</Project>
</Project>
2 changes: 1 addition & 1 deletion Raylib-cs/Raylib-cs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="System.Numerics.Vectors" Version="4.6.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

Expand Down
Loading

0 comments on commit a3dfd57

Please sign in to comment.