Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ExportImageToMemory return type and update formatting #245

Merged
merged 1 commit into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Raylib-cs/interop/Raylib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ int count

/// <summary>Unload random values sequence</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void UnloadRandomSequence(int *sequence);
public static extern void UnloadRandomSequence(int* sequence);

/// <summary>Takes a screenshot of current screen (saved a .png)</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
Expand Down Expand Up @@ -1195,23 +1195,23 @@ Color color

/// <summary>Draw spline: Linear, minimum 2 points</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawSplineLinear(Vector2 *points, int pointCount, float thick, Color color);
public static extern void DrawSplineLinear(Vector2* points, int pointCount, float thick, Color color);

/// <summary>Draw spline: B-Spline, minimum 4 points</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawSplineBasis(Vector2 *points, int pointCount, float thick, Color color);
public static extern void DrawSplineBasis(Vector2* points, int pointCount, float thick, Color color);

/// <summary>Draw spline: Catmull-Rom, minimum 4 points</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawSplineCatmullRom(Vector2 *points, int pointCount, float thick, Color color);
public static extern void DrawSplineCatmullRom(Vector2* points, int pointCount, float thick, Color color);

/// <summary>Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawSplineBezierQuadratic(Vector2 *points, int pointCount, float thick, Color color);
public static extern void DrawSplineBezierQuadratic(Vector2* points, int pointCount, float thick, Color color);

/// <summary>Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void DrawSplineBezierCubic(Vector2 *points, int pointCount, float thick, Color color);
public static extern void DrawSplineBezierCubic(Vector2* points, int pointCount, float thick, Color color);

/// <summary>Draw spline segment: Linear, 2 points</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
Expand Down Expand Up @@ -1368,7 +1368,7 @@ int headerSize

/// <summary>Export image to memory buffer</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern char* ExportImageToMemory(Image image, sbyte* fileType, int *fileSize);
public static extern byte* ExportImageToMemory(Image image, sbyte* fileType, int* fileSize);

/// <summary>Export image as code file defining an array of bytes</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
Expand Down Expand Up @@ -1519,7 +1519,7 @@ Color color

/// <summary>Rotate image by input angle in degrees (-359 to 359)</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void ImageRotate(Image *image, int degrees);
public static extern void ImageRotate(Image* image, int degrees);

/// <summary>Rotate image clockwise 90deg</summary>
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
Expand Down
10 changes: 8 additions & 2 deletions Raylib-cs/types/Rectangle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ public Rectangle(Vector2 position, Vector2 size)

public Vector2 Position
{
readonly get { return new Vector2(X,Y); }
readonly get
{
return new Vector2(X, Y);
}
set
{
X = value.X;
Expand All @@ -58,7 +61,10 @@ public Vector2 Position

public Vector2 Size
{
readonly get { return new Vector2(Width,Height); }
readonly get
{
return new Vector2(Width, Height);
}
set
{
Width = value.X;
Expand Down