Watch
2
0
Fork
You've already forked raylib-cs
0

Improved XML comments for consistency, fixed spacing and formatting across examples, added new resources to resources.LICENSE.

This commit is contained in:
Meatcorps 2026-05-22 10:07:42 +02:00
commit cb77e4f195
8 changed files with 113 additions and 63 deletions

View file

@ -1,6 +1,3 @@
using System.Numerics;
namespace Examples.Core;
/*******************************************************************************************
*
* raylib [core] example - delta time
@ -18,6 +15,10 @@ namespace Examples.Core;
*
********************************************************************************************/
using System.Numerics;
namespace Examples.Core;
using static Raylib_cs.Raylib;
public class DeltaTime

View file

@ -103,20 +103,36 @@ public class InputGesturesTestBed
{
switch (logMode)
{
case 3: logMode = 2; break;
case 2: logMode = 3; break;
case 1: logMode = 0; break;
default: logMode = 1; break;
case 3:
logMode = 2;
break;
case 2:
logMode = 3;
break;
case 1:
logMode = 0;
break;
default:
logMode = 1;
break;
}
}
else if (CheckCollisionPointRec(GetMousePosition(), logButton2))
{
switch (logMode)
{
case 3: logMode = 1; break;
case 2: logMode = 0; break;
case 1: logMode = 3; break;
default: logMode = 2; break;
case 3:
logMode = 1;
break;
case 2:
logMode = 0;
break;
case 1:
logMode = 3;
break;
default:
logMode = 2;
break;
}
}
}
@ -397,18 +413,30 @@ public class InputGesturesTestBed
{
switch (gesture)
{
case 0: return "None";
case 1: return "Tap";
case 2: return "Double Tap";
case 4: return "Hold";
case 8: return "Drag";
case 16: return "Swipe Right";
case 32: return "Swipe Left";
case 64: return "Swipe Up";
case 128: return "Swipe Down";
case 256: return "Pinch In";
case 512: return "Pinch Out";
default: return "Unknown";
case 0:
return "None";
case 1:
return "Tap";
case 2:
return "Double Tap";
case 4:
return "Hold";
case 8:
return "Drag";
case 16:
return "Swipe Right";
case 32:
return "Swipe Left";
case 64:
return "Swipe Up";
case 128:
return "Swipe Down";
case 256:
return "Pinch In";
case 512:
return "Pinch Out";
default:
return "Unknown";
}
}
@ -417,18 +445,30 @@ public class InputGesturesTestBed
{
switch (gesture)
{
case 0: return Color.Black;
case 1: return Color.Blue;
case 2: return Color.SkyBlue;
case 4: return Color.Black;
case 8: return Color.Lime;
case 16: return Color.Red;
case 32: return Color.Red;
case 64: return Color.Red;
case 128: return Color.Red;
case 256: return Color.Violet;
case 512: return Color.Orange;
default: return Color.Black;
case 0:
return Color.Black;
case 1:
return Color.Blue;
case 2:
return Color.SkyBlue;
case 4:
return Color.Black;
case 8:
return Color.Lime;
case 16:
return Color.Red;
case 32:
return Color.Red;
case 64:
return Color.Red;
case 128:
return Color.Red;
case 256:
return Color.Violet;
case 512:
return Color.Orange;
default:
return Color.Black;
}
}
}

View file

@ -168,11 +168,20 @@ public class InputVirtualControls
// Move player according to pressed button
switch ((PadButton)pressedButton)
{
case PadButton.BUTTON_UP: playerPosition.Y -= playerSpeed * GetFrameTime(); break;
case PadButton.BUTTON_LEFT: playerPosition.X -= playerSpeed * GetFrameTime(); break;
case PadButton.BUTTON_RIGHT: playerPosition.X += playerSpeed * GetFrameTime(); break;
case PadButton.BUTTON_DOWN: playerPosition.Y += playerSpeed * GetFrameTime(); break;
default: break;
case PadButton.BUTTON_UP:
playerPosition.Y -= playerSpeed * GetFrameTime();
break;
case PadButton.BUTTON_LEFT:
playerPosition.X -= playerSpeed * GetFrameTime();
break;
case PadButton.BUTTON_RIGHT:
playerPosition.X += playerSpeed * GetFrameTime();
break;
case PadButton.BUTTON_DOWN:
playerPosition.Y += playerSpeed * GetFrameTime();
break;
default:
break;
}
;

View file

@ -21,7 +21,6 @@
********************************************************************************************/
using System.Numerics;
using System.Runtime.InteropServices;
using static Raylib_cs.Raylib;
namespace Examples.Models;

View file

@ -55,6 +55,7 @@ models:
| models/barracks.obj,<br> models/barracks_diffuse.png | [Alberto Cano](https://www.artstation.com/albertocano) | [CC-BY-NC](https://creativecommons.org/licenses/by-nc/4.0/legalcode) | - |
| models/church.obj,<br> models/church_diffuse.png | [Alberto Cano](https://www.artstation.com/albertocano) | [CC-BY-NC](https://creativecommons.org/licenses/by-nc/4.0/legalcode) | - |
| models/watermill.obj,<br> models/watermill_diffuse.png | [Alberto Cano](https://www.artstation.com/albertocano) | [CC-BY-NC](https://creativecommons.org/licenses/by-nc/4.0/legalcode) | - |
| greenman.glb, greenman_hat.glb, greenman_sword.glb, greenman_shield.glb | [@ip](https://github.com/ipzaur) | [CC0](https://creativecommons.org/publicdomain/zero/1.0/) | - |
images:
| resource | author | licence | notes |

View file

@ -477,7 +477,7 @@ public static unsafe partial class Rlgl
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial void SetPointSize(float size);
/// <summary>Set the point drawing size</summary>
/// <summary>Get the point drawing size</summary>
[LibraryImport(NativeLibName, EntryPoint = "rlGetPointSize")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial float GetPointSize();
@ -594,12 +594,12 @@ public static unsafe partial class Rlgl
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial GlVersion GetVersion();
/// <summary>Get default framebuffer width</summary>
/// <summary>Set current framebuffer width</summary>
[LibraryImport(NativeLibName, EntryPoint = "rlSetFramebufferWidth")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial int SetFramebufferWidth(int width);
/// <summary>Get default framebuffer width</summary>
/// <summary>Set current framebuffer height</summary>
[LibraryImport(NativeLibName, EntryPoint = "rlSetFramebufferHeight")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial int SetFramebufferHeight(int height);