mirror of
https://github.com/raylib-cs/raylib-cs
synced 2025-04-03 11:09:40 -04:00
- Improvements for 2.5 release. Alot more work than I expected.
- Examples are out of date and will need to be regenerated before release.
This commit is contained in:
parent
1236e4979a
commit
dd9710fc57
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,35 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
17
.github/ISSUE_TEMPLATE/feature_request.md
vendored
17
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,17 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -8,6 +8,8 @@
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
.vscode/
|
||||
|
||||
# Binaries
|
||||
![Bb]in/
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Raylib
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Raylib-cs
|
||||
* Extensions.cs - Extra features
|
||||
* Extensions.cs - Higher level features over bindings. This file is not automatically generated.
|
||||
* Copyright 2019 Chris Dill
|
||||
*
|
||||
* Release under zLib License.
|
||||
@ -7,10 +7,74 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Numerics;
|
||||
|
||||
namespace Raylib
|
||||
{
|
||||
// Extensions to the raylib bindings.
|
||||
// Seperate for easier code generation.
|
||||
public partial class Raylib
|
||||
{
|
||||
// extension providing SubText
|
||||
public static string SubText(this string input, int position, int length)
|
||||
{
|
||||
return input.Substring(position, Math.Min(length, input.Length));
|
||||
}
|
||||
|
||||
// Here (in the public method) we hide some low level details
|
||||
// memory allocation, string manipulations etc.
|
||||
public static bool CoreGuiTextBox(Rectangle bounds, ref string text, int textSize, bool freeEdit)
|
||||
{
|
||||
if (null == text)
|
||||
{
|
||||
return false; // or throw exception; or assign "" to text
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder(text);
|
||||
|
||||
// If we allow editing we should allocate enough size (Length) within StringBuilder
|
||||
if (textSize > sb.Length)
|
||||
{
|
||||
sb.Length = textSize;
|
||||
}
|
||||
|
||||
bool result = GuiTextBox(bounds, sb, sb.Length, freeEdit);
|
||||
|
||||
// Back to string (StringBuilder can have been edited)
|
||||
// You may want to add some logic here; e.g. trim trailing '\0'
|
||||
text = sb.ToString();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Text Box control with multiple lines
|
||||
public static bool CoreTextBoxMulti(Rectangle bounds, ref string text, int textSize, bool freeEdit)
|
||||
{
|
||||
if (null == text)
|
||||
{
|
||||
return false; // or throw exception; or assign "" to text
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder(text);
|
||||
|
||||
// If we allow editing we should allocate enough size (Length) within StringBuilder
|
||||
if (textSize > sb.Length)
|
||||
{
|
||||
sb.Length = textSize;
|
||||
}
|
||||
|
||||
bool result = GuiTextBoxMulti(bounds, sb, sb.Length, freeEdit);
|
||||
|
||||
// Back to string (StringBuilder can have been edited)
|
||||
// You may want to add some logic here; e.g. trim trailing '\0'
|
||||
text = sb.ToString();
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// Small utility for tweening values
|
||||
public struct Tween
|
||||
{
|
||||
public delegate float Callback(float t, float b, float c, float d);
|
||||
@ -51,6 +115,35 @@ namespace Raylib
|
||||
|
||||
public partial struct Color
|
||||
{
|
||||
// Example - Color.RED instead of RED
|
||||
// Custom raylib color palette for amazing visuals
|
||||
public static Color LIGHTGRAY = new Color(200, 200, 200, 255);
|
||||
public static Color GRAY = new Color(130, 130, 130, 255);
|
||||
public static Color DARKGRAY = new Color(80, 80, 80, 255);
|
||||
public static Color YELLOW = new Color(253, 249, 0, 255);
|
||||
public static Color GOLD = new Color(255, 203, 0, 255);
|
||||
public static Color ORANGE = new Color(255, 161, 0, 255);
|
||||
public static Color PINK = new Color(255, 109, 194, 255);
|
||||
public static Color RED = new Color(230, 41, 55, 255);
|
||||
public static Color MAROON = new Color(190, 33, 55, 255);
|
||||
public static Color GREEN = new Color(0, 228, 48, 255);
|
||||
public static Color LIME = new Color(0, 158, 47, 255);
|
||||
public static Color DARKGREEN = new Color(0, 117, 44, 255);
|
||||
public static Color SKYBLUE = new Color(102, 191, 255, 255);
|
||||
public static Color BLUE = new Color(0, 121, 241, 255);
|
||||
public static Color DARKBLUE = new Color(0, 82, 172, 255);
|
||||
public static Color PURPLE = new Color(200, 122, 255, 255);
|
||||
public static Color VIOLET = new Color(135, 60, 190, 255);
|
||||
public static Color DARKPURPLE = new Color(112, 31, 126, 255);
|
||||
public static Color BEIGE = new Color(211, 176, 131, 255);
|
||||
public static Color BROWN = new Color(127, 106, 79, 255);
|
||||
public static Color DARKBROWN = new Color(76, 63, 47, 255);
|
||||
public static Color WHITE = new Color(255, 255, 255, 255);
|
||||
public static Color BLACK = new Color(0, 0, 0, 255);
|
||||
public static Color BLANK = new Color(0, 0, 0, 0);
|
||||
public static Color MAGENTA = new Color(255, 0, 255, 255);
|
||||
public static Color RAYWHITE = new Color(245, 245, 245, 255);
|
||||
|
||||
public Color(byte r, byte g, byte b, byte a)
|
||||
{
|
||||
this.r = r;
|
||||
@ -80,13 +173,7 @@ namespace Raylib
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs linear interpolation of <see cref="Color"/>.
|
||||
/// </summary>
|
||||
/// <param name="value1">Source <see cref="Color"/>.</param>
|
||||
/// <param name="value2">Destination <see cref="Color"/>.</param>
|
||||
/// <param name="amount">Interpolation factor.</param>
|
||||
/// <returns>Interpolated <see cref="Color"/>.</returns>
|
||||
// Performs linear interpolation of <see cref="Color"/>.
|
||||
public static Color Lerp(Color value1, Color value2, float amount)
|
||||
{
|
||||
amount = Raylib.Clamp(amount, 0.0f, 1.0f);
|
||||
@ -99,12 +186,61 @@ namespace Raylib
|
||||
}
|
||||
}
|
||||
|
||||
public partial struct Rectangle
|
||||
{
|
||||
public Rectangle(float x, float y, float width, float height)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
}
|
||||
|
||||
public partial struct BoundingBox
|
||||
{
|
||||
public BoundingBox(Vector3 min, Vector3 max)
|
||||
{
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
}
|
||||
|
||||
public partial struct Camera3D
|
||||
{
|
||||
public Camera3D(Vector3 position, Vector3 target, Vector3 up, float fovy = 90, CameraType type = CameraType.CAMERA_PERSPECTIVE)
|
||||
{
|
||||
this.position = position;
|
||||
this.target = target;
|
||||
this.up = up;
|
||||
this.fovy = fovy;
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
public partial struct Ray
|
||||
{
|
||||
public Ray(Vector3 position, Vector3 direction)
|
||||
{
|
||||
this.position = position;
|
||||
this.direction = direction;
|
||||
}
|
||||
}
|
||||
|
||||
public partial struct RayHitInfo
|
||||
{
|
||||
public RayHitInfo(bool hit, float distance, Vector3 position, Vector3 normal)
|
||||
{
|
||||
this.hit = hit;
|
||||
this.distance = distance;
|
||||
this.position = position;
|
||||
this.normal = normal;
|
||||
}
|
||||
}
|
||||
|
||||
// Utlity for accessing math functions through struct
|
||||
public partial struct Vector2
|
||||
{
|
||||
public float X {get{return x;} set {x = value;}}
|
||||
public float Y {get{return y;} set {y = value;}}
|
||||
|
||||
public Vector2(float x, float y)
|
||||
{
|
||||
this.x = x;
|
||||
@ -130,29 +266,76 @@ namespace Raylib
|
||||
|
||||
// common values
|
||||
public static Vector2 Zero { get { return Raylib.Vector2Zero(); } }
|
||||
|
||||
public static Vector2 One { get { return Raylib.Vector2One(); } }
|
||||
|
||||
public static Vector2 UnitX { get { return new Vector2(1, 0); } }
|
||||
|
||||
public static Vector2 UnitY { get { return new Vector2(0, 1); } }
|
||||
|
||||
// convienient operators
|
||||
public static bool operator ==(Vector2 v1, Vector2 v2) => (v1.x == v2.x && v1.y == v2.y);
|
||||
public static bool operator !=(Vector2 v1, Vector2 v2) => !(v1 == v2);
|
||||
public static bool operator >(Vector2 v1, Vector2 v2) => v1.x > v2.x && v1.y > v2.y;
|
||||
public static bool operator <(Vector2 v1, Vector2 v2) => v1.x < v2.x && v1.y < v2.y;
|
||||
public static Vector2 operator +(Vector2 v1, Vector2 v2) => Raylib.Vector2Add(v1, v2);
|
||||
public static Vector2 operator -(Vector2 v1, Vector2 v2) => Raylib.Vector2Subtract(v1, v2);
|
||||
public static Vector2 operator *(Vector2 v1, Vector2 v2) => Raylib.Vector2Multiplyv(v1, v2);
|
||||
public static Vector2 operator *(Vector2 v, float scale) => Raylib.Vector2Scale(v, scale);
|
||||
public static Vector2 operator *(float scale, Vector2 v) => Raylib.Vector2Scale(v, scale);
|
||||
public static Vector2 operator /(Vector2 v1, Vector2 v2) => Raylib.Vector2DivideV(v1, v2);
|
||||
public static Vector2 operator /(Vector2 v1, float div) => Raylib.Vector2Divide(v1, div);
|
||||
public static Vector2 operator -(Vector2 v1) => Raylib.Vector2Negate(v1);
|
||||
|
||||
public static bool operator !=(Vector2 v1, Vector2 v2)
|
||||
{
|
||||
return !(v1 == v2);
|
||||
}
|
||||
|
||||
public static bool operator >(Vector2 v1, Vector2 v2)
|
||||
{
|
||||
return v1.x > v2.x && v1.y > v2.y;
|
||||
}
|
||||
|
||||
public static bool operator <(Vector2 v1, Vector2 v2)
|
||||
{
|
||||
return v1.x < v2.x && v1.y < v2.y;
|
||||
}
|
||||
|
||||
public static Vector2 operator +(Vector2 v1, Vector2 v2)
|
||||
{
|
||||
return Raylib.Vector2Add(v1, v2);
|
||||
}
|
||||
|
||||
public static Vector2 operator -(Vector2 v1, Vector2 v2)
|
||||
{
|
||||
return Raylib.Vector2Subtract(v1, v2);
|
||||
}
|
||||
|
||||
public static Vector2 operator *(Vector2 v1, Vector2 v2)
|
||||
{
|
||||
return Raylib.Vector2Multiplyv(v1, v2);
|
||||
}
|
||||
|
||||
public static Vector2 operator *(Vector2 v, float scale)
|
||||
{
|
||||
return Raylib.Vector2Scale(v, scale);
|
||||
}
|
||||
|
||||
public static Vector2 operator *(float scale, Vector2 v)
|
||||
{
|
||||
return Raylib.Vector2Scale(v, scale);
|
||||
}
|
||||
|
||||
public static Vector2 operator /(Vector2 v1, Vector2 v2)
|
||||
{
|
||||
return Raylib.Vector2DivideV(v1, v2);
|
||||
}
|
||||
|
||||
public static Vector2 operator /(Vector2 v1, float div)
|
||||
{
|
||||
return Raylib.Vector2Divide(v1, div);
|
||||
}
|
||||
|
||||
public static Vector2 operator -(Vector2 v1)
|
||||
{
|
||||
return Raylib.Vector2Negate(v1);
|
||||
}
|
||||
|
||||
public static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
|
||||
{
|
||||
return new Vector2(
|
||||
Raylib.Lerp(value1.X, value2.X, amount),
|
||||
Raylib.Lerp(value1.Y, value2.Y, amount)
|
||||
Raylib.Lerp(value1.x, value2.x, amount),
|
||||
Raylib.Lerp(value1.y, value2.y, amount)
|
||||
);
|
||||
}
|
||||
|
||||
@ -183,7 +366,7 @@ namespace Raylib
|
||||
|
||||
public static float DistanceSquared(Vector2 v1, Vector2 v2)
|
||||
{
|
||||
float a = v1.X - v2.X, b = v1.Y - v2.Y;
|
||||
float a = v1.x - v2.x, b = v1.y - v2.y;
|
||||
return (a * a) + (b * b);
|
||||
}
|
||||
|
||||
@ -221,8 +404,8 @@ namespace Raylib
|
||||
public static Vector2 Max(Vector2 v1, Vector2 v2)
|
||||
{
|
||||
return new Vector2(
|
||||
v1.X > v2.X ? v1.X : v2.X,
|
||||
v1.Y > v2.Y ? v1.Y : v2.Y
|
||||
v1.x > v2.x ? v1.x : v2.x,
|
||||
v1.y > v2.y ? v1.y : v2.y
|
||||
);
|
||||
}
|
||||
|
||||
@ -230,8 +413,8 @@ namespace Raylib
|
||||
public static Vector2 Min(Vector2 v1, Vector2 v2)
|
||||
{
|
||||
return new Vector2(
|
||||
v1.X < v2.X ? v1.X : v2.X,
|
||||
v1.Y < v2.Y ? v1.Y : v2.Y
|
||||
v1.x < v2.x ? v1.x : v2.x,
|
||||
v1.y < v2.y ? v1.y : v2.y
|
||||
);
|
||||
}
|
||||
|
||||
@ -239,8 +422,8 @@ namespace Raylib
|
||||
public static Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max)
|
||||
{
|
||||
return new Vector2(
|
||||
Raylib.Clamp(value1.X, min.X, max.X),
|
||||
Raylib.Clamp(value1.Y, min.Y, max.Y)
|
||||
Raylib.Clamp(value1.x, min.x, max.x),
|
||||
Raylib.Clamp(value1.y, min.y, max.y)
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -249,11 +432,6 @@ namespace Raylib
|
||||
// Vector3 type
|
||||
public partial struct Vector3
|
||||
{
|
||||
// captial option for xna/fna/monogame compatability
|
||||
public float X { get => x; set => x = value; }
|
||||
public float Y { get => y; set => y = value; }
|
||||
public float Z { get => z; set => z = value; }
|
||||
|
||||
public Vector3(float x, float y, float z)
|
||||
{
|
||||
this.x = x;
|
||||
@ -301,9 +479,9 @@ namespace Raylib
|
||||
public static Vector3 Lerp(Vector3 value1, Vector3 value2, float amount)
|
||||
{
|
||||
return new Vector3(
|
||||
Raylib.Lerp(value1.X, value2.X, amount),
|
||||
Raylib.Lerp(value1.Y, value2.Y, amount),
|
||||
Raylib.Lerp(value1.Z, value2.Z, amount)
|
||||
Raylib.Lerp(value1.x, value2.x, amount),
|
||||
Raylib.Lerp(value1.y, value2.y, amount),
|
||||
Raylib.Lerp(value1.z, value2.z, amount)
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -321,13 +499,14 @@ namespace Raylib
|
||||
|
||||
public Vector4(float value)
|
||||
{
|
||||
this.x = value;
|
||||
this.y = value;
|
||||
this.z = value;
|
||||
this.w = value;
|
||||
x = value;
|
||||
y = value;
|
||||
z = value;
|
||||
w = value;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj) => (obj is Vector4) && Equals((Vector4)obj);
|
||||
|
||||
public override int GetHashCode() => x.GetHashCode() + y.GetHashCode() + z.GetHashCode() + w.GetHashCode();
|
||||
|
||||
public override string ToString()
|
||||
@ -337,8 +516,11 @@ namespace Raylib
|
||||
|
||||
// convienient operators
|
||||
public static bool operator ==(Vector4 v1, Vector4 v2) => (v1.x == v2.x && v1.y == v2.y && v1.z == v2.z && v1.w == v2.w);
|
||||
|
||||
public static bool operator !=(Vector4 v1, Vector4 v2) => !(v1 == v2);
|
||||
|
||||
public static bool operator >(Vector4 v1, Vector4 v2) => v1.x > v2.x && v1.y > v2.y && v1.z > v2.z && v2.w > v2.w;
|
||||
|
||||
public static bool operator <(Vector4 v1, Vector4 v2) => v1.x < v2.x && v1.y < v2.y && v1.z < v2.z && v1.w < v2.w;
|
||||
}
|
||||
}
|
||||
|
@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package>
|
||||
<metadata minClientVersion="3.3.0">
|
||||
<id>Raylib-cs</id>
|
||||
<version>1.4</version>
|
||||
<authors>mysterious_space</authors>
|
||||
<owners>mysterious_space</owners>
|
||||
<licenseUrl>https://github.com/ChrisDill/Raylib-cs/blob/master/LICENSE</licenseUrl>
|
||||
<projectUrl>https://github.com/ChrisDill/Raylib-cs</projectUrl>
|
||||
<iconUrl>https://github.com/ChrisDill/Raylib-cs/blob/master/Logo/raylib-cs.ico</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>C# bindings for raylib, a simple and easy-to-use library to learn videogames programming.</description>
|
||||
<copyright>Copyright 2018</copyright>
|
||||
<tags>raylib csharp binding opengl gamedev</tags>
|
||||
|
||||
<contentFiles>
|
||||
<files include="Easings.cs" buildAction="Content" />
|
||||
<files include="Raygui.cs" buildAction="Content" />
|
||||
<files include="Raymath.cs" buildAction="Content" />
|
||||
<files include="Raylib.cs" buildAction="Content" />
|
||||
</contentFiles>
|
||||
</metadata>
|
||||
<files>
|
||||
<!-- <file src="Raylib.cs" target="contentFiles" /> -->
|
||||
<file src="Raylib.cs" target="contentFiles" />
|
||||
</files>
|
||||
</package>
|
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<ItemGroup Condition=" '$(Platform)' == 'x64' ">
|
||||
<Content Include="$(MSBuildThisFileDirectory)..\native\x64\raylib.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<Link>raylib.dll</Link>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(Platform)' == 'x86' OR '$(Platform)' == 'AnyCPU' ">
|
||||
<Content Include="$(MSBuildThisFileDirectory)..\native\x86\raylib.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<Link>raylib.dll</Link>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -438,53 +438,16 @@ namespace Raylib
|
||||
public byte g;
|
||||
public byte b;
|
||||
public byte a;
|
||||
|
||||
// extension to access colours from struct
|
||||
// Custom raylib color palette for amazing visuals
|
||||
public static Color LIGHTGRAY = new Color(200, 200, 200, 255);
|
||||
public static Color GRAY = new Color(130, 130, 130, 255);
|
||||
public static Color DARKGRAY = new Color(80, 80, 80, 255);
|
||||
public static Color YELLOW = new Color(253, 249, 0, 255);
|
||||
public static Color GOLD = new Color(255, 203, 0, 255);
|
||||
public static Color ORANGE = new Color(255, 161, 0, 255);
|
||||
public static Color PINK = new Color(255, 109, 194, 255);
|
||||
public static Color RED = new Color(230, 41, 55, 255);
|
||||
public static Color MAROON = new Color(190, 33, 55, 255);
|
||||
public static Color GREEN = new Color(0, 228, 48, 255);
|
||||
public static Color LIME = new Color(0, 158, 47, 255);
|
||||
public static Color DARKGREEN = new Color(0, 117, 44, 255);
|
||||
public static Color SKYBLUE = new Color(102, 191, 255, 255);
|
||||
public static Color BLUE = new Color(0, 121, 241, 255);
|
||||
public static Color DARKBLUE = new Color(0, 82, 172, 255);
|
||||
public static Color PURPLE = new Color(200, 122, 255, 255);
|
||||
public static Color VIOLET = new Color(135, 60, 190, 255);
|
||||
public static Color DARKPURPLE = new Color(112, 31, 126, 255);
|
||||
public static Color BEIGE = new Color(211, 176, 131, 255);
|
||||
public static Color BROWN = new Color(127, 106, 79, 255);
|
||||
public static Color DARKBROWN = new Color(76, 63, 47, 255);
|
||||
public static Color WHITE = new Color(255, 255, 255, 255);
|
||||
public static Color BLACK = new Color(0, 0, 0, 255);
|
||||
public static Color BLANK = new Color(0, 0, 0, 0);
|
||||
public static Color MAGENTA = new Color(255, 0, 255, 255);
|
||||
public static Color RAYWHITE = new Color(245, 245, 245, 255);
|
||||
}
|
||||
|
||||
// Rectangle type
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public struct Rectangle
|
||||
public partial struct Rectangle
|
||||
{
|
||||
public float x;
|
||||
public float y;
|
||||
public float width;
|
||||
public float height;
|
||||
|
||||
public Rectangle(float x, float y, float width, float height)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
}
|
||||
|
||||
// Image type, bpp always RGBA (32bit)
|
||||
@ -544,25 +507,13 @@ namespace Raylib
|
||||
|
||||
// Camera type, defines a camera position/orientation in 3d space
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public struct Camera3D
|
||||
public partial struct Camera3D
|
||||
{
|
||||
public Vector3 position;
|
||||
public Vector3 target;
|
||||
public Vector3 up;
|
||||
|
||||
public float fovy;
|
||||
|
||||
public CameraType type;
|
||||
|
||||
public Camera3D(Vector3 position, Vector3 target, Vector3 up, float fovy = 90,
|
||||
CameraType type = CameraType.CAMERA_PERSPECTIVE)
|
||||
{
|
||||
this.position = position;
|
||||
this.target = target;
|
||||
this.up = up;
|
||||
this.fovy = fovy;
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
// Camera2D type, defines a 2d camera
|
||||
@ -577,16 +528,10 @@ namespace Raylib
|
||||
|
||||
// Bounding box type
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public struct BoundingBox
|
||||
public partial struct BoundingBox
|
||||
{
|
||||
public Vector3 min;
|
||||
public Vector3 max;
|
||||
|
||||
public BoundingBox(Vector3 min, Vector3 max)
|
||||
{
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
}
|
||||
|
||||
// Vertex data definning a mesh
|
||||
@ -597,7 +542,13 @@ namespace Raylib
|
||||
public int vertexCount;
|
||||
public int triangleCount;
|
||||
|
||||
// public Span<float> Vertices => new Span<float>(vertices.ToPointer(), vertexCount * 3);
|
||||
// Required ref struct. Looks like that has limitations due to GC and heap.
|
||||
// Maybe that is okay for games. Not using right now until I know it is worth it.
|
||||
public Span<float> Vertices => new Span<float>(vertices.ToPointer(), vertexCount * 3);
|
||||
public Span<float> TexCoords => new Span<float>(vertices.ToPointer(), vertexCount * 3);
|
||||
public Span<float> Vertices => new Span<float>(vertices.ToPointer(), vertexCount * 3);
|
||||
|
||||
// public Span<float> vertices;
|
||||
public IntPtr vertices;
|
||||
public IntPtr texcoords;
|
||||
public IntPtr texcoords2;
|
||||
@ -678,41 +629,20 @@ namespace Raylib
|
||||
|
||||
// Ray type (useful for raycast)
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public struct Ray
|
||||
public partial struct Ray
|
||||
{
|
||||
public Vector3 position;
|
||||
public Vector3 direction;
|
||||
|
||||
public Ray(Vector3 position, Vector3 direction)
|
||||
{
|
||||
this.position = position;
|
||||
this.direction = direction;
|
||||
}
|
||||
}
|
||||
|
||||
// Raycast hit information
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
public struct RayHitInfo
|
||||
public partial struct RayHitInfo
|
||||
{
|
||||
public byte bHit;
|
||||
public bool hit;
|
||||
public float distance;
|
||||
public Vector3 position;
|
||||
public Vector3 normal;
|
||||
|
||||
// convert c bool(stored as byte) to bool
|
||||
public bool hit
|
||||
{
|
||||
get { return Convert.ToBoolean(bHit); }
|
||||
set { bHit = Convert.ToByte(hit); }
|
||||
}
|
||||
|
||||
public RayHitInfo(bool hit, float distance, Vector3 position, Vector3 normal)
|
||||
{
|
||||
this.bHit = Convert.ToByte(hit);
|
||||
this.distance = distance;
|
||||
this.position = position;
|
||||
this.normal = normal;
|
||||
}
|
||||
}
|
||||
|
||||
// Wave type, defines audio wave data
|
||||
@ -767,53 +697,16 @@ namespace Raylib
|
||||
public fixed float chromaAbCorrection[4];
|
||||
}
|
||||
|
||||
|
||||
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
public static partial class Raylib
|
||||
{
|
||||
|
||||
|
||||
// Used by DllImport to load the native library.
|
||||
public const string nativeLibName = "raylib";
|
||||
public const float DEG2RAD = (float)Math.PI / 180.0f;
|
||||
public const float RAD2DEG = 180.0f / (float)Math.PI;
|
||||
|
||||
// Custom raylib color palette for amazing visuals
|
||||
public static Color LIGHTGRAY = new Color(200, 200, 200, 255);
|
||||
public static Color GRAY = new Color(130, 130, 130, 255);
|
||||
public static Color DARKGRAY = new Color(80, 80, 80, 255);
|
||||
public static Color YELLOW = new Color(253, 249, 0, 255);
|
||||
public static Color GOLD = new Color(255, 203, 0, 255);
|
||||
public static Color ORANGE = new Color(255, 161, 0, 255);
|
||||
public static Color PINK = new Color(255, 109, 194, 255);
|
||||
public static Color RED = new Color(230, 41, 55, 255);
|
||||
public static Color MAROON = new Color(190, 33, 55, 255);
|
||||
public static Color GREEN = new Color(0, 228, 48, 255);
|
||||
public static Color LIME = new Color(0, 158, 47, 255);
|
||||
public static Color DARKGREEN = new Color(0, 117, 44, 255);
|
||||
public static Color SKYBLUE = new Color(102, 191, 255, 255);
|
||||
public static Color BLUE = new Color(0, 121, 241, 255);
|
||||
public static Color DARKBLUE = new Color(0, 82, 172, 255);
|
||||
public static Color PURPLE = new Color(200, 122, 255, 255);
|
||||
public static Color VIOLET = new Color(135, 60, 190, 255);
|
||||
public static Color DARKPURPLE = new Color(112, 31, 126, 255);
|
||||
public static Color BEIGE = new Color(211, 176, 131, 255);
|
||||
public static Color BROWN = new Color(127, 106, 79, 255);
|
||||
public static Color DARKBROWN = new Color(76, 63, 47, 255);
|
||||
public static Color WHITE = new Color(255, 255, 255, 255);
|
||||
public static Color BLACK = new Color(0, 0, 0, 255);
|
||||
public static Color BLANK = new Color(0, 0, 0, 0);
|
||||
public static Color MAGENTA = new Color(255, 0, 255, 255);
|
||||
public static Color RAYWHITE = new Color(245, 245, 245, 255);
|
||||
|
||||
public const int MAX_SHADER_LOCATIONS = 32;
|
||||
public const int MAX_MATERIAL_MAPS = 12;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Window and Graphics Device Functions (Module: core)
|
||||
//------------------------------------------------------------------------------------
|
||||
@ -828,14 +721,17 @@ namespace Raylib
|
||||
|
||||
// Check if window has been initialized successfully
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsWindowReady();
|
||||
|
||||
// Check if KEY_ESCAPE pressed or Close icon pressed
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool WindowShouldClose();
|
||||
|
||||
// Check if window has been minimized (or lost focus)
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsWindowMinimized();
|
||||
|
||||
// Toggle fullscreen mode (only PLATFORM_DESKTOP)
|
||||
@ -921,6 +817,7 @@ namespace Raylib
|
||||
|
||||
// Check if cursor is not visible
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsCursorHidden();
|
||||
|
||||
// Enables cursor (unlock cursor)
|
||||
@ -1047,6 +944,7 @@ namespace Raylib
|
||||
// Files management functions
|
||||
// Check file extension
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsFileExtension(string fileName, string ext);
|
||||
|
||||
// Get pointer to extension for a filename string
|
||||
@ -1067,10 +965,12 @@ namespace Raylib
|
||||
|
||||
// Change working directory, returns true if success
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool ChangeDirectory(string dir);
|
||||
|
||||
// Check if a file has been dropped into window
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsFileDropped();
|
||||
|
||||
// Get dropped files names
|
||||
@ -1133,18 +1033,22 @@ namespace Raylib
|
||||
// Input-related functions: keyboard
|
||||
// Detect if a key has been pressed once
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsKeyPressed(KeyboardKey key);
|
||||
|
||||
// Detect if a key is being pressed
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsKeyDown(KeyboardKey key);
|
||||
|
||||
// Detect if a key has been released once
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsKeyReleased(KeyboardKey key);
|
||||
|
||||
// Detect if a key is NOT being pressed
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsKeyUp(KeyboardKey key);
|
||||
|
||||
// Get latest key pressed
|
||||
@ -1158,10 +1062,12 @@ namespace Raylib
|
||||
// Input-related functions: gamepads
|
||||
// Detect if a gamepad is available
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsGamepadAvailable(GamepadNumber gamepad);
|
||||
|
||||
// Check gamepad name (if available)
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsGamepadName(GamepadNumber gamepad, string name);
|
||||
|
||||
// Return gamepad internal name id
|
||||
@ -1170,18 +1076,22 @@ namespace Raylib
|
||||
|
||||
// Detect if a gamepad button has been pressed once
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsGamepadButtonPressed(GamepadNumber gamepad, int button);
|
||||
|
||||
// Detect if a gamepad button is being pressed
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsGamepadButtonDown(GamepadNumber gamepad, int button);
|
||||
|
||||
// Detect if a gamepad button has been released once
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsGamepadButtonReleased(GamepadNumber gamepad, int button);
|
||||
|
||||
// Detect if a gamepad button is NOT being pressed
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsGamepadButtonUp(GamepadNumber gamepad, int button);
|
||||
|
||||
// Get the last gamepad button pressed
|
||||
@ -1423,14 +1333,17 @@ namespace Raylib
|
||||
|
||||
// Check collision between two rectangles
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2);
|
||||
|
||||
// Check collision between two circles
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2);
|
||||
|
||||
// Check collision between circle and rectangle
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec);
|
||||
|
||||
// Get collision rectangle for two rectangles collision
|
||||
@ -1439,14 +1352,17 @@ namespace Raylib
|
||||
|
||||
// Check if point is inside rectangle
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CheckCollisionPointRec(Vector2 point, Rectangle rec);
|
||||
|
||||
// Check if point is inside circle
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius);
|
||||
|
||||
// Check if point is inside a triangle
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3);
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@ -1756,12 +1672,6 @@ namespace Raylib
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector2 MeasureTextEx(Font font, string text, float fontSize, float spacing);
|
||||
|
||||
// extension providing SubText
|
||||
public static string SubText(this string input, int position, int length)
|
||||
{
|
||||
return input.Substring(position, Math.Min(length, input.Length));
|
||||
}
|
||||
|
||||
// Get index position for a unicode character on font
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetGlyphIndex(Font font, int character);
|
||||
@ -1956,26 +1866,32 @@ namespace Raylib
|
||||
// Collision detection functions
|
||||
// Detect collision between two spheres
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);
|
||||
|
||||
// Detect collision between two bounding boxes
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);
|
||||
|
||||
// Detect collision between box and sphere
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere);
|
||||
|
||||
// Detect collision between ray and sphere
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius);
|
||||
|
||||
// Detect collision between ray and sphere, returns collision point
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 collisionPoint);
|
||||
|
||||
// Detect collision between ray and box
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CheckCollisionRayBox(Ray ray, BoundingBox box);
|
||||
|
||||
// Get collision info between ray and model
|
||||
@ -2099,6 +2015,7 @@ namespace Raylib
|
||||
|
||||
// Detect if VR simulator is ready
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsVrSimulatorReady();
|
||||
|
||||
// Set VR distortion shader for stereoscopic rendering
|
||||
@ -2136,6 +2053,7 @@ namespace Raylib
|
||||
|
||||
// Check if audio device has been initialized successfully
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsAudioDeviceReady();
|
||||
|
||||
// Set master volume (listener)
|
||||
@ -2190,6 +2108,7 @@ namespace Raylib
|
||||
|
||||
// Check if a sound is currently playing
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsSoundPlaying(Sound sound);
|
||||
|
||||
// Set volume for a sound (1.0 is max level)
|
||||
@ -2247,6 +2166,7 @@ namespace Raylib
|
||||
|
||||
// Check if IntPtr is playing
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsMusicPlaying(IntPtr music);
|
||||
|
||||
// Set volume for IntPtr (1.0 is max level)
|
||||
@ -2296,6 +2216,7 @@ namespace Raylib
|
||||
|
||||
// Check if any audio stream buffers requires refill
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsAudioBufferProcessed(AudioStream stream);
|
||||
|
||||
// Play audio stream
|
||||
@ -2312,6 +2233,7 @@ namespace Raylib
|
||||
|
||||
// Check if audio stream is playing
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
[return:MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool IsAudioStreamPlaying(AudioStream stream);
|
||||
|
||||
// Stop audio stream
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
</configuration>
|
@ -185,29 +185,27 @@ namespace Generator
|
||||
var TypeMap = new Dictionary<string, string>();
|
||||
typesfile = typesfile.Where(x => x != "").ToArray();
|
||||
|
||||
Console.WriteLine("Enter the path to raylib.");
|
||||
var raylibPath = Console.ReadLine() + "/src/";
|
||||
|
||||
var sources = new KeyValuePair<string, string>[] {
|
||||
new KeyValuePair<string, string>("raylib.h","RLAPI"),
|
||||
// new KeyValuePair<string, string>("physac.h", "PHYSACDEF"),
|
||||
// new KeyValuePair<string, string>( "easings.h","EASEDEF"),
|
||||
// new KeyValuePair<string, string>( "raygui.h","RAYGUIDEF")
|
||||
new KeyValuePair<string, string>("raymath.h", "RMDEF"),
|
||||
new KeyValuePair<string, string>("physac.h", "PHYSACDEF"),
|
||||
new KeyValuePair<string, string>( "easings.h","EASEDEF"),
|
||||
new KeyValuePair<string, string>( "raygui.h","RAYGUIDEF")
|
||||
};
|
||||
|
||||
foreach (var sourcefilenameandexporttag in sources)
|
||||
foreach (var sourceAndExportTag in sources)
|
||||
{
|
||||
var functions = new List<string>();
|
||||
var types = new HashSet<string>();
|
||||
var enums = new HashSet<string>();
|
||||
var Funcs = new List<Function>();
|
||||
|
||||
var sourcefilename = sourcefilenameandexporttag.Key;
|
||||
var sourcefilename = sourceAndExportTag.Key;
|
||||
var FileName = new CultureInfo("en-us", false).TextInfo.ToTitleCase(sourcefilename.Replace(".h", ""));
|
||||
var ExportTag = sourcefilenameandexporttag.Value;
|
||||
var sourcefile = File.ReadAllLines(sourcefilename);
|
||||
var ExportTag = sourceAndExportTag.Value;
|
||||
var sourcefile = File.ReadAllLines(raylibPath + sourcefilename);
|
||||
|
||||
var syntax = GetSyntax(sourcefile, ExportTag, TypeMap, typesfile);
|
||||
GenerateBinding(syntax, FileName);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Takes the source from a raylib module and stores the syntax data
|
||||
@ -708,6 +706,7 @@ namespace Generator
|
||||
new[]{
|
||||
Token(SyntaxKind.PublicKeyword),
|
||||
Token(SyntaxKind.ConstKeyword)}));
|
||||
|
||||
RaylibClass = RaylibClass.AddMembers(LibraryNameField);
|
||||
foreach (var Func in Funcs)
|
||||
{
|
||||
@ -784,6 +783,14 @@ namespace Generator
|
||||
|
||||
Console.WriteLine("Finished generating bindings for file ");
|
||||
Console.ReadLine();
|
||||
|
||||
/* Raylib-cs
|
||||
* Raylib.cs - Core bindings to raylib
|
||||
* Copyright 2019 Chris Dill
|
||||
*
|
||||
* Release under zLib License.
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,36 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Generator")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Generator")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("0adeb5b1-bf57-4d45-be28-176c1d79c764")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
810
Generator/Raylib.cs
Normal file
810
Generator/Raylib.cs
Normal file
@ -0,0 +1,810 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Security;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Raylib
|
||||
{
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
public static partial class Raylib
|
||||
{
|
||||
public const string nativeLibName = "raylib";
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void InitWindow(int width, int height, IntPtr title);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool WindowShouldClose();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void CloseWindow();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsWindowReady();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsWindowMinimized();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsWindowResized();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsWindowHidden();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ToggleFullscreen();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnhideWindow();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void HideWindow();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetWindowIcon(Image image);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetWindowTitle(IntPtr title);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetWindowPosition(int x, int y);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetWindowMonitor(int monitor);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetWindowMinSize(int width, int height);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetWindowSize(int width, int height);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr GetWindowHandle();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetScreenWidth();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetScreenHeight();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetMonitorCount();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetMonitorWidth(int monitor);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetMonitorHeight(int monitor);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetMonitorPhysicalWidth(int monitor);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetMonitorPhysicalHeight(int monitor);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr GetMonitorName(int monitor);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr GetClipboardText();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetClipboardText(IntPtr text);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ShowCursor();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void HideCursor();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsCursorHidden();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void EnableCursor();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DisableCursor();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ClearBackground(Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void BeginDrawing();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void EndDrawing();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void BeginMode2D(Camera2D camera);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void EndMode2D();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void BeginMode3D(Camera3D camera);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void EndMode3D();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void BeginTextureMode(RenderTexture2D target);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void EndTextureMode();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Ray GetMouseRay(Vector2 mousePosition, Camera3D camera);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector2 GetWorldToScreen(Vector3 position, Camera3D camera);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Matrix GetCameraMatrix(Camera3D camera);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetTargetFPS(int fps);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetFPS();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float GetFrameTime();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern double GetTime();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int ColorToInt(Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector4 ColorNormalize(Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector3 ColorToHSV(Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Color ColorFromHSV(Vector3 hsv);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Color GetColor(int hexValue);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Color Fade(Color color, float alpha);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetConfigFlags(byte flags);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetTraceLogLevel(int logType);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetTraceLogExit(int logType);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetTraceLogCallback(TraceLogCallback callback);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void TraceLog(int logType, IntPtr text, params object[] args);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void TakeScreenshot(IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetRandomValue(int min, int max);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool FileExists(IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsFileExtension(IntPtr fileName, IntPtr ext);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr GetExtension(IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr GetFileName(IntPtr filePath);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr GetFileNameWithoutExt(IntPtr filePath);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr GetDirectoryPath(IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr GetWorkingDirectory();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr GetDirectoryFiles(IntPtr dirPath, IntPtr count);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ClearDirectoryFiles();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool ChangeDirectory(IntPtr dir);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsFileDropped();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr GetDroppedFiles(IntPtr count);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ClearDroppedFiles();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern long GetFileModTime(IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void StorageSaveValue(int position, int value);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int StorageLoadValue(int position);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void OpenURL(IntPtr url);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsKeyPressed(int key);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsKeyDown(int key);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsKeyReleased(int key);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsKeyUp(int key);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetKeyPressed();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetExitKey(int key);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsGamepadAvailable(int gamepad);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsGamepadName(int gamepad, IntPtr name);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr GetGamepadName(int gamepad);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsGamepadButtonPressed(int gamepad, int button);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsGamepadButtonDown(int gamepad, int button);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsGamepadButtonReleased(int gamepad, int button);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsGamepadButtonUp(int gamepad, int button);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetGamepadButtonPressed();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetGamepadAxisCount(int gamepad);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float GetGamepadAxisMovement(int gamepad, int axis);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsMouseButtonPressed(int button);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsMouseButtonDown(int button);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsMouseButtonReleased(int button);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsMouseButtonUp(int button);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetMouseX();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetMouseY();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector2 GetMousePosition();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetMousePosition(int x, int y);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetMouseOffset(int offsetX, int offsetY);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetMouseScale(float scaleX, float scaleY);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetMouseWheelMove();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetTouchX();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetTouchY();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector2 GetTouchPosition(int index);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetGesturesEnabled(uint gestureFlags);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsGestureDetected(int gesture);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetGestureDetected();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetTouchPointsCount();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float GetGestureHoldDuration();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector2 GetGestureDragVector();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float GetGestureDragAngle();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector2 GetGesturePinchVector();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float GetGesturePinchAngle();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetCameraMode(Camera3D camera, int mode);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UpdateCamera(IntPtr camera);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetCameraPanControl(int panKey);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetCameraAltControl(int altKey);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetCameraSmoothZoomControl(int szKey);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetCameraMoveControls(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawPixel(int posX, int posY, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawPixelV(Vector2 position, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawLineV(Vector2 startPos, Vector2 endPos, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawCircle(int centerX, int centerY, float radius, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawCircleSectorLines(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawCircleV(Vector2 center, float radius, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawCircleLines(int centerX, int centerY, float radius, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawRing(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawRectangle(int posX, int posY, int width, int height, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawRectangleV(Vector2 position, Vector2 size, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawRectangleRec(Rectangle rec, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawRectangleLines(int posX, int posY, int width, int height, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int lineThick, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawPolyEx(IntPtr points, int numPoints, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawPolyExLines(IntPtr points, int numPoints, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetShapesTexture(Texture2D texture, Rectangle source);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool CheckCollisionPointRec(Vector2 point, Rectangle rec);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image LoadImage(IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image LoadImageEx(IntPtr pixels, int width, int height);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image LoadImagePro(IntPtr data, int width, int height, int format);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image LoadImageRaw(IntPtr fileName, int width, int height, int format, int headerSize);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ExportImage(Image image, IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ExportImageAsCode(Image image, IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Texture2D LoadTexture(IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Texture2D LoadTextureFromImage(Image image);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Texture2D LoadTextureCubemap(Image image, int layoutType);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern RenderTexture2D LoadRenderTexture(int width, int height);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadImage(Image image);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadTexture(Texture2D texture);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadRenderTexture(RenderTexture2D target);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr GetImageData(Image image);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr GetImageDataNormalized(Image image);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetPixelDataSize(int width, int height, int format);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image GetTextureData(Texture2D texture);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image GetScreenData();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UpdateTexture(Texture2D texture, IntPtr pixels);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image ImageCopy(Image image);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageToPOT(IntPtr image, Color fillColor);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageFormat(IntPtr image, int newFormat);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageAlphaMask(IntPtr image, Image alphaMask);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageAlphaClear(IntPtr image, Color color, float threshold);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageAlphaCrop(IntPtr image, float threshold);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageAlphaPremultiply(IntPtr image);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageCrop(IntPtr image, Rectangle crop);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageResize(IntPtr image, int newWidth, int newHeight);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageResizeNN(IntPtr image, int newWidth, int newHeight);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageResizeCanvas(IntPtr image, int newWidth, int newHeight, int offsetX, int offsetY, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageMipmaps(IntPtr image);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageDither(IntPtr image, int rBpp, int gBpp, int bBpp, int aBpp);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr ImageExtractPalette(Image image, int maxPaletteSize, IntPtr extractCount);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image ImageText(IntPtr text, int fontSize, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image ImageTextEx(Font font, IntPtr text, float fontSize, float spacing, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageDraw(IntPtr dst, Image src, Rectangle srcRec, Rectangle dstRec);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageDrawRectangle(IntPtr dst, Rectangle rec, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageDrawRectangleLines(IntPtr dst, Rectangle rec, int thick, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageDrawText(IntPtr dst, Vector2 position, IntPtr text, int fontSize, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageDrawTextEx(IntPtr dst, Vector2 position, Font font, IntPtr text, float fontSize, float spacing, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageFlipVertical(IntPtr image);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageFlipHorizontal(IntPtr image);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageRotateCW(IntPtr image);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageRotateCCW(IntPtr image);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageColorTint(IntPtr image, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageColorInvert(IntPtr image);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageColorGrayscale(IntPtr image);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageColorContrast(IntPtr image, float contrast);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageColorBrightness(IntPtr image, int brightness);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ImageColorReplace(IntPtr image, Color color, Color replace);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image GenImageColor(int width, int height, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image GenImageGradientV(int width, int height, Color top, Color bottom);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image GenImageGradientH(int width, int height, Color left, Color right);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image GenImageWhiteNoise(int width, int height, float factor);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image GenImageCellular(int width, int height, int tileSize);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void GenTextureMipmaps(IntPtr texture);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetTextureFilter(Texture2D texture, int filterMode);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetTextureWrap(Texture2D texture, int wrapMode);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawTexture(Texture2D texture, int posX, int posY, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawTextureV(Texture2D texture, Vector2 position, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle destRec, Vector2 origin, float rotation, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Font GetFontDefault();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Font LoadFont(IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Font LoadFontEx(IntPtr fileName, int fontSize, IntPtr fontChars, int charsCount);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Font LoadFontFromImage(Image image, Color key, int firstChar);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr LoadFontData(IntPtr fileName, int fontSize, IntPtr fontChars, int charsCount, int type);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Image GenImageFontAtlas(IntPtr chars, int charsCount, int fontSize, int padding, int packMethod);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadFont(Font font);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawFPS(int posX, int posY);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawText(IntPtr text, int posX, int posY, int fontSize, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawTextEx(Font font, IntPtr text, Vector2 position, float fontSize, float spacing, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawTextRec(Font font, IntPtr text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawTextRecEx(Font font, IntPtr text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectText, Color selectBack);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int MeasureText(IntPtr text, int fontSize);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Vector2 MeasureTextEx(Font font, IntPtr text, float fontSize, float spacing);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetGlyphIndex(Font font, int character);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool TextIsEqual(IntPtr text1, IntPtr text2);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern unsigned int TextLength(IntPtr text);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TextFormat(IntPtr text, params object[] args);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TextSubtext(IntPtr text, int position, int length);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TextReplace(IntPtr text, IntPtr replace, IntPtr by);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TextInsert(IntPtr text, IntPtr insert, int position);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TextJoin(IntPtr textList, int count, IntPtr delimiter);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TextSplit(IntPtr text, char delimiter, IntPtr count);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void TextAppend(IntPtr text, IntPtr append, IntPtr position);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TextFindIndex(IntPtr text, IntPtr find);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TextToUpper(IntPtr text);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TextToLower(IntPtr text);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr TextToPascal(IntPtr text);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int TextToInteger(IntPtr text);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawCube(Vector3 position, float width, float height, float length, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawCubeV(Vector3 position, Vector3 size, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawCubeWires(Vector3 position, float width, float height, float length, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawCubeWiresV(Vector3 position, Vector3 size, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawSphere(Vector3 centerPos, float radius, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawPlane(Vector3 centerPos, Vector2 size, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawRay(Ray ray, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawGrid(int slices, float spacing);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawGizmo(Vector3 position);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Model LoadModel(IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Model LoadModelFromMesh(Mesh mesh);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadModel(Model model);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr LoadMeshes(IntPtr fileName, IntPtr meshCount);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ExportMesh(Mesh mesh, IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadMesh(IntPtr mesh);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr LoadMaterials(IntPtr fileName, IntPtr materialCount);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Material LoadMaterialDefault();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadMaterial(Material material);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetMaterialTexture(IntPtr material, int mapType, Texture2D texture);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetModelMeshMaterial(IntPtr model, int meshId, int materialId);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr LoadModelAnimations(IntPtr fileName, IntPtr animsCount);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UpdateModelAnimation(Model model, ModelAnimation anim, int frame);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadModelAnimation(ModelAnimation anim);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsModelAnimationValid(Model model, ModelAnimation anim);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Mesh GenMeshPoly(int sides, float radius);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Mesh GenMeshPlane(float width, float length, int resX, int resZ);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Mesh GenMeshCube(float width, float height, float length);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Mesh GenMeshSphere(float radius, int rings, int slices);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Mesh GenMeshHemiSphere(float radius, int rings, int slices);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Mesh GenMeshCylinder(float radius, float height, int slices);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Mesh GenMeshTorus(float radius, float size, int radSeg, int sides);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Mesh GenMeshKnot(float radius, float size, int radSeg, int sides);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Mesh GenMeshHeightmap(Image heightmap, Vector3 size);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern BoundingBox MeshBoundingBox(Mesh mesh);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void MeshTangents(IntPtr mesh);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void MeshBinormals(IntPtr mesh);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawModel(Model model, Vector3 position, float scale, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawModelWires(Model model, Vector3 position, float scale, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawBoundingBox(BoundingBox box, Color color);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawBillboard(Camera3D camera, Texture2D texture, Vector3 center, float size, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void DrawBillboardRec(Camera3D camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radiusSphere);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, IntPtr collisionPoint);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool CheckCollisionRayBox(Ray ray, BoundingBox box);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern RayHitInfo GetCollisionRayModel(Ray ray, IntPtr model);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr LoadText(IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Shader LoadShader(IntPtr vsFileName, IntPtr fsFileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Shader LoadShaderCode(IntPtr vsCode, IntPtr fsCode);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadShader(Shader shader);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Shader GetShaderDefault();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Texture2D GetTextureDefault();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int GetShaderLocation(Shader shader, IntPtr uniformName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetShaderValue(Shader shader, int uniformLoc, IntPtr value, int uniformType);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetShaderValueV(Shader shader, int uniformLoc, IntPtr value, int uniformType, int count);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetShaderValueTexture(Shader shader, int uniformLoc, Texture2D texture);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetMatrixProjection(Matrix proj);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetMatrixModelview(Matrix view);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Matrix GetMatrixModelview();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Texture2D GenTextureCubemap(Shader shader, Texture2D skyHDR, int size);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Texture2D GenTextureIrradiance(Shader shader, Texture2D cubemap, int size);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Texture2D GenTexturePrefilter(Shader shader, Texture2D cubemap, int size);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Texture2D GenTextureBRDF(Shader shader, int size);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void BeginShaderMode(Shader shader);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void EndShaderMode();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void BeginBlendMode(int mode);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void EndBlendMode();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void BeginScissorMode(int x, int y, int width, int height);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void EndScissorMode();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void InitVrSimulator();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void CloseVrSimulator();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UpdateVrTracking(IntPtr camera);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetVrConfiguration(VrDeviceInfo info, Shader distortion);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsVrSimulatorReady();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ToggleVrMode();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void BeginVrDrawing();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void EndVrDrawing();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void InitAudioDevice();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void CloseAudioDevice();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsAudioDeviceReady();
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetMasterVolume(float volume);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Wave LoadWave(IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Wave LoadWaveEx(IntPtr data, int sampleCount, int sampleRate, int sampleSize, int channels);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Sound LoadSound(IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Sound LoadSoundFromWave(Wave wave);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UpdateSound(Sound sound, IntPtr data, int samplesCount);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadWave(Wave wave);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadSound(Sound sound);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ExportWave(Wave wave, IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ExportWaveAsCode(Wave wave, IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void PlaySound(Sound sound);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void PauseSound(Sound sound);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ResumeSound(Sound sound);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void StopSound(Sound sound);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsSoundPlaying(Sound sound);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetSoundVolume(Sound sound, float volume);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetSoundPitch(Sound sound, float pitch);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void WaveFormat(IntPtr wave, int sampleRate, int sampleSize, int channels);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Wave WaveCopy(Wave wave);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void WaveCrop(IntPtr wave, int initSample, int finalSample);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern IntPtr GetWaveData(Wave wave);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Music LoadMusicStream(IntPtr fileName);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UnloadMusicStream(Music music);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void PlayMusicStream(Music music);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UpdateMusicStream(Music music);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void StopMusicStream(Music music);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void PauseMusicStream(Music music);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ResumeMusicStream(Music music);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsMusicPlaying(Music music);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetMusicVolume(Music music, float volume);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetMusicPitch(Music music, float pitch);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetMusicLoopCount(Music music, int count);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float GetMusicTimeLength(Music music);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern float GetMusicTimePlayed(Music music);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern AudioStream InitAudioStream(uint sampleRate, uint sampleSize, uint channels);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UpdateAudioStream(AudioStream stream, IntPtr data, int samplesCount);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void CloseAudioStream(AudioStream stream);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsAudioBufferProcessed(AudioStream stream);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void PlayAudioStream(AudioStream stream);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void PauseAudioStream(AudioStream stream);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ResumeAudioStream(AudioStream stream);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern bool IsAudioStreamPlaying(AudioStream stream);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void StopAudioStream(AudioStream stream);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetAudioStreamVolume(AudioStream stream, float volume);
|
||||
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void SetAudioStreamPitch(AudioStream stream, float pitch);
|
||||
}
|
||||
}
|
@ -1,253 +0,0 @@
|
||||
/*******************************************************************************************
|
||||
*
|
||||
* raylib easings (header only file)
|
||||
*
|
||||
* Useful easing functions for values animation
|
||||
*
|
||||
* This header uses:
|
||||
* #define EASINGS_STATIC_INLINE // Inlines all functions code, so it runs faster.
|
||||
* // This requires lots of memory on system.
|
||||
* How to use:
|
||||
* The four inputs t,b,c,d are defined as follows:
|
||||
* t = current time (in any unit measure, but same unit as duration)
|
||||
* b = starting value to interpolate
|
||||
* c = the total change in value of b that needs to occur
|
||||
* d = total time it should take to complete (duration)
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* int currentTime = 0;
|
||||
* int duration = 100;
|
||||
* float startPositionX = 0.0f;
|
||||
* float finalPositionX = 30.0f;
|
||||
* float currentPositionX = startPositionX;
|
||||
*
|
||||
* while (currentPositionX < finalPositionX)
|
||||
* {
|
||||
* currentPositionX = EaseSineIn(currentTime, startPositionX, finalPositionX - startPositionX, duration);
|
||||
* currentTime++;
|
||||
* }
|
||||
*
|
||||
* A port of Robert Penner's easing equations to C (http://robertpenner.com/easing/)
|
||||
*
|
||||
* Robert Penner License
|
||||
* ---------------------------------------------------------------------------------
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright (c) 2001 Robert Penner. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* - Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* - Neither the name of the author nor the names of contributors may be used
|
||||
* to endorse or promote products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ---------------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2015 Ramon Santamaria
|
||||
*
|
||||
* This software is provided "as-is", without any express or implied warranty. In no event
|
||||
* will the authors be held liable for any damages arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose, including commercial
|
||||
* applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not claim that you
|
||||
* wrote the original software. If you use this software in a product, an acknowledgment
|
||||
* in the product documentation would be appreciated but is not required.
|
||||
*
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
|
||||
* as being the original software.
|
||||
*
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*
|
||||
**********************************************************************************************/
|
||||
|
||||
#ifndef EASINGS_H
|
||||
#define EASINGS_H
|
||||
|
||||
#define EASINGS_STATIC_INLINE // NOTE: By default, compile functions as static inline
|
||||
|
||||
#if defined(EASINGS_STATIC_INLINE)
|
||||
#define EASEDEF static inline
|
||||
#else
|
||||
#define EASEDEF extern
|
||||
#endif
|
||||
|
||||
#include <math.h> // Required for: sin(), cos(), sqrt(), pow()
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" { // Prevents name mangling of functions
|
||||
#endif
|
||||
|
||||
// Linear Easing functions
|
||||
EASEDEF float EaseLinearNone(float t, float b, float c, float d) { return (c*t/d + b); }
|
||||
EASEDEF float EaseLinearIn(float t, float b, float c, float d) { return (c*t/d + b); }
|
||||
EASEDEF float EaseLinearOut(float t, float b, float c, float d) { return (c*t/d + b); }
|
||||
EASEDEF float EaseLinearInOut(float t,float b, float c, float d) { return (c*t/d + b); }
|
||||
|
||||
// Sine Easing functions
|
||||
EASEDEF float EaseSineIn(float t, float b, float c, float d) { return (-c*cos(t/d*(PI/2)) + c + b); }
|
||||
EASEDEF float EaseSineOut(float t, float b, float c, float d) { return (c*sin(t/d*(PI/2)) + b); }
|
||||
EASEDEF float EaseSineInOut(float t, float b, float c, float d) { return (-c/2*(cos(PI*t/d) - 1) + b); }
|
||||
|
||||
// Circular Easing functions
|
||||
EASEDEF float EaseCircIn(float t, float b, float c, float d) { return (-c*(sqrt(1 - (t/=d)*t) - 1) + b); }
|
||||
EASEDEF float EaseCircOut(float t, float b, float c, float d) { return (c*sqrt(1 - (t=t/d-1)*t) + b); }
|
||||
EASEDEF float EaseCircInOut(float t, float b, float c, float d)
|
||||
{
|
||||
if ((t/=d/2) < 1) return (-c/2*(sqrt(1 - t*t) - 1) + b);
|
||||
return (c/2*(sqrt(1 - t*(t-=2)) + 1) + b);
|
||||
}
|
||||
|
||||
// Cubic Easing functions
|
||||
EASEDEF float EaseCubicIn(float t, float b, float c, float d) { return (c*(t/=d)*t*t + b); }
|
||||
EASEDEF float EaseCubicOut(float t, float b, float c, float d) { return (c*((t=t/d-1)*t*t + 1) + b); }
|
||||
EASEDEF float EaseCubicInOut(float t, float b, float c, float d)
|
||||
{
|
||||
if ((t/=d/2) < 1) return (c/2*t*t*t + b);
|
||||
return (c/2*((t-=2)*t*t + 2) + b);
|
||||
}
|
||||
|
||||
// Quadratic Easing functions
|
||||
EASEDEF float EaseQuadIn(float t, float b, float c, float d) { return (c*(t/=d)*t + b); }
|
||||
EASEDEF float EaseQuadOut(float t, float b, float c, float d) { return (-c*(t/=d)*(t-2) + b); }
|
||||
EASEDEF float EaseQuadInOut(float t, float b, float c, float d)
|
||||
{
|
||||
if ((t/=d/2) < 1) return (((c/2)*(t*t)) + b);
|
||||
return (-c/2*(((t-2)*(--t)) - 1) + b);
|
||||
}
|
||||
|
||||
// Exponential Easing functions
|
||||
EASEDEF float EaseExpoIn(float t, float b, float c, float d) { return (t == 0) ? b : (c*pow(2, 10*(t/d - 1)) + b); }
|
||||
EASEDEF float EaseExpoOut(float t, float b, float c, float d) { return (t == d) ? (b + c) : (c*(-pow(2, -10*t/d) + 1) + b); }
|
||||
EASEDEF float EaseExpoInOut(float t, float b, float c, float d)
|
||||
{
|
||||
if (t == 0) return b;
|
||||
if (t == d) return (b + c);
|
||||
if ((t/=d/2) < 1) return (c/2*pow(2, 10*(t - 1)) + b);
|
||||
|
||||
return (c/2*(-pow(2, -10*--t) + 2) + b);
|
||||
}
|
||||
|
||||
// Back Easing functions
|
||||
EASEDEF float EaseBackIn(float t, float b, float c, float d)
|
||||
{
|
||||
float s = 1.70158f;
|
||||
float postFix = t/=d;
|
||||
return (c*(postFix)*t*((s + 1)*t - s) + b);
|
||||
}
|
||||
|
||||
EASEDEF float EaseBackOut(float t, float b, float c, float d)
|
||||
{
|
||||
float s = 1.70158f;
|
||||
return (c*((t=t/d-1)*t*((s + 1)*t + s) + 1) + b);
|
||||
}
|
||||
|
||||
EASEDEF float EaseBackInOut(float t, float b, float c, float d)
|
||||
{
|
||||
float s = 1.70158f;
|
||||
if ((t/=d/2) < 1) return (c/2*(t*t*(((s*=(1.525f)) + 1)*t - s)) + b);
|
||||
|
||||
float postFix = t-=2;
|
||||
return (c/2*((postFix)*t*(((s*=(1.525f)) + 1)*t + s) + 2) + b);
|
||||
}
|
||||
|
||||
// Bounce Easing functions
|
||||
EASEDEF float EaseBounceOut(float t, float b, float c, float d)
|
||||
{
|
||||
if ((t/=d) < (1/2.75f))
|
||||
{
|
||||
return (c*(7.5625f*t*t) + b);
|
||||
}
|
||||
else if (t < (2/2.75f))
|
||||
{
|
||||
float postFix = t-=(1.5f/2.75f);
|
||||
return (c*(7.5625f*(postFix)*t + 0.75f) + b);
|
||||
}
|
||||
else if (t < (2.5/2.75))
|
||||
{
|
||||
float postFix = t-=(2.25f/2.75f);
|
||||
return (c*(7.5625f*(postFix)*t + 0.9375f) + b);
|
||||
}
|
||||
else
|
||||
{
|
||||
float postFix = t-=(2.625f/2.75f);
|
||||
return (c*(7.5625f*(postFix)*t + 0.984375f) + b);
|
||||
}
|
||||
}
|
||||
|
||||
EASEDEF float EaseBounceIn(float t, float b, float c, float d) { return (c - EaseBounceOut(d-t, 0, c, d) + b); }
|
||||
EASEDEF float EaseBounceInOut(float t, float b, float c, float d)
|
||||
{
|
||||
if (t < d/2) return (EaseBounceIn(t*2, 0, c, d)*0.5f + b);
|
||||
else return (EaseBounceOut(t*2-d, 0, c, d)*0.5f + c*0.5f + b);
|
||||
}
|
||||
|
||||
// Elastic Easing functions
|
||||
EASEDEF float EaseElasticIn(float t, float b, float c, float d)
|
||||
{
|
||||
if (t == 0) return b;
|
||||
if ((t/=d) == 1) return (b + c);
|
||||
|
||||
float p = d*0.3f;
|
||||
float a = c;
|
||||
float s = p/4;
|
||||
float postFix = a*pow(2, 10*(t-=1));
|
||||
|
||||
return (-(postFix*sin((t*d-s)*(2*PI)/p )) + b);
|
||||
}
|
||||
|
||||
EASEDEF float EaseElasticOut(float t, float b, float c, float d)
|
||||
{
|
||||
if (t == 0) return b;
|
||||
if ((t/=d) == 1) return (b + c);
|
||||
|
||||
float p = d*0.3f;
|
||||
float a = c;
|
||||
float s = p/4;
|
||||
|
||||
return (a*pow(2,-10*t)*sin((t*d-s)*(2*PI)/p) + c + b);
|
||||
}
|
||||
|
||||
EASEDEF float EaseElasticInOut(float t, float b, float c, float d)
|
||||
{
|
||||
if (t == 0) return b;
|
||||
if ((t/=d/2) == 2) return (b + c);
|
||||
|
||||
float p = d*(0.3f*1.5f);
|
||||
float a = c;
|
||||
float s = p/4;
|
||||
|
||||
if (t < 1)
|
||||
{
|
||||
float postFix = a*pow(2, 10*(t-=1));
|
||||
return -0.5f*(postFix*sin((t*d-s)*(2*PI)/p)) + b;
|
||||
}
|
||||
|
||||
float postFix = a*pow(2, -10*(t-=1));
|
||||
|
||||
return (postFix*sin((t*d-s)*(2*PI)/p)*0.5f + c + b);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // EASINGS_H
|
2056
Generator/physac.h
2056
Generator/physac.h
File diff suppressed because it is too large
Load Diff
3155
Generator/raygui.h
3155
Generator/raygui.h
File diff suppressed because it is too large
Load Diff
BIN
Generator/raylib-cs.ico
Normal file
BIN
Generator/raylib-cs.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 139 KiB |
1284
Generator/raylib.h
1284
Generator/raylib.h
File diff suppressed because it is too large
Load Diff
0
Generator/types.txt
Normal file
0
Generator/types.txt
Normal file
17
README.md
17
README.md
@ -5,11 +5,20 @@
|
||||
C# bindings for raylib, a simple and easy-to-use library to learn videogames programming (www.raylib.com)
|
||||
|
||||
# Installation
|
||||
So far, I have only tested on Windows. Tips on making things work smoothly on all platforms is appreciated.
|
||||
So far, I have only done a few tests on Windows and Linux.
|
||||
|
||||
## Package
|
||||
1. Install the [nuget package](https://www.nuget.org/packages/Raylib-cs/)
|
||||
|
||||
1. Add the [nuget package](https://www.nuget.org/packages/Raylib-cs/)
|
||||
2. Start coding!
|
||||
|
||||
## Manual
|
||||
1. Copy or reference the bindings into your project. See Tests for reference.
|
||||
|
||||
2. Make sure your project finds the native library that matches your platform and configuration.
|
||||
|
||||
3. Start coding!
|
||||
|
||||
```csharp
|
||||
using Raylib;
|
||||
using rl = Raylib.Raylib;
|
||||
@ -39,10 +48,8 @@ static class Program
|
||||
- Enums are passed as `int` to prevent the need for explicit casts.
|
||||
- Color defines stored inside `Color`.
|
||||
- Uses `string.Format` in place of `TextFormat`.
|
||||
|
||||
# Extras
|
||||
- Structs have constructors.
|
||||
- Operator overloading for math types.
|
||||
- Operator overloads for math types.
|
||||
|
||||
# Contributing
|
||||
If you have any ideas, feel free to open an issue and tell me what you think.
|
||||
|
@ -4,7 +4,7 @@
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<ApplicationIcon>raylib-cs.ico</ApplicationIcon>
|
||||
<Platforms>x64</Platforms>
|
||||
<StartupObject>physics_demo</StartupObject>
|
||||
<!-- <StartupObject>Test.NetCore.Program</StartupObject> -->
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
|
Loading…
x
Reference in New Issue
Block a user