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

Bug fixes and review comments

This commit is contained in:
Rgebee 2022-08-28 10:19:47 +01:00
commit 181dab01af
3 changed files with 29 additions and 29 deletions

View file

@ -82,7 +82,7 @@ namespace Raylib_cs
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ClearWindowState(ConfigFlags flag); public static extern void ClearWindowState(ConfigFlags flag);
/// <summary>Toggle fullscreen mode (only PLATFORM_DESKTOP)</summary> /// <summary>Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ToggleFullscreen(); public static extern void ToggleFullscreen();
@ -146,19 +146,19 @@ namespace Raylib_cs
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 GetMonitorPosition(int monitor); public static extern Vector2 GetMonitorPosition(int monitor);
/// <summary>Get primary monitor width</summary> /// <summary>Get specified monitor width</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetMonitorWidth(int monitor); public static extern int GetMonitorWidth(int monitor);
/// <summary>Get primary monitor height</summary> /// <summary>Get specified monitor height</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetMonitorHeight(int monitor); public static extern int GetMonitorHeight(int monitor);
/// <summary>Get primary monitor physical width in millimetres</summary> /// <summary>Get specified monitor physical width in millimetres</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetMonitorPhysicalWidth(int monitor); public static extern int GetMonitorPhysicalWidth(int monitor);
/// <summary>Get primary monitor physical height in millimetres</summary> /// <summary>Get specified monitor physical height in millimetres</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int GetMonitorPhysicalHeight(int monitor); public static extern int GetMonitorPhysicalHeight(int monitor);
@ -174,7 +174,7 @@ namespace Raylib_cs
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector2 GetWindowScaleDPI(); public static extern Vector2 GetWindowScaleDPI();
/// <summary>Get the human-readable, UTF-8 encoded name of the primary monitor</summary> /// <summary>Get the human-readable, UTF-8 encoded name of the specified monitor</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern sbyte* GetMonitorName(int monitor); public static extern sbyte* GetMonitorName(int monitor);
@ -1049,11 +1049,11 @@ namespace Raylib_cs
/// <summary>Export image data to file</summary> /// <summary>Export image data to file</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ExportImage(Image image, sbyte* fileName); public static extern CBool ExportImage(Image image, sbyte* fileName);
/// <summary>Export image as code file defining an array of bytes</summary> /// <summary>Export image as code file defining an array of bytes</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ExportImageAsCode(Image image, sbyte* fileName); public static extern CBool ExportImageAsCode(Image image, sbyte* fileName);
// Image generation functions // Image generation functions
@ -1370,31 +1370,31 @@ namespace Raylib_cs
// Color/pixel related functions // Color/pixel related functions
/// <summary>Returns hexadecimal value for a Color</summary> /// <summary>Get hexadecimal value for a Color</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int ColorToInt(Color color); public static extern int ColorToInt(Color color);
/// <summary>Returns color normalized as float [0..1]</summary> /// <summary>Get color normalized as float [0..1]</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector4 ColorNormalize(Color color); public static extern Vector4 ColorNormalize(Color color);
/// <summary>Returns color from normalized values [0..1]</summary> /// <summary>Get color from normalized values [0..1]</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Color ColorFromNormalized(Vector4 normalized); public static extern Color ColorFromNormalized(Vector4 normalized);
/// <summary>Returns HSV values for a Color, hue [0..360], saturation/value [0..1]</summary> /// <summary>Get HSV values for a Color, hue [0..360], saturation/value [0..1]</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Vector3 ColorToHSV(Color color); public static extern Vector3 ColorToHSV(Color color);
/// <summary>Returns a Color from HSV values, hue [0..360], saturation/value [0..1]</summary> /// <summary>Get a Color from HSV values, hue [0..360], saturation/value [0..1]</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Color ColorFromHSV(float hue, float saturation, float value); public static extern Color ColorFromHSV(float hue, float saturation, float value);
/// <summary>Returns color with alpha applied, alpha goes from 0.0f to 1.0f</summary> /// <summary>Get color with alpha applied, alpha goes from 0.0f to 1.0f</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Color ColorAlpha(Color color, float alpha); public static extern Color ColorAlpha(Color color, float alpha);
/// <summary>Returns src alpha-blended into dst color with tint</summary> /// <summary>Get src alpha-blended into dst color with tint</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Color ColorAlphaBlend(Color dst, Color src, Color tint); public static extern Color ColorAlphaBlend(Color dst, Color src, Color tint);
@ -1973,11 +1973,11 @@ namespace Raylib_cs
/// <summary>Export wave data to file</summary> /// <summary>Export wave data to file</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ExportWave(Wave wave, sbyte* fileName); public static extern CBool ExportWave(Wave wave, sbyte* fileName);
/// <summary>Export wave sample data to code (.h)</summary> /// <summary>Export wave sample data to code (.h)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ExportWaveAsCode(Wave wave, sbyte* fileName); public static extern CBool ExportWaveAsCode(Wave wave, sbyte* fileName);
// Wave/Sound management functions // Wave/Sound management functions

