mirror of
https://github.com/raylib-cs/raylib-cs
synced 2025-06-30 19:03:42 -04:00
Update to raylib 4.2 (#117)
Update bindings to use raylib 4.2.0. Review comments and utils.
This commit is contained in:
@ -70,6 +70,11 @@ namespace Raylib_cs
|
||||
/// </summary>
|
||||
FLAG_WINDOW_HIGHDPI = 0x00002000,
|
||||
|
||||
/// <summary>
|
||||
/// Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED
|
||||
/// </summary>
|
||||
FLAG_WINDOW_MOUSE_PASSTHROUGH = 0x00004000,
|
||||
|
||||
/// <summary>
|
||||
/// Set to try enabling MSAA 4X
|
||||
/// </summary>
|
||||
@ -158,6 +163,11 @@ namespace Raylib_cs
|
||||
/// </summary>
|
||||
BLEND_SUBTRACT_COLORS,
|
||||
|
||||
/// <summary>
|
||||
/// Blend premultiplied textures considering alpha
|
||||
/// </summary>
|
||||
BLEND_ALPHA_PREMULTIPLY,
|
||||
|
||||
/// <summary>
|
||||
/// Blend textures using custom src/dst factors (use rlSetBlendMode())
|
||||
/// </summary>
|
||||
|
@ -279,7 +279,7 @@ namespace Raylib_cs
|
||||
public enum GamepadButton
|
||||
{
|
||||
/// <summary>
|
||||
/// This is here just for error checking
|
||||
/// Unknown button, just for error checking
|
||||
/// </summary>
|
||||
GAMEPAD_BUTTON_UNKNOWN = 0,
|
||||
|
||||
@ -323,41 +323,54 @@ namespace Raylib_cs
|
||||
/// </summary>
|
||||
GAMEPAD_BUTTON_RIGHT_FACE_LEFT,
|
||||
|
||||
// Triggers
|
||||
/// <summary>
|
||||
/// Gamepad top/back trigger left (first), it could be a trailing button
|
||||
/// </summary>
|
||||
GAMEPAD_BUTTON_LEFT_TRIGGER_1,
|
||||
GAMEPAD_BUTTON_LEFT_TRIGGER_2,
|
||||
GAMEPAD_BUTTON_RIGHT_TRIGGER_1,
|
||||
GAMEPAD_BUTTON_RIGHT_TRIGGER_2,
|
||||
|
||||
// These are buttons in the center of the gamepad
|
||||
|
||||
/// <summary>
|
||||
/// PS3 Select
|
||||
/// Gamepad top/back trigger left (second), it could be a trailing button
|
||||
/// </summary>
|
||||
GAMEPAD_BUTTON_LEFT_TRIGGER_2,
|
||||
|
||||
/// <summary>
|
||||
/// Gamepad top/back trigger right (first), it could be a trailing button
|
||||
/// </summary>
|
||||
GAMEPAD_BUTTON_RIGHT_TRIGGER_1,
|
||||
|
||||
/// <summary>
|
||||
/// Gamepad top/back trigger right (second), it could be a trailing button
|
||||
/// </summary>
|
||||
GAMEPAD_BUTTON_RIGHT_TRIGGER_2,
|
||||
|
||||
/// <summary>
|
||||
/// Gamepad center buttons, left one (i.e. PS3: Select)
|
||||
/// </summary>
|
||||
GAMEPAD_BUTTON_MIDDLE_LEFT,
|
||||
|
||||
/// <summary>
|
||||
/// PS Button/XBOX Button
|
||||
/// Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX)
|
||||
/// </summary>
|
||||
GAMEPAD_BUTTON_MIDDLE,
|
||||
|
||||
/// <summary>
|
||||
/// PS3 Start
|
||||
/// Gamepad center buttons, right one (i.e. PS3: Start)
|
||||
/// </summary>
|
||||
GAMEPAD_BUTTON_MIDDLE_RIGHT,
|
||||
|
||||
/// <summary>
|
||||
/// Left joystick press button
|
||||
/// Gamepad joystick pressed button left
|
||||
/// </summary>
|
||||
GAMEPAD_BUTTON_LEFT_THUMB,
|
||||
|
||||
/// <summary>
|
||||
/// Right joystick press button
|
||||
/// Gamepad joystick pressed button right
|
||||
/// </summary>
|
||||
GAMEPAD_BUTTON_RIGHT_THUMB
|
||||
}
|
||||
|
||||
/// <summary>Gesture
|
||||
/// <summary>
|
||||
/// Gesture
|
||||
/// NOTE: It could be used as flags to enable only some gestures
|
||||
/// </summary>
|
||||
[Flags]
|
||||
|
@ -190,14 +190,14 @@ namespace Raylib_cs
|
||||
/// <summary>Get dropped files names (memory should be freed)</summary>
|
||||
public static string[] GetDroppedFiles()
|
||||
{
|
||||
int count;
|
||||
var buffer = GetDroppedFiles(&count);
|
||||
var files = new string[count];
|
||||
var filePathList = LoadDroppedFiles();
|
||||
var files = new string[filePathList.count];
|
||||
|
||||
for (var i = 0; i < count; i++)
|
||||
for (var i = 0; i < filePathList.count; i++)
|
||||
{
|
||||
files[i] = Marshal.PtrToStringUTF8((IntPtr)buffer[i]);
|
||||
files[i] = Marshal.PtrToStringUTF8((IntPtr)filePathList.paths[i]);
|
||||
}
|
||||
UnloadDroppedFiles(filePathList);
|
||||
|
||||
return files;
|
||||
}
|
||||
@ -661,15 +661,6 @@ namespace Raylib_cs
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Compute mesh binormals</summary>
|
||||
public static void GenMeshBinormals(ref Mesh mesh)
|
||||
{
|
||||
fixed (Mesh* p = &mesh)
|
||||
{
|
||||
GenMeshBinormals(p);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Convert wave data to desired format</summary>
|
||||
public static void WaveFormat(ref Wave wave, int sampleRate, int sampleSize, int channels)
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ namespace Raylib_cs
|
||||
{
|
||||
return new CBool { value = (sbyte)(left.value - right.value) };
|
||||
}
|
||||
|
||||
|
||||
// ToString override
|
||||
public override string ToString()
|
||||
{
|
||||
|
27
Raylib-cs/types/native/FilePathList.cs
Normal file
27
Raylib-cs/types/native/FilePathList.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Raylib_cs
|
||||
{
|
||||
/// <summary>
|
||||
/// File path list
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe struct FilePathList
|
||||
{
|
||||
/// <summary>
|
||||
/// Filepaths max entries
|
||||
/// </summary>
|
||||
public uint capacity;
|
||||
|
||||
/// <summary>
|
||||
/// Filepaths entries count
|
||||
/// </summary>
|
||||
public uint count;
|
||||
|
||||
/// <summary>
|
||||
/// Filepaths entries
|
||||
/// </summary>
|
||||
public byte** paths;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user