View file

@ -659,7 +659,7 @@ namespace Raylib_cs
/// <summary>Get internal accumulated transform matrix</summary> /// <summary>Get internal accumulated transform matrix</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern Matrix4x4 rlGetMatrixTramsform(); public static extern Matrix4x4 rlGetMatrixTransform();
/// <summary>Get internal projection matrix for stereo render (selected eye)</summary> /// <summary>Get internal projection matrix for stereo render (selected eye)</summary>
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]

View file

@ -20,7 +20,7 @@ namespace Raylib_cs
SetWindowTitle(str1.AsPointer()); SetWindowTitle(str1.AsPointer());
} }
/// <summary>Get the human-readable, UTF-8 encoded name of the primary monitor</summary> /// <summary>Get the human-readable, UTF-8 encoded name of the specified monitor</summary>
public static string GetMonitorName_(int monitor) public static string GetMonitorName_(int monitor)
{ {
return Utf8StringUtils.GetUTF8String(GetMonitorName(monitor)); return Utf8StringUtils.GetUTF8String(GetMonitorName(monitor));
@ -116,17 +116,17 @@ namespace Raylib_cs
} }
/// <summary>Export image data to file</summary> /// <summary>Export image data to file</summary>
public static void ExportImage(Image image, string fileName) public static CBool ExportImage(Image image, string fileName)
{ {
using var str1 = fileName.ToUTF8Buffer(); using var str1 = fileName.ToUTF8Buffer();
ExportImage(image, str1.AsPointer()); return ExportImage(image, str1.AsPointer());
} }
/// <summary>Export image as code file defining an array of bytes</summary> /// <summary>Export image as code file defining an array of bytes</summary>
public static void ExportImageAsCode(Image image, string fileName) public static CBool ExportImageAsCode(Image image, string fileName)
{ {
using var str1 = fileName.ToUTF8Buffer(); using var str1 = fileName.ToUTF8Buffer();
ExportImageAsCode(image, str1.AsPointer()); return ExportImageAsCode(image, str1.AsPointer());
} }
/// <summary>Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR)</summary> /// <summary>Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR)</summary>
@ -202,7 +202,7 @@ namespace Raylib_cs
return files; return files;
} }
/// <summary>Return gamepad internal name id</summary> /// <summary>Get gamepad internal name id</summary>
public static string GetGamepadName_(int gamepad) public static string GetGamepadName_(int gamepad)
{ {
return Utf8StringUtils.GetUTF8String(GetGamepadName(gamepad)); return Utf8StringUtils.GetUTF8String(GetGamepadName(gamepad));
@ -804,7 +804,7 @@ namespace Raylib_cs
return GetCodepointCount(str1.AsPointer()); return GetCodepointCount(str1.AsPointer());
} }
/// <summary>Returns next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure</summary> /// <summary>Get next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure</summary>
/// <returns>single codepoint / "char"</returns> /// <returns>single codepoint / "char"</returns>
public static int GetCodepoint(string text, ref int bytesProcessed) public static int GetCodepoint(string text, ref int bytesProcessed)
{ {
@ -884,17 +884,17 @@ namespace Raylib_cs
} }
/// <summary>Export wave data to file</summary> /// <summary>Export wave data to file</summary>
public static void ExportWave(Wave wave, string fileName) public static CBool ExportWave(Wave wave, string fileName)
{ {
using var str1 = fileName.ToUTF8Buffer(); using var str1 = fileName.ToUTF8Buffer();
ExportWave(wave, str1.AsPointer()); return ExportWave(wave, str1.AsPointer());
} }
/// <summary>Export wave sample data to code (.h)</summary> /// <summary>Export wave sample data to code (.h)</summary>
public static void ExportWaveAsCode(Wave wave, string fileName) public static CBool ExportWaveAsCode(Wave wave, string fileName)
{ {
using var str1 = fileName.ToUTF8Buffer(); using var str1 = fileName.ToUTF8Buffer();
ExportWaveAsCode(wave, str1.AsPointer()); return ExportWaveAsCode(wave, str1.AsPointer());
} }
/// <summary>Load music stream from file</summary> /// <summary>Load music stream from file</summary>