mirror of
https://github.com/Starpelly/raylib-beef.git
synced 2025-03-15 05:16:58 +01:00
Added Raymath and Rlgl support
This commit is contained in:
parent
1186789e37
commit
9ef6d53382
51 changed files with 2441 additions and 647 deletions
12
.idea/.idea.raylib-beef/.idea/.gitignore
generated
vendored
Normal file
12
.idea/.idea.raylib-beef/.idea/.gitignore
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Rider ignored files
|
||||||
|
/projectSettingsUpdater.xml
|
||||||
|
/modules.xml
|
||||||
|
/contentModel.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
8
.idea/.idea.raylib-beef/.idea/indexLayout.xml
generated
Normal file
8
.idea/.idea.raylib-beef/.idea/indexLayout.xml
generated
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="UserContentModel">
|
||||||
|
<attachedFolders />
|
||||||
|
<explicitIncludes />
|
||||||
|
<explicitExcludes />
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/.idea.raylib-beef/.idea/vcs.xml
generated
Normal file
6
.idea/.idea.raylib-beef/.idea/vcs.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -15,7 +15,24 @@ namespace RaylibBeefGenerator
|
||||||
|
|
||||||
private static string OutputDir = @"C:\Dev\raylib-beef\raylib-beef\src\";
|
private static string OutputDir = @"C:\Dev\raylib-beef\raylib-beef\src\";
|
||||||
|
|
||||||
private static Root API;
|
private static Dictionary<string, FileDefinition> jsonFiles = new()
|
||||||
|
{
|
||||||
|
{ "raylib.json", new ("Raylib", "") },
|
||||||
|
{ "rlgl.json", new("Rlgl", "Rlgl") },
|
||||||
|
{ "raymath.json", new("Raymath", "Raymath") }
|
||||||
|
};
|
||||||
|
|
||||||
|
public struct FileDefinition
|
||||||
|
{
|
||||||
|
public string FileName;
|
||||||
|
public string ClassName;
|
||||||
|
|
||||||
|
public FileDefinition(string fileName, string className = "")
|
||||||
|
{
|
||||||
|
this.FileName = fileName;
|
||||||
|
this.ClassName = className;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region Output Defines
|
#region Output Defines
|
||||||
private static string ImportLib = "raylib.dll";
|
private static string ImportLib = "raylib.dll";
|
||||||
|
@ -31,32 +48,102 @@ namespace RaylibBeefGenerator
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
string raylibjson = @"C:\Dev\raylib-beef\raylib-api\raylib.json";
|
|
||||||
|
|
||||||
API = JsonConvert.DeserializeObject<Root>(File.ReadAllText(raylibjson));
|
|
||||||
|
|
||||||
Console.WriteLine($"Generating files at {OutputDir}");
|
Console.WriteLine($"Generating files at {OutputDir}");
|
||||||
Console.WriteLine($"...");
|
Console.WriteLine($"...");
|
||||||
|
|
||||||
RaylibBf();
|
for (var i = 0; i < jsonFiles.Count; i++)
|
||||||
|
|
||||||
for (int i = 0; i < API.Structs.Count; i++)
|
|
||||||
{
|
{
|
||||||
StructBf(API.Structs[i]);
|
ConvertFile(jsonFiles.ElementAt(i).Value, @$"C:\Dev\raylib-beef\raylib-api\{jsonFiles.ElementAt(i).Key}");
|
||||||
}
|
|
||||||
|
|
||||||
Callbacks();
|
|
||||||
|
|
||||||
for (int i = 0; i < API.Enums.Count; i++)
|
|
||||||
{
|
|
||||||
Enum(API.Enums[i]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine("Successfully Generated Bindings!");
|
Console.WriteLine("Successfully Generated Bindings!");
|
||||||
Console.ReadLine();
|
Console.ReadLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Enum(Enum @enum)
|
public static void ConvertFile(FileDefinition def, string location)
|
||||||
|
{
|
||||||
|
var api = JsonConvert.DeserializeObject<Root>(File.ReadAllText(location));
|
||||||
|
|
||||||
|
OutputString.Clear();
|
||||||
|
OutputString = new();
|
||||||
|
|
||||||
|
UniversalHeader();
|
||||||
|
|
||||||
|
AppendLine((string.IsNullOrEmpty(def.ClassName)) ? "static" : $"public static class {def.ClassName}");
|
||||||
|
AppendLine("{");
|
||||||
|
IncreaseTab();
|
||||||
|
|
||||||
|
for (var i = 0; i < api.Defines.Count; i++)
|
||||||
|
{
|
||||||
|
var define = api.Defines[i];
|
||||||
|
if (define.Type == "UNKNOWN" || define.Type == "MACRO" || define.Type == "GUARD") continue;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(define.Description)) AppendLine($"/// {define.Description}");
|
||||||
|
var defineType = define.Type.ConvertTypes();
|
||||||
|
AppendLine($"public const {defineType} {define.Name.ConvertName()} = {define.Value.ToString().ParseValue(defineType)};");
|
||||||
|
AppendLine("");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i = 0; i < api.Functions.Count; i++)
|
||||||
|
{
|
||||||
|
var func = api.Functions[i];
|
||||||
|
|
||||||
|
AppendLine($"/// {func.Description}");
|
||||||
|
AppendLine($"[Import(\"{ImportLib}\"), CallingConvention(.Cdecl), LinkName(\"{func.Name}\")]");
|
||||||
|
AppendLine($"public static extern {func.ReturnType.ConvertTypes()} {func.Name.ConvertName()}({Parameters2String(func.Params)});");
|
||||||
|
AppendLine("");
|
||||||
|
|
||||||
|
/*
|
||||||
|
var char8Params = new List<Param>();
|
||||||
|
var funcHasChar8 = false;
|
||||||
|
for (var p = 0; p < func.Params.Count; p++)
|
||||||
|
{
|
||||||
|
var param = func.Params[p];
|
||||||
|
if (param.Type.ConvertTypes() == "char8 *")
|
||||||
|
{
|
||||||
|
param.Type = "String";
|
||||||
|
funcHasChar8 = true;
|
||||||
|
}
|
||||||
|
char8Params.Add(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (funcHasChar8)
|
||||||
|
{
|
||||||
|
AppendLine($"/// {func.Description}");
|
||||||
|
AppendLine($"[Import(\"{ImportLib}\"), CallingConvention(.Cdecl), LinkName(\"{func.Name}\")]");
|
||||||
|
AppendLine($"public static extern void {func.Name.ConvertName()}({Parameters2String(char8Params)});");
|
||||||
|
AppendLine("");
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
AppendLine("");
|
||||||
|
|
||||||
|
for (int i = 0; i < api.Callbacks.Count; i++)
|
||||||
|
{
|
||||||
|
var callback = api.Callbacks[i];
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(callback.Description)) AppendLine($"/// {callback.Description}");
|
||||||
|
AppendLine($"public function {callback.ReturnType.ConvertTypes()} {callback.Name.ConvertName()}({callback.Params.Parameters2String()});");
|
||||||
|
AppendLine("");
|
||||||
|
}
|
||||||
|
|
||||||
|
DecreaseTab();
|
||||||
|
AppendLine("}");
|
||||||
|
|
||||||
|
WriteToFile(def.FileName);
|
||||||
|
|
||||||
|
for (var i = 0; i < api.Structs.Count; i++)
|
||||||
|
{
|
||||||
|
StructBf(api, api.Structs[i]);
|
||||||
|
}
|
||||||
|
for (var i = 0; i < api.Enums.Count; i++)
|
||||||
|
{
|
||||||
|
Enum(api, api.Enums[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Enum(Root api, Enum @enum)
|
||||||
{
|
{
|
||||||
OutputString.Clear();
|
OutputString.Clear();
|
||||||
OutputString = new();
|
OutputString = new();
|
||||||
|
@ -77,41 +164,17 @@ namespace RaylibBeefGenerator
|
||||||
DecreaseTab();
|
DecreaseTab();
|
||||||
AppendLine("}");
|
AppendLine("}");
|
||||||
|
|
||||||
WriteToFile($@"Enums\{@enum.Name}");
|
WriteToFile($@"{@enum.Name}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Callbacks()
|
public static void StructBf(Root api, Struct structu)
|
||||||
{
|
{
|
||||||
OutputString.Clear();
|
OutputString.Clear();
|
||||||
OutputString = new();
|
OutputString = new();
|
||||||
|
|
||||||
UniversalHeader();
|
UniversalHeader();
|
||||||
|
|
||||||
AppendLine($"static");
|
var alias = api.Aliases.FindAll(c => c.Type == structu.Name);
|
||||||
AppendLine("{");
|
|
||||||
IncreaseTab();
|
|
||||||
for (int i = 0; i < API.Callbacks.Count; i++)
|
|
||||||
{
|
|
||||||
var callback = API.Callbacks[i];
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(callback.Description)) AppendLine($"/// {callback.Description}");
|
|
||||||
AppendLine($"public function {callback.ReturnType.ConvertTypes()} {callback.Name.ConvertName()}({callback.Params.Parameters2String()});");
|
|
||||||
AppendLine("");
|
|
||||||
}
|
|
||||||
DecreaseTab();
|
|
||||||
AppendLine("}");
|
|
||||||
|
|
||||||
WriteToFile("Callbacks");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void StructBf(Struct structu)
|
|
||||||
{
|
|
||||||
OutputString.Clear();
|
|
||||||
OutputString = new();
|
|
||||||
|
|
||||||
UniversalHeader();
|
|
||||||
|
|
||||||
var alias = API.Aliases.FindAll(c => c.Type == structu.Name);
|
|
||||||
if (alias != null)
|
if (alias != null)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < alias.Count; i++)
|
for (int i = 0; i < alias.Count; i++)
|
||||||
|
@ -128,17 +191,26 @@ namespace RaylibBeefGenerator
|
||||||
|
|
||||||
var constructorLine = "public this(";
|
var constructorLine = "public this(";
|
||||||
|
|
||||||
for (int i = 0; i < structu.Fields.Count; i++)
|
var createdFields = new List<Field>();
|
||||||
|
|
||||||
|
for (var i = 0; i < structu.Fields.Count; i++)
|
||||||
{
|
{
|
||||||
var field = structu.Fields[i];
|
var field = structu.Fields[i];
|
||||||
|
|
||||||
// This is like the only thing that is hardcoded, and that saddens me.
|
// This is like the only thing that is hardcoded, and that saddens me.
|
||||||
if (field.Type == "rAudioProcessor *" || field.Type == "rAudioBuffer *") continue;
|
if (field.Type == "rAudioProcessor *" || field.Type == "rAudioBuffer *" || field.Type.StartsWith("#if") || field.Type == "#endif") continue;
|
||||||
|
|
||||||
|
// Avoid duplicates
|
||||||
|
if (createdFields.Find(c => c.Name == field.Name) == null)
|
||||||
|
createdFields.Add(field);
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
|
||||||
AppendLine($"/// {field.Description}");
|
AppendLine($"/// {field.Description}");
|
||||||
AppendLine($"public {field.Type.ConvertTypes()} {field.Name.ConvertName()};");
|
AppendLine($"public {field.Type.ConvertTypes()} {field.Name.ConvertName()};");
|
||||||
AppendLine("");
|
AppendLine("");
|
||||||
|
|
||||||
|
|
||||||
constructorLine += $"{field.Type.ConvertTypes()} {field.Name.ConvertName()}";
|
constructorLine += $"{field.Type.ConvertTypes()} {field.Name.ConvertName()}";
|
||||||
if (i < structu.Fields.Count - 1) constructorLine += ", ";
|
if (i < structu.Fields.Count - 1) constructorLine += ", ";
|
||||||
}
|
}
|
||||||
|
@ -148,10 +220,10 @@ namespace RaylibBeefGenerator
|
||||||
AppendLine("{");
|
AppendLine("{");
|
||||||
IncreaseTab();
|
IncreaseTab();
|
||||||
|
|
||||||
for (int i = 0; i < structu.Fields.Count; i++)
|
for (var i = 0; i < createdFields.Count; i++)
|
||||||
{
|
{
|
||||||
var field = structu.Fields[i];
|
var field = createdFields[i];
|
||||||
if (field.Type == "rAudioProcessor *" || field.Type == "rAudioBuffer *") continue;
|
if (field.Type == "rAudioProcessor *" || field.Type == "rAudioBuffer *" || field.Type.StartsWith("#if") || field.Type == "#endif") continue;
|
||||||
|
|
||||||
AppendLine($"this.{field.Name.ConvertName()} = {field.Name.ConvertName()};");
|
AppendLine($"this.{field.Name.ConvertName()} = {field.Name.ConvertName()};");
|
||||||
}
|
}
|
||||||
|
@ -164,49 +236,6 @@ namespace RaylibBeefGenerator
|
||||||
WriteToFile($"{structu.Name}");
|
WriteToFile($"{structu.Name}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RaylibBf()
|
|
||||||
{
|
|
||||||
OutputString.Clear();
|
|
||||||
OutputString = new();
|
|
||||||
|
|
||||||
UniversalHeader();
|
|
||||||
|
|
||||||
AppendLine("static");
|
|
||||||
AppendLine("{");
|
|
||||||
|
|
||||||
IncreaseTab();
|
|
||||||
|
|
||||||
AppendLine($"/// Used internally for bindings.");
|
|
||||||
AppendLine($"public const String RAYLIB_LIB = \"{ImportLib}\";");
|
|
||||||
AppendLine("");
|
|
||||||
|
|
||||||
// Skip first one, no value.
|
|
||||||
for (int i = 1; i < API.Defines.Count; i++)
|
|
||||||
{
|
|
||||||
var define = API.Defines[i];
|
|
||||||
if (define.Type == "UNKNOWN" || define.Type == "MACRO" || define.Type == "GUARD") continue;
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(define.Description)) AppendLine($"/// {define.Description}");
|
|
||||||
var defineType = define.Type.ConvertTypes();
|
|
||||||
AppendLine($"public const {defineType} {define.Name.ConvertName()} = {define.Value.ToString().ParseValue(defineType)};");
|
|
||||||
AppendLine("");
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < API.Functions.Count; i++)
|
|
||||||
{
|
|
||||||
var func = API.Functions[i];
|
|
||||||
|
|
||||||
AppendLine($"/// {func.Description}");
|
|
||||||
AppendLine($"[Import(RAYLIB_LIB), CallingConvention(.Cdecl), LinkName(\"{func.Name}\")]");
|
|
||||||
AppendLine($"public static extern {func.ReturnType.ConvertTypes()} {func.Name.ConvertName()}({Parameters2String(func.Params)});");
|
|
||||||
AppendLine("");
|
|
||||||
}
|
|
||||||
DecreaseTab();
|
|
||||||
AppendLine("}");
|
|
||||||
|
|
||||||
WriteToFile("Raylib");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string Parameters2String(this List<Param> @params)
|
public static string Parameters2String(this List<Param> @params)
|
||||||
{
|
{
|
||||||
var paramStr = string.Empty;
|
var paramStr = string.Empty;
|
||||||
|
@ -279,6 +308,7 @@ namespace RaylibBeefGenerator
|
||||||
input = ReplaceWholeWord(input, "STRING", "char8*");
|
input = ReplaceWholeWord(input, "STRING", "char8*");
|
||||||
input = ReplaceWholeWord(input, "FLOAT", "float");
|
input = ReplaceWholeWord(input, "FLOAT", "float");
|
||||||
input = ReplaceWholeWord(input, "FLOAT_MATH", "float");
|
input = ReplaceWholeWord(input, "FLOAT_MATH", "float");
|
||||||
|
input = ReplaceWholeWord(input, "DOUBLE", "double");
|
||||||
input = ReplaceWholeWord(input, "COLOR", "Color");
|
input = ReplaceWholeWord(input, "COLOR", "Color");
|
||||||
|
|
||||||
if (input.StartsWith("const"))
|
if (input.StartsWith("const"))
|
||||||
|
@ -300,6 +330,7 @@ namespace RaylibBeefGenerator
|
||||||
input = ReplaceWholeWord(input, "append", "@append");
|
input = ReplaceWholeWord(input, "append", "@append");
|
||||||
input = ReplaceWholeWord(input, "box", "@box");
|
input = ReplaceWholeWord(input, "box", "@box");
|
||||||
input = ReplaceWholeWord(input, "params", "@params");
|
input = ReplaceWholeWord(input, "params", "@params");
|
||||||
|
input = ReplaceWholeWord(input, "readonly", "@readonly");
|
||||||
|
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
FileVersion = 1
|
FileVersion = 1
|
||||||
|
Dependencies = {corlib = "*", corlib = "*"}
|
||||||
|
|
||||||
[Project]
|
[Project]
|
||||||
Name = "raylib-beef"
|
Name = "raylib-beef"
|
||||||
|
@ -9,7 +10,15 @@ DefaultNamespace = "Raylib"
|
||||||
[Configs.Debug.Win64]
|
[Configs.Debug.Win64]
|
||||||
CLibType = "DynamicDebug"
|
CLibType = "DynamicDebug"
|
||||||
LibPaths = ["$(ProjectDir)\\dist\\x64\\raylib.lib"]
|
LibPaths = ["$(ProjectDir)\\dist\\x64\\raylib.lib"]
|
||||||
|
PostBuildCmds = ["CopyToDependents(\"$(ProjectDir)/dist/x64/*.dll\")"]
|
||||||
|
|
||||||
[Configs.Release.Win64]
|
[Configs.Release.Win64]
|
||||||
CLibType = "Dynamic"
|
CLibType = "Dynamic"
|
||||||
LibPaths = ["$(ProjectDir)\\dist\\x64\\raylib.lib"]
|
LibPaths = ["$(ProjectDir)\\dist\\x64\\raylib.lib"]
|
||||||
|
PostBuildCmds = ["CopyToDependents(\"$(ProjectDir)/dist/x64/*.dll\")"]
|
||||||
|
|
||||||
|
[Configs.Paranoid.Win64]
|
||||||
|
PostBuildCmds = ["CopyToDependents(\"$(ProjectDir)/dist/x64/*.dll\")"]
|
||||||
|
|
||||||
|
[Configs.Test.Win64]
|
||||||
|
PostBuildCmds = ["CopyToDependents(\"$(ProjectDir)/dist/x64/*.dll\")"]
|
||||||
|
|
|
@ -3,5 +3,6 @@ Dependencies = {corlib = "*", raylib-beef = "*"}
|
||||||
|
|
||||||
[Project]
|
[Project]
|
||||||
Name = "example"
|
Name = "example"
|
||||||
|
TargetType = "BeefGUIApplication"
|
||||||
StartupObject = "raylib_test.Program"
|
StartupObject = "raylib_test.Program"
|
||||||
DefaultNamespace = "raylib_test"
|
DefaultNamespace = "raylib_test"
|
||||||
|
|
|
@ -7,6 +7,7 @@ class Program
|
||||||
{
|
{
|
||||||
public static int Main(String[] args)
|
public static int Main(String[] args)
|
||||||
{
|
{
|
||||||
|
SetConfigFlags(4);
|
||||||
InitWindow(800, 600, "Raylib Beef 4.5");
|
InitWindow(800, 600, "Raylib Beef 4.5");
|
||||||
|
|
||||||
var beefMain = Color(165, 47, 78, 255);
|
var beefMain = Color(165, 47, 78, 255);
|
||||||
|
@ -18,15 +19,23 @@ class Program
|
||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
DrawCircle(GetMouseX(), GetMouseY(), 20, beefOutline);
|
||||||
|
|
||||||
DrawRectangle(GetScreenWidth() / 2 - 128, GetScreenHeight() / 2 - 128, 256, 256, beefOutline);
|
DrawRectangle(GetScreenWidth() / 2 - 128, GetScreenHeight() / 2 - 128, 256, 256, beefOutline);
|
||||||
DrawRectangle(GetScreenWidth() / 2 - 112, GetScreenHeight() / 2 - 112, 224, 224, beefMain);
|
DrawRectangle(GetScreenWidth() / 2 - 112, GetScreenHeight() / 2 - 112, 224, 224, beefMain);
|
||||||
|
|
||||||
|
DrawCircle(GetMouseX(), GetMouseY(), 10, beefMain);
|
||||||
|
|
||||||
DrawText("raylib", GetScreenWidth() / 2 - 44, GetScreenHeight() / 2, 50, beefOutline);
|
DrawText("raylib", GetScreenWidth() / 2 - 44, GetScreenHeight() / 2, 50, beefOutline);
|
||||||
DrawText("beef", GetScreenWidth() / 2 - 62, GetScreenHeight() / 2 + 46, 50, beefOutline);
|
DrawText("beef", GetScreenWidth() / 2 - 62, GetScreenHeight() / 2 + 46, 50, beefOutline);
|
||||||
|
|
||||||
DrawRectangle(GetScreenWidth() / 2 + 54, GetScreenHeight() / 2 + 54, 42, 42, beefOutline);
|
DrawRectangle(GetScreenWidth() / 2 + 54, GetScreenHeight() / 2 + 54, 42, 42, beefOutline);
|
||||||
DrawRectangle(GetScreenWidth() / 2 + 62, GetScreenHeight() / 2 + 62, 26, 26, RAYWHITE);
|
DrawRectangle(GetScreenWidth() / 2 + 62, GetScreenHeight() / 2 + 62, 26, 26, RAYWHITE);
|
||||||
|
|
||||||
|
DrawText(scope $"{Raymath.Lerp(0, 20, 10)}", 20, 60, 20, DARKGREEN);
|
||||||
|
|
||||||
|
DrawFPS(20, 20);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
}
|
}
|
||||||
CloseWindow();
|
CloseWindow();
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Interop;
|
|
||||||
|
|
||||||
namespace Raylib;
|
|
||||||
|
|
||||||
static
|
|
||||||
{
|
|
||||||
/// Logging: Redirect trace log messages
|
|
||||||
public function void TraceLogCallback(int logLevel, char8 * text, void* args);
|
|
||||||
|
|
||||||
/// FileIO: Load binary data
|
|
||||||
public function char8 * LoadFileDataCallback(char8 * fileName, int * bytesRead);
|
|
||||||
|
|
||||||
/// FileIO: Save binary data
|
|
||||||
public function bool SaveFileDataCallback(char8 * fileName, void * data, int bytesToWrite);
|
|
||||||
|
|
||||||
/// FileIO: Load text data
|
|
||||||
public function char8 * LoadFileTextCallback(char8 * fileName);
|
|
||||||
|
|
||||||
/// FileIO: Save text data
|
|
||||||
public function bool SaveFileTextCallback(char8 * fileName, char8 * text);
|
|
||||||
|
|
||||||
public function void AudioCallback(void * bufferData, int frames);
|
|
||||||
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load diff
465
raylib-beef/src/Raymath.bf
Normal file
465
raylib-beef/src/Raymath.bf
Normal file
|
@ -0,0 +1,465 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
public static class Raymath
|
||||||
|
{
|
||||||
|
public const float PI = 3.141592653589793f;
|
||||||
|
|
||||||
|
public const float EPSILON = 1E-06f;
|
||||||
|
|
||||||
|
public const float DEG2RAD = (PI/180.0f);
|
||||||
|
|
||||||
|
public const float RAD2DEG = (180.0f/PI);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Clamp")]
|
||||||
|
public static extern float Clamp(float value, float min, float max);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Lerp")]
|
||||||
|
public static extern float Lerp(float start, float end, float amount);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Normalize")]
|
||||||
|
public static extern float Normalize(float value, float start, float end);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Remap")]
|
||||||
|
public static extern float Remap(float value, float inputStart, float inputEnd, float outputStart, float outputEnd);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Wrap")]
|
||||||
|
public static extern float Wrap(float value, float min, float max);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("FloatEquals")]
|
||||||
|
public static extern int FloatEquals(float x, float y);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Zero")]
|
||||||
|
public static extern Vector2 Vector2Zero();
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2One")]
|
||||||
|
public static extern Vector2 Vector2One();
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Add")]
|
||||||
|
public static extern Vector2 Vector2Add(Vector2 v1, Vector2 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2AddValue")]
|
||||||
|
public static extern Vector2 Vector2AddValue(Vector2 v, float add);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Subtract")]
|
||||||
|
public static extern Vector2 Vector2Subtract(Vector2 v1, Vector2 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2SubtractValue")]
|
||||||
|
public static extern Vector2 Vector2SubtractValue(Vector2 v, float sub);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Length")]
|
||||||
|
public static extern float Vector2Length(Vector2 v);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2LengthSqr")]
|
||||||
|
public static extern float Vector2LengthSqr(Vector2 v);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2DotProduct")]
|
||||||
|
public static extern float Vector2DotProduct(Vector2 v1, Vector2 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Distance")]
|
||||||
|
public static extern float Vector2Distance(Vector2 v1, Vector2 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2DistanceSqr")]
|
||||||
|
public static extern float Vector2DistanceSqr(Vector2 v1, Vector2 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Angle")]
|
||||||
|
public static extern float Vector2Angle(Vector2 v1, Vector2 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2LineAngle")]
|
||||||
|
public static extern float Vector2LineAngle(Vector2 start, Vector2 end);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Scale")]
|
||||||
|
public static extern Vector2 Vector2Scale(Vector2 v, float scale);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Multiply")]
|
||||||
|
public static extern Vector2 Vector2Multiply(Vector2 v1, Vector2 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Negate")]
|
||||||
|
public static extern Vector2 Vector2Negate(Vector2 v);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Divide")]
|
||||||
|
public static extern Vector2 Vector2Divide(Vector2 v1, Vector2 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Normalize")]
|
||||||
|
public static extern Vector2 Vector2Normalize(Vector2 v);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Transform")]
|
||||||
|
public static extern Vector2 Vector2Transform(Vector2 v, Matrix mat);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Lerp")]
|
||||||
|
public static extern Vector2 Vector2Lerp(Vector2 v1, Vector2 v2, float amount);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Reflect")]
|
||||||
|
public static extern Vector2 Vector2Reflect(Vector2 v, Vector2 normal);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Rotate")]
|
||||||
|
public static extern Vector2 Vector2Rotate(Vector2 v, float angle);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2MoveTowards")]
|
||||||
|
public static extern Vector2 Vector2MoveTowards(Vector2 v, Vector2 target, float maxDistance);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Invert")]
|
||||||
|
public static extern Vector2 Vector2Invert(Vector2 v);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Clamp")]
|
||||||
|
public static extern Vector2 Vector2Clamp(Vector2 v, Vector2 min, Vector2 max);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2ClampValue")]
|
||||||
|
public static extern Vector2 Vector2ClampValue(Vector2 v, float min, float max);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector2Equals")]
|
||||||
|
public static extern int Vector2Equals(Vector2 p, Vector2 q);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Zero")]
|
||||||
|
public static extern Vector3 Vector3Zero();
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3One")]
|
||||||
|
public static extern Vector3 Vector3One();
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Add")]
|
||||||
|
public static extern Vector3 Vector3Add(Vector3 v1, Vector3 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3AddValue")]
|
||||||
|
public static extern Vector3 Vector3AddValue(Vector3 v, float add);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Subtract")]
|
||||||
|
public static extern Vector3 Vector3Subtract(Vector3 v1, Vector3 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3SubtractValue")]
|
||||||
|
public static extern Vector3 Vector3SubtractValue(Vector3 v, float sub);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Scale")]
|
||||||
|
public static extern Vector3 Vector3Scale(Vector3 v, float scalar);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Multiply")]
|
||||||
|
public static extern Vector3 Vector3Multiply(Vector3 v1, Vector3 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3CrossProduct")]
|
||||||
|
public static extern Vector3 Vector3CrossProduct(Vector3 v1, Vector3 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Perpendicular")]
|
||||||
|
public static extern Vector3 Vector3Perpendicular(Vector3 v);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Length")]
|
||||||
|
public static extern float Vector3Length(Vector3 v);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3LengthSqr")]
|
||||||
|
public static extern float Vector3LengthSqr(Vector3 v);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3DotProduct")]
|
||||||
|
public static extern float Vector3DotProduct(Vector3 v1, Vector3 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Distance")]
|
||||||
|
public static extern float Vector3Distance(Vector3 v1, Vector3 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3DistanceSqr")]
|
||||||
|
public static extern float Vector3DistanceSqr(Vector3 v1, Vector3 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Angle")]
|
||||||
|
public static extern float Vector3Angle(Vector3 v1, Vector3 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Negate")]
|
||||||
|
public static extern Vector3 Vector3Negate(Vector3 v);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Divide")]
|
||||||
|
public static extern Vector3 Vector3Divide(Vector3 v1, Vector3 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Normalize")]
|
||||||
|
public static extern Vector3 Vector3Normalize(Vector3 v);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3OrthoNormalize")]
|
||||||
|
public static extern void Vector3OrthoNormalize(Vector3 * v1, Vector3 * v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Transform")]
|
||||||
|
public static extern Vector3 Vector3Transform(Vector3 v, Matrix mat);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3RotateByQuaternion")]
|
||||||
|
public static extern Vector3 Vector3RotateByQuaternion(Vector3 v, Quaternion q);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3RotateByAxisAngle")]
|
||||||
|
public static extern Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, float angle);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Lerp")]
|
||||||
|
public static extern Vector3 Vector3Lerp(Vector3 v1, Vector3 v2, float amount);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Reflect")]
|
||||||
|
public static extern Vector3 Vector3Reflect(Vector3 v, Vector3 normal);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Min")]
|
||||||
|
public static extern Vector3 Vector3Min(Vector3 v1, Vector3 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Max")]
|
||||||
|
public static extern Vector3 Vector3Max(Vector3 v1, Vector3 v2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Barycenter")]
|
||||||
|
public static extern Vector3 Vector3Barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Unproject")]
|
||||||
|
public static extern Vector3 Vector3Unproject(Vector3 source, Matrix projection, Matrix view);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3ToFloatV")]
|
||||||
|
public static extern float3 Vector3ToFloatV(Vector3 v);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Invert")]
|
||||||
|
public static extern Vector3 Vector3Invert(Vector3 v);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Clamp")]
|
||||||
|
public static extern Vector3 Vector3Clamp(Vector3 v, Vector3 min, Vector3 max);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3ClampValue")]
|
||||||
|
public static extern Vector3 Vector3ClampValue(Vector3 v, float min, float max);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Equals")]
|
||||||
|
public static extern int Vector3Equals(Vector3 p, Vector3 q);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("Vector3Refract")]
|
||||||
|
public static extern Vector3 Vector3Refract(Vector3 v, Vector3 n, float r);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixDeterminant")]
|
||||||
|
public static extern float MatrixDeterminant(Matrix mat);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixTrace")]
|
||||||
|
public static extern float MatrixTrace(Matrix mat);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixTranspose")]
|
||||||
|
public static extern Matrix MatrixTranspose(Matrix mat);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixInvert")]
|
||||||
|
public static extern Matrix MatrixInvert(Matrix mat);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixIdentity")]
|
||||||
|
public static extern Matrix MatrixIdentity();
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixAdd")]
|
||||||
|
public static extern Matrix MatrixAdd(Matrix left, Matrix right);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixSubtract")]
|
||||||
|
public static extern Matrix MatrixSubtract(Matrix left, Matrix right);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixMultiply")]
|
||||||
|
public static extern Matrix MatrixMultiply(Matrix left, Matrix right);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixTranslate")]
|
||||||
|
public static extern Matrix MatrixTranslate(float x, float y, float z);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixRotate")]
|
||||||
|
public static extern Matrix MatrixRotate(Vector3 axis, float angle);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixRotateX")]
|
||||||
|
public static extern Matrix MatrixRotateX(float angle);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixRotateY")]
|
||||||
|
public static extern Matrix MatrixRotateY(float angle);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixRotateZ")]
|
||||||
|
public static extern Matrix MatrixRotateZ(float angle);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixRotateXYZ")]
|
||||||
|
public static extern Matrix MatrixRotateXYZ(Vector3 angle);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixRotateZYX")]
|
||||||
|
public static extern Matrix MatrixRotateZYX(Vector3 angle);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixScale")]
|
||||||
|
public static extern Matrix MatrixScale(float x, float y, float z);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixFrustum")]
|
||||||
|
public static extern Matrix MatrixFrustum(double left, double right, double bottom, double top, double near, double far);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixPerspective")]
|
||||||
|
public static extern Matrix MatrixPerspective(double fovy, double aspect, double near, double far);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixOrtho")]
|
||||||
|
public static extern Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixLookAt")]
|
||||||
|
public static extern Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("MatrixToFloatV")]
|
||||||
|
public static extern float16 MatrixToFloatV(Matrix mat);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionAdd")]
|
||||||
|
public static extern Quaternion QuaternionAdd(Quaternion q1, Quaternion q2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionAddValue")]
|
||||||
|
public static extern Quaternion QuaternionAddValue(Quaternion q, float add);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionSubtract")]
|
||||||
|
public static extern Quaternion QuaternionSubtract(Quaternion q1, Quaternion q2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionSubtractValue")]
|
||||||
|
public static extern Quaternion QuaternionSubtractValue(Quaternion q, float sub);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionIdentity")]
|
||||||
|
public static extern Quaternion QuaternionIdentity();
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionLength")]
|
||||||
|
public static extern float QuaternionLength(Quaternion q);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionNormalize")]
|
||||||
|
public static extern Quaternion QuaternionNormalize(Quaternion q);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionInvert")]
|
||||||
|
public static extern Quaternion QuaternionInvert(Quaternion q);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionMultiply")]
|
||||||
|
public static extern Quaternion QuaternionMultiply(Quaternion q1, Quaternion q2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionScale")]
|
||||||
|
public static extern Quaternion QuaternionScale(Quaternion q, float mul);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionDivide")]
|
||||||
|
public static extern Quaternion QuaternionDivide(Quaternion q1, Quaternion q2);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionLerp")]
|
||||||
|
public static extern Quaternion QuaternionLerp(Quaternion q1, Quaternion q2, float amount);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionNlerp")]
|
||||||
|
public static extern Quaternion QuaternionNlerp(Quaternion q1, Quaternion q2, float amount);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionSlerp")]
|
||||||
|
public static extern Quaternion QuaternionSlerp(Quaternion q1, Quaternion q2, float amount);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionFromVector3ToVector3")]
|
||||||
|
public static extern Quaternion QuaternionFromVector3ToVector3(Vector3 from, Vector3 to);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionFromMatrix")]
|
||||||
|
public static extern Quaternion QuaternionFromMatrix(Matrix mat);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionToMatrix")]
|
||||||
|
public static extern Matrix QuaternionToMatrix(Quaternion q);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionFromAxisAngle")]
|
||||||
|
public static extern Quaternion QuaternionFromAxisAngle(Vector3 axis, float angle);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionToAxisAngle")]
|
||||||
|
public static extern void QuaternionToAxisAngle(Quaternion q, Vector3 * outAxis, float * outAngle);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionFromEuler")]
|
||||||
|
public static extern Quaternion QuaternionFromEuler(float pitch, float yaw, float roll);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionToEuler")]
|
||||||
|
public static extern Vector3 QuaternionToEuler(Quaternion q);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionTransform")]
|
||||||
|
public static extern Quaternion QuaternionTransform(Quaternion q, Matrix mat);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("QuaternionEquals")]
|
||||||
|
public static extern int QuaternionEquals(Quaternion p, Quaternion q);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
814
raylib-beef/src/Rlgl.bf
Normal file
814
raylib-beef/src/Rlgl.bf
Normal file
|
@ -0,0 +1,814 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
public static class Rlgl
|
||||||
|
{
|
||||||
|
public const char8* RLGL_VERSION = "4.5";
|
||||||
|
|
||||||
|
public const int RL_DEFAULT_BATCH_BUFFER_ELEMENTS = 8192;
|
||||||
|
|
||||||
|
/// Default number of batch buffers (multi-buffering)
|
||||||
|
public const int RL_DEFAULT_BATCH_BUFFERS = 1;
|
||||||
|
|
||||||
|
/// Default number of batch draw calls (by state changes: mode, texture)
|
||||||
|
public const int RL_DEFAULT_BATCH_DRAWCALLS = 256;
|
||||||
|
|
||||||
|
/// Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
|
||||||
|
public const int RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS = 4;
|
||||||
|
|
||||||
|
/// Maximum size of Matrix stack
|
||||||
|
public const int RL_MAX_MATRIX_STACK_SIZE = 32;
|
||||||
|
|
||||||
|
/// Maximum number of shader locations supported
|
||||||
|
public const int RL_MAX_SHADER_LOCATIONS = 32;
|
||||||
|
|
||||||
|
/// Default near cull distance
|
||||||
|
public const double RL_CULL_DISTANCE_NEAR = 0.01;
|
||||||
|
|
||||||
|
/// Default far cull distance
|
||||||
|
public const double RL_CULL_DISTANCE_FAR = 1000;
|
||||||
|
|
||||||
|
/// GL_TEXTURE_WRAP_S
|
||||||
|
public const int RL_TEXTURE_WRAP_S = 10242;
|
||||||
|
|
||||||
|
/// GL_TEXTURE_WRAP_T
|
||||||
|
public const int RL_TEXTURE_WRAP_T = 10243;
|
||||||
|
|
||||||
|
/// GL_TEXTURE_MAG_FILTER
|
||||||
|
public const int RL_TEXTURE_MAG_FILTER = 10240;
|
||||||
|
|
||||||
|
/// GL_TEXTURE_MIN_FILTER
|
||||||
|
public const int RL_TEXTURE_MIN_FILTER = 10241;
|
||||||
|
|
||||||
|
/// GL_NEAREST
|
||||||
|
public const int RL_TEXTURE_FILTER_NEAREST = 9728;
|
||||||
|
|
||||||
|
/// GL_LINEAR
|
||||||
|
public const int RL_TEXTURE_FILTER_LINEAR = 9729;
|
||||||
|
|
||||||
|
/// GL_NEAREST_MIPMAP_NEAREST
|
||||||
|
public const int RL_TEXTURE_FILTER_MIP_NEAREST = 9984;
|
||||||
|
|
||||||
|
/// GL_NEAREST_MIPMAP_LINEAR
|
||||||
|
public const int RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR = 9986;
|
||||||
|
|
||||||
|
/// GL_LINEAR_MIPMAP_NEAREST
|
||||||
|
public const int RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST = 9985;
|
||||||
|
|
||||||
|
/// GL_LINEAR_MIPMAP_LINEAR
|
||||||
|
public const int RL_TEXTURE_FILTER_MIP_LINEAR = 9987;
|
||||||
|
|
||||||
|
/// Anisotropic filter (custom identifier)
|
||||||
|
public const int RL_TEXTURE_FILTER_ANISOTROPIC = 12288;
|
||||||
|
|
||||||
|
/// Texture mipmap bias, percentage ratio (custom identifier)
|
||||||
|
public const int RL_TEXTURE_MIPMAP_BIAS_RATIO = 16384;
|
||||||
|
|
||||||
|
/// GL_REPEAT
|
||||||
|
public const int RL_TEXTURE_WRAP_REPEAT = 10497;
|
||||||
|
|
||||||
|
/// GL_CLAMP_TO_EDGE
|
||||||
|
public const int RL_TEXTURE_WRAP_CLAMP = 33071;
|
||||||
|
|
||||||
|
/// GL_MIRRORED_REPEAT
|
||||||
|
public const int RL_TEXTURE_WRAP_MIRROR_REPEAT = 33648;
|
||||||
|
|
||||||
|
/// GL_MIRROR_CLAMP_EXT
|
||||||
|
public const int RL_TEXTURE_WRAP_MIRROR_CLAMP = 34626;
|
||||||
|
|
||||||
|
/// GL_MODELVIEW
|
||||||
|
public const int RL_MODELVIEW = 5888;
|
||||||
|
|
||||||
|
/// GL_PROJECTION
|
||||||
|
public const int RL_PROJECTION = 5889;
|
||||||
|
|
||||||
|
/// GL_TEXTURE
|
||||||
|
public const int RL_TEXTURE = 5890;
|
||||||
|
|
||||||
|
/// GL_LINES
|
||||||
|
public const int RL_LINES = 1;
|
||||||
|
|
||||||
|
/// GL_TRIANGLES
|
||||||
|
public const int RL_TRIANGLES = 4;
|
||||||
|
|
||||||
|
/// GL_QUADS
|
||||||
|
public const int RL_QUADS = 7;
|
||||||
|
|
||||||
|
/// GL_UNSIGNED_BYTE
|
||||||
|
public const int RL_UNSIGNED_BYTE = 5121;
|
||||||
|
|
||||||
|
/// GL_FLOAT
|
||||||
|
public const int RL_FLOAT = 5126;
|
||||||
|
|
||||||
|
/// GL_STREAM_DRAW
|
||||||
|
public const int RL_STREAM_DRAW = 35040;
|
||||||
|
|
||||||
|
/// GL_STREAM_READ
|
||||||
|
public const int RL_STREAM_READ = 35041;
|
||||||
|
|
||||||
|
/// GL_STREAM_COPY
|
||||||
|
public const int RL_STREAM_COPY = 35042;
|
||||||
|
|
||||||
|
/// GL_STATIC_DRAW
|
||||||
|
public const int RL_STATIC_DRAW = 35044;
|
||||||
|
|
||||||
|
/// GL_STATIC_READ
|
||||||
|
public const int RL_STATIC_READ = 35045;
|
||||||
|
|
||||||
|
/// GL_STATIC_COPY
|
||||||
|
public const int RL_STATIC_COPY = 35046;
|
||||||
|
|
||||||
|
/// GL_DYNAMIC_DRAW
|
||||||
|
public const int RL_DYNAMIC_DRAW = 35048;
|
||||||
|
|
||||||
|
/// GL_DYNAMIC_READ
|
||||||
|
public const int RL_DYNAMIC_READ = 35049;
|
||||||
|
|
||||||
|
/// GL_DYNAMIC_COPY
|
||||||
|
public const int RL_DYNAMIC_COPY = 35050;
|
||||||
|
|
||||||
|
/// GL_FRAGMENT_SHADER
|
||||||
|
public const int RL_FRAGMENT_SHADER = 35632;
|
||||||
|
|
||||||
|
/// GL_VERTEX_SHADER
|
||||||
|
public const int RL_VERTEX_SHADER = 35633;
|
||||||
|
|
||||||
|
/// GL_COMPUTE_SHADER
|
||||||
|
public const int RL_COMPUTE_SHADER = 37305;
|
||||||
|
|
||||||
|
/// GL_ZERO
|
||||||
|
public const int RL_ZERO = 0;
|
||||||
|
|
||||||
|
/// GL_ONE
|
||||||
|
public const int RL_ONE = 1;
|
||||||
|
|
||||||
|
/// GL_SRC_COLOR
|
||||||
|
public const int RL_SRC_COLOR = 768;
|
||||||
|
|
||||||
|
/// GL_ONE_MINUS_SRC_COLOR
|
||||||
|
public const int RL_ONE_MINUS_SRC_COLOR = 769;
|
||||||
|
|
||||||
|
/// GL_SRC_ALPHA
|
||||||
|
public const int RL_SRC_ALPHA = 770;
|
||||||
|
|
||||||
|
/// GL_ONE_MINUS_SRC_ALPHA
|
||||||
|
public const int RL_ONE_MINUS_SRC_ALPHA = 771;
|
||||||
|
|
||||||
|
/// GL_DST_ALPHA
|
||||||
|
public const int RL_DST_ALPHA = 772;
|
||||||
|
|
||||||
|
/// GL_ONE_MINUS_DST_ALPHA
|
||||||
|
public const int RL_ONE_MINUS_DST_ALPHA = 773;
|
||||||
|
|
||||||
|
/// GL_DST_COLOR
|
||||||
|
public const int RL_DST_COLOR = 774;
|
||||||
|
|
||||||
|
/// GL_ONE_MINUS_DST_COLOR
|
||||||
|
public const int RL_ONE_MINUS_DST_COLOR = 775;
|
||||||
|
|
||||||
|
/// GL_SRC_ALPHA_SATURATE
|
||||||
|
public const int RL_SRC_ALPHA_SATURATE = 776;
|
||||||
|
|
||||||
|
/// GL_CONSTANT_COLOR
|
||||||
|
public const int RL_CONSTANT_COLOR = 32769;
|
||||||
|
|
||||||
|
/// GL_ONE_MINUS_CONSTANT_COLOR
|
||||||
|
public const int RL_ONE_MINUS_CONSTANT_COLOR = 32770;
|
||||||
|
|
||||||
|
/// GL_CONSTANT_ALPHA
|
||||||
|
public const int RL_CONSTANT_ALPHA = 32771;
|
||||||
|
|
||||||
|
/// GL_ONE_MINUS_CONSTANT_ALPHA
|
||||||
|
public const int RL_ONE_MINUS_CONSTANT_ALPHA = 32772;
|
||||||
|
|
||||||
|
/// GL_FUNC_ADD
|
||||||
|
public const int RL_FUNC_ADD = 32774;
|
||||||
|
|
||||||
|
/// GL_MIN
|
||||||
|
public const int RL_MIN = 32775;
|
||||||
|
|
||||||
|
/// GL_MAX
|
||||||
|
public const int RL_MAX = 32776;
|
||||||
|
|
||||||
|
/// GL_FUNC_SUBTRACT
|
||||||
|
public const int RL_FUNC_SUBTRACT = 32778;
|
||||||
|
|
||||||
|
/// GL_FUNC_REVERSE_SUBTRACT
|
||||||
|
public const int RL_FUNC_REVERSE_SUBTRACT = 32779;
|
||||||
|
|
||||||
|
/// GL_BLEND_EQUATION
|
||||||
|
public const int RL_BLEND_EQUATION = 32777;
|
||||||
|
|
||||||
|
/// GL_BLEND_EQUATION_RGB // (Same as BLEND_EQUATION)
|
||||||
|
public const int RL_BLEND_EQUATION_RGB = 32777;
|
||||||
|
|
||||||
|
/// GL_BLEND_EQUATION_ALPHA
|
||||||
|
public const int RL_BLEND_EQUATION_ALPHA = 34877;
|
||||||
|
|
||||||
|
/// GL_BLEND_DST_RGB
|
||||||
|
public const int RL_BLEND_DST_RGB = 32968;
|
||||||
|
|
||||||
|
/// GL_BLEND_SRC_RGB
|
||||||
|
public const int RL_BLEND_SRC_RGB = 32969;
|
||||||
|
|
||||||
|
/// GL_BLEND_DST_ALPHA
|
||||||
|
public const int RL_BLEND_DST_ALPHA = 32970;
|
||||||
|
|
||||||
|
/// GL_BLEND_SRC_ALPHA
|
||||||
|
public const int RL_BLEND_SRC_ALPHA = 32971;
|
||||||
|
|
||||||
|
/// GL_BLEND_COLOR
|
||||||
|
public const int RL_BLEND_COLOR = 32773;
|
||||||
|
|
||||||
|
/// Choose the current matrix to be transformed
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlMatrixMode")]
|
||||||
|
public static extern void rlMatrixMode(int mode);
|
||||||
|
|
||||||
|
/// Push the current matrix to stack
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlPushMatrix")]
|
||||||
|
public static extern void rlPushMatrix();
|
||||||
|
|
||||||
|
/// Pop latest inserted matrix from stack
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlPopMatrix")]
|
||||||
|
public static extern void rlPopMatrix();
|
||||||
|
|
||||||
|
/// Reset current matrix to identity matrix
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadIdentity")]
|
||||||
|
public static extern void rlLoadIdentity();
|
||||||
|
|
||||||
|
/// Multiply the current matrix by a translation matrix
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlTranslatef")]
|
||||||
|
public static extern void rlTranslatef(float x, float y, float z);
|
||||||
|
|
||||||
|
/// Multiply the current matrix by a rotation matrix
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlRotatef")]
|
||||||
|
public static extern void rlRotatef(float angle, float x, float y, float z);
|
||||||
|
|
||||||
|
/// Multiply the current matrix by a scaling matrix
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlScalef")]
|
||||||
|
public static extern void rlScalef(float x, float y, float z);
|
||||||
|
|
||||||
|
/// Multiply the current matrix by another matrix
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlMultMatrixf")]
|
||||||
|
public static extern void rlMultMatrixf(float * matf);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlFrustum")]
|
||||||
|
public static extern void rlFrustum(double left, double right, double bottom, double top, double znear, double zfar);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlOrtho")]
|
||||||
|
public static extern void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar);
|
||||||
|
|
||||||
|
/// Set the viewport area
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlViewport")]
|
||||||
|
public static extern void rlViewport(int x, int y, int width, int height);
|
||||||
|
|
||||||
|
/// Initialize drawing mode (how to organize vertex)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlBegin")]
|
||||||
|
public static extern void rlBegin(int mode);
|
||||||
|
|
||||||
|
/// Finish vertex providing
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnd")]
|
||||||
|
public static extern void rlEnd();
|
||||||
|
|
||||||
|
/// Define one vertex (position) - 2 int
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlVertex2i")]
|
||||||
|
public static extern void rlVertex2i(int x, int y);
|
||||||
|
|
||||||
|
/// Define one vertex (position) - 2 float
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlVertex2f")]
|
||||||
|
public static extern void rlVertex2f(float x, float y);
|
||||||
|
|
||||||
|
/// Define one vertex (position) - 3 float
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlVertex3f")]
|
||||||
|
public static extern void rlVertex3f(float x, float y, float z);
|
||||||
|
|
||||||
|
/// Define one vertex (texture coordinate) - 2 float
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlTexCoord2f")]
|
||||||
|
public static extern void rlTexCoord2f(float x, float y);
|
||||||
|
|
||||||
|
/// Define one vertex (normal) - 3 float
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlNormal3f")]
|
||||||
|
public static extern void rlNormal3f(float x, float y, float z);
|
||||||
|
|
||||||
|
/// Define one vertex (color) - 4 byte
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlColor4ub")]
|
||||||
|
public static extern void rlColor4ub(uint8 r, uint8 g, uint8 b, uint8 a);
|
||||||
|
|
||||||
|
/// Define one vertex (color) - 3 float
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlColor3f")]
|
||||||
|
public static extern void rlColor3f(float x, float y, float z);
|
||||||
|
|
||||||
|
/// Define one vertex (color) - 4 float
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlColor4f")]
|
||||||
|
public static extern void rlColor4f(float x, float y, float z, float w);
|
||||||
|
|
||||||
|
/// Enable vertex array (VAO, if supported)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableVertexArray")]
|
||||||
|
public static extern bool rlEnableVertexArray(int vaoId);
|
||||||
|
|
||||||
|
/// Disable vertex array (VAO, if supported)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableVertexArray")]
|
||||||
|
public static extern void rlDisableVertexArray();
|
||||||
|
|
||||||
|
/// Enable vertex buffer (VBO)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableVertexBuffer")]
|
||||||
|
public static extern void rlEnableVertexBuffer(int id);
|
||||||
|
|
||||||
|
/// Disable vertex buffer (VBO)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableVertexBuffer")]
|
||||||
|
public static extern void rlDisableVertexBuffer();
|
||||||
|
|
||||||
|
/// Enable vertex buffer element (VBO element)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableVertexBufferElement")]
|
||||||
|
public static extern void rlEnableVertexBufferElement(int id);
|
||||||
|
|
||||||
|
/// Disable vertex buffer element (VBO element)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableVertexBufferElement")]
|
||||||
|
public static extern void rlDisableVertexBufferElement();
|
||||||
|
|
||||||
|
/// Enable vertex attribute index
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableVertexAttribute")]
|
||||||
|
public static extern void rlEnableVertexAttribute(int index);
|
||||||
|
|
||||||
|
/// Disable vertex attribute index
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableVertexAttribute")]
|
||||||
|
public static extern void rlDisableVertexAttribute(int index);
|
||||||
|
|
||||||
|
/// Enable attribute state pointer
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableStatePointer")]
|
||||||
|
public static extern void rlEnableStatePointer(int vertexAttribType, void * buffer);
|
||||||
|
|
||||||
|
/// Disable attribute state pointer
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableStatePointer")]
|
||||||
|
public static extern void rlDisableStatePointer(int vertexAttribType);
|
||||||
|
|
||||||
|
/// Select and active a texture slot
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlActiveTextureSlot")]
|
||||||
|
public static extern void rlActiveTextureSlot(int slot);
|
||||||
|
|
||||||
|
/// Enable texture
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableTexture")]
|
||||||
|
public static extern void rlEnableTexture(int id);
|
||||||
|
|
||||||
|
/// Disable texture
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableTexture")]
|
||||||
|
public static extern void rlDisableTexture();
|
||||||
|
|
||||||
|
/// Enable texture cubemap
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableTextureCubemap")]
|
||||||
|
public static extern void rlEnableTextureCubemap(int id);
|
||||||
|
|
||||||
|
/// Disable texture cubemap
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableTextureCubemap")]
|
||||||
|
public static extern void rlDisableTextureCubemap();
|
||||||
|
|
||||||
|
/// Set texture parameters (filter, wrap)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlTextureParameters")]
|
||||||
|
public static extern void rlTextureParameters(int id, int param, int value);
|
||||||
|
|
||||||
|
/// Set cubemap parameters (filter, wrap)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlCubemapParameters")]
|
||||||
|
public static extern void rlCubemapParameters(int id, int param, int value);
|
||||||
|
|
||||||
|
/// Enable shader program
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableShader")]
|
||||||
|
public static extern void rlEnableShader(int id);
|
||||||
|
|
||||||
|
/// Disable shader program
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableShader")]
|
||||||
|
public static extern void rlDisableShader();
|
||||||
|
|
||||||
|
/// Enable render texture (fbo)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableFramebuffer")]
|
||||||
|
public static extern void rlEnableFramebuffer(int id);
|
||||||
|
|
||||||
|
/// Disable render texture (fbo), return to default framebuffer
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableFramebuffer")]
|
||||||
|
public static extern void rlDisableFramebuffer();
|
||||||
|
|
||||||
|
/// Activate multiple draw color buffers
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlActiveDrawBuffers")]
|
||||||
|
public static extern void rlActiveDrawBuffers(int count);
|
||||||
|
|
||||||
|
/// Enable color blending
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableColorBlend")]
|
||||||
|
public static extern void rlEnableColorBlend();
|
||||||
|
|
||||||
|
/// Disable color blending
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableColorBlend")]
|
||||||
|
public static extern void rlDisableColorBlend();
|
||||||
|
|
||||||
|
/// Enable depth test
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableDepthTest")]
|
||||||
|
public static extern void rlEnableDepthTest();
|
||||||
|
|
||||||
|
/// Disable depth test
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableDepthTest")]
|
||||||
|
public static extern void rlDisableDepthTest();
|
||||||
|
|
||||||
|
/// Enable depth write
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableDepthMask")]
|
||||||
|
public static extern void rlEnableDepthMask();
|
||||||
|
|
||||||
|
/// Disable depth write
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableDepthMask")]
|
||||||
|
public static extern void rlDisableDepthMask();
|
||||||
|
|
||||||
|
/// Enable backface culling
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableBackfaceCulling")]
|
||||||
|
public static extern void rlEnableBackfaceCulling();
|
||||||
|
|
||||||
|
/// Disable backface culling
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableBackfaceCulling")]
|
||||||
|
public static extern void rlDisableBackfaceCulling();
|
||||||
|
|
||||||
|
/// Set face culling mode
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetCullFace")]
|
||||||
|
public static extern void rlSetCullFace(int mode);
|
||||||
|
|
||||||
|
/// Enable scissor test
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableScissorTest")]
|
||||||
|
public static extern void rlEnableScissorTest();
|
||||||
|
|
||||||
|
/// Disable scissor test
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableScissorTest")]
|
||||||
|
public static extern void rlDisableScissorTest();
|
||||||
|
|
||||||
|
/// Scissor test
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlScissor")]
|
||||||
|
public static extern void rlScissor(int x, int y, int width, int height);
|
||||||
|
|
||||||
|
/// Enable wire mode
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableWireMode")]
|
||||||
|
public static extern void rlEnableWireMode();
|
||||||
|
|
||||||
|
/// Disable wire mode
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableWireMode")]
|
||||||
|
public static extern void rlDisableWireMode();
|
||||||
|
|
||||||
|
/// Set the line drawing width
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetLineWidth")]
|
||||||
|
public static extern void rlSetLineWidth(float width);
|
||||||
|
|
||||||
|
/// Get the line drawing width
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetLineWidth")]
|
||||||
|
public static extern float rlGetLineWidth();
|
||||||
|
|
||||||
|
/// Enable line aliasing
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableSmoothLines")]
|
||||||
|
public static extern void rlEnableSmoothLines();
|
||||||
|
|
||||||
|
/// Disable line aliasing
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableSmoothLines")]
|
||||||
|
public static extern void rlDisableSmoothLines();
|
||||||
|
|
||||||
|
/// Enable stereo rendering
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlEnableStereoRender")]
|
||||||
|
public static extern void rlEnableStereoRender();
|
||||||
|
|
||||||
|
/// Disable stereo rendering
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDisableStereoRender")]
|
||||||
|
public static extern void rlDisableStereoRender();
|
||||||
|
|
||||||
|
/// Check if stereo render is enabled
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlIsStereoRenderEnabled")]
|
||||||
|
public static extern bool rlIsStereoRenderEnabled();
|
||||||
|
|
||||||
|
/// Clear color buffer with color
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlClearColor")]
|
||||||
|
public static extern void rlClearColor(uint8 r, uint8 g, uint8 b, uint8 a);
|
||||||
|
|
||||||
|
/// Clear used screen buffers (color and depth)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlClearScreenBuffers")]
|
||||||
|
public static extern void rlClearScreenBuffers();
|
||||||
|
|
||||||
|
/// Check and log OpenGL error codes
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlCheckErrors")]
|
||||||
|
public static extern void rlCheckErrors();
|
||||||
|
|
||||||
|
/// Set blending mode
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetBlendMode")]
|
||||||
|
public static extern void rlSetBlendMode(int mode);
|
||||||
|
|
||||||
|
/// Set blending mode factor and equation (using OpenGL factors)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetBlendFactors")]
|
||||||
|
public static extern void rlSetBlendFactors(int glSrcFactor, int glDstFactor, int glEquation);
|
||||||
|
|
||||||
|
/// Set blending mode factors and equations separately (using OpenGL factors)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetBlendFactorsSeparate")]
|
||||||
|
public static extern void rlSetBlendFactorsSeparate(int glSrcRGB, int glDstRGB, int glSrcAlpha, int glDstAlpha, int glEqRGB, int glEqAlpha);
|
||||||
|
|
||||||
|
/// Initialize rlgl (buffers, shaders, textures, states)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlglInit")]
|
||||||
|
public static extern void rlglInit(int width, int height);
|
||||||
|
|
||||||
|
/// De-initialize rlgl (buffers, shaders, textures)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlglClose")]
|
||||||
|
public static extern void rlglClose();
|
||||||
|
|
||||||
|
/// Load OpenGL extensions (loader function required)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadExtensions")]
|
||||||
|
public static extern void rlLoadExtensions(void * loader);
|
||||||
|
|
||||||
|
/// Get current OpenGL version
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetVersion")]
|
||||||
|
public static extern int rlGetVersion();
|
||||||
|
|
||||||
|
/// Set current framebuffer width
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetFramebufferWidth")]
|
||||||
|
public static extern void rlSetFramebufferWidth(int width);
|
||||||
|
|
||||||
|
/// Get default framebuffer width
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetFramebufferWidth")]
|
||||||
|
public static extern int rlGetFramebufferWidth();
|
||||||
|
|
||||||
|
/// Set current framebuffer height
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetFramebufferHeight")]
|
||||||
|
public static extern void rlSetFramebufferHeight(int height);
|
||||||
|
|
||||||
|
/// Get default framebuffer height
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetFramebufferHeight")]
|
||||||
|
public static extern int rlGetFramebufferHeight();
|
||||||
|
|
||||||
|
/// Get default texture id
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetTextureIdDefault")]
|
||||||
|
public static extern int rlGetTextureIdDefault();
|
||||||
|
|
||||||
|
/// Get default shader id
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetShaderIdDefault")]
|
||||||
|
public static extern int rlGetShaderIdDefault();
|
||||||
|
|
||||||
|
/// Get default shader locations
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetShaderLocsDefault")]
|
||||||
|
public static extern int * rlGetShaderLocsDefault();
|
||||||
|
|
||||||
|
/// Load a render batch system
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadRenderBatch")]
|
||||||
|
public static extern rlRenderBatch rlLoadRenderBatch(int numBuffers, int bufferElements);
|
||||||
|
|
||||||
|
/// Unload render batch system
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUnloadRenderBatch")]
|
||||||
|
public static extern void rlUnloadRenderBatch(rlRenderBatch batch);
|
||||||
|
|
||||||
|
/// Draw render batch data (Update->Draw->Reset)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDrawRenderBatch")]
|
||||||
|
public static extern void rlDrawRenderBatch(rlRenderBatch * batch);
|
||||||
|
|
||||||
|
/// Set the active render batch for rlgl (NULL for default internal)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetRenderBatchActive")]
|
||||||
|
public static extern void rlSetRenderBatchActive(rlRenderBatch * batch);
|
||||||
|
|
||||||
|
/// Update and draw internal render batch
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDrawRenderBatchActive")]
|
||||||
|
public static extern void rlDrawRenderBatchActive();
|
||||||
|
|
||||||
|
/// Check internal buffer overflow for a given number of vertex
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlCheckRenderBatchLimit")]
|
||||||
|
public static extern bool rlCheckRenderBatchLimit(int vCount);
|
||||||
|
|
||||||
|
/// Set current texture for render batch and check buffers limits
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetTexture")]
|
||||||
|
public static extern void rlSetTexture(int id);
|
||||||
|
|
||||||
|
/// Load vertex array (vao) if supported
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadVertexArray")]
|
||||||
|
public static extern int rlLoadVertexArray();
|
||||||
|
|
||||||
|
/// Load a vertex buffer attribute
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadVertexBuffer")]
|
||||||
|
public static extern int rlLoadVertexBuffer(void * buffer, int size, bool dynamic);
|
||||||
|
|
||||||
|
/// Load a new attributes element buffer
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadVertexBufferElement")]
|
||||||
|
public static extern int rlLoadVertexBufferElement(void * buffer, int size, bool dynamic);
|
||||||
|
|
||||||
|
/// Update GPU buffer with new data
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUpdateVertexBuffer")]
|
||||||
|
public static extern void rlUpdateVertexBuffer(int bufferId, void * data, int dataSize, int offset);
|
||||||
|
|
||||||
|
/// Update vertex buffer elements with new data
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUpdateVertexBufferElements")]
|
||||||
|
public static extern void rlUpdateVertexBufferElements(int id, void * data, int dataSize, int offset);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUnloadVertexArray")]
|
||||||
|
public static extern void rlUnloadVertexArray(int vaoId);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUnloadVertexBuffer")]
|
||||||
|
public static extern void rlUnloadVertexBuffer(int vboId);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetVertexAttribute")]
|
||||||
|
public static extern void rlSetVertexAttribute(int index, int compSize, int type, bool normalized, int stride, void * pointer);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetVertexAttributeDivisor")]
|
||||||
|
public static extern void rlSetVertexAttributeDivisor(int index, int divisor);
|
||||||
|
|
||||||
|
/// Set vertex attribute default value
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetVertexAttributeDefault")]
|
||||||
|
public static extern void rlSetVertexAttributeDefault(int locIndex, void * value, int attribType, int count);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDrawVertexArray")]
|
||||||
|
public static extern void rlDrawVertexArray(int offset, int count);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDrawVertexArrayElements")]
|
||||||
|
public static extern void rlDrawVertexArrayElements(int offset, int count, void * buffer);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDrawVertexArrayInstanced")]
|
||||||
|
public static extern void rlDrawVertexArrayInstanced(int offset, int count, int instances);
|
||||||
|
|
||||||
|
///
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlDrawVertexArrayElementsInstanced")]
|
||||||
|
public static extern void rlDrawVertexArrayElementsInstanced(int offset, int count, void * buffer, int instances);
|
||||||
|
|
||||||
|
/// Load texture in GPU
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadTexture")]
|
||||||
|
public static extern int rlLoadTexture(void * data, int width, int height, int format, int mipmapCount);
|
||||||
|
|
||||||
|
/// Load depth texture/renderbuffer (to be attached to fbo)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadTextureDepth")]
|
||||||
|
public static extern int rlLoadTextureDepth(int width, int height, bool useRenderBuffer);
|
||||||
|
|
||||||
|
/// Load texture cubemap
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadTextureCubemap")]
|
||||||
|
public static extern int rlLoadTextureCubemap(void * data, int size, int format);
|
||||||
|
|
||||||
|
/// Update GPU texture with new data
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUpdateTexture")]
|
||||||
|
public static extern void rlUpdateTexture(int id, int offsetX, int offsetY, int width, int height, int format, void * data);
|
||||||
|
|
||||||
|
/// Get OpenGL internal formats
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetGlTextureFormats")]
|
||||||
|
public static extern void rlGetGlTextureFormats(int format, int * glInternalFormat, int * glFormat, int * glType);
|
||||||
|
|
||||||
|
/// Get name string for pixel format
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetPixelFormatName")]
|
||||||
|
public static extern char8 * rlGetPixelFormatName(int format);
|
||||||
|
|
||||||
|
/// Unload texture from GPU memory
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUnloadTexture")]
|
||||||
|
public static extern void rlUnloadTexture(int id);
|
||||||
|
|
||||||
|
/// Generate mipmap data for selected texture
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGenTextureMipmaps")]
|
||||||
|
public static extern void rlGenTextureMipmaps(int id, int width, int height, int format, int * mipmaps);
|
||||||
|
|
||||||
|
/// Read texture pixel data
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlReadTexturePixels")]
|
||||||
|
public static extern void * rlReadTexturePixels(int id, int width, int height, int format);
|
||||||
|
|
||||||
|
/// Read screen pixel data (color buffer)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlReadScreenPixels")]
|
||||||
|
public static extern char8 * rlReadScreenPixels(int width, int height);
|
||||||
|
|
||||||
|
/// Load an empty framebuffer
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadFramebuffer")]
|
||||||
|
public static extern int rlLoadFramebuffer(int width, int height);
|
||||||
|
|
||||||
|
/// Attach texture/renderbuffer to a framebuffer
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlFramebufferAttach")]
|
||||||
|
public static extern void rlFramebufferAttach(int fboId, int texId, int attachType, int texType, int mipLevel);
|
||||||
|
|
||||||
|
/// Verify framebuffer is complete
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlFramebufferComplete")]
|
||||||
|
public static extern bool rlFramebufferComplete(int id);
|
||||||
|
|
||||||
|
/// Delete framebuffer from GPU
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUnloadFramebuffer")]
|
||||||
|
public static extern void rlUnloadFramebuffer(int id);
|
||||||
|
|
||||||
|
/// Load shader from code strings
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadShaderCode")]
|
||||||
|
public static extern int rlLoadShaderCode(char8 * vsCode, char8 * fsCode);
|
||||||
|
|
||||||
|
/// Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlCompileShader")]
|
||||||
|
public static extern int rlCompileShader(char8 * shaderCode, int type);
|
||||||
|
|
||||||
|
/// Load custom shader program
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadShaderProgram")]
|
||||||
|
public static extern int rlLoadShaderProgram(int vShaderId, int fShaderId);
|
||||||
|
|
||||||
|
/// Unload shader program
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUnloadShaderProgram")]
|
||||||
|
public static extern void rlUnloadShaderProgram(int id);
|
||||||
|
|
||||||
|
/// Get shader location uniform
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetLocationUniform")]
|
||||||
|
public static extern int rlGetLocationUniform(int shaderId, char8 * uniformName);
|
||||||
|
|
||||||
|
/// Get shader location attribute
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetLocationAttrib")]
|
||||||
|
public static extern int rlGetLocationAttrib(int shaderId, char8 * attribName);
|
||||||
|
|
||||||
|
/// Set shader value uniform
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetUniform")]
|
||||||
|
public static extern void rlSetUniform(int locIndex, void * value, int uniformType, int count);
|
||||||
|
|
||||||
|
/// Set shader value matrix
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetUniformMatrix")]
|
||||||
|
public static extern void rlSetUniformMatrix(int locIndex, Matrix mat);
|
||||||
|
|
||||||
|
/// Set shader value sampler
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetUniformSampler")]
|
||||||
|
public static extern void rlSetUniformSampler(int locIndex, int textureId);
|
||||||
|
|
||||||
|
/// Set shader currently active (id and locations)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetShader")]
|
||||||
|
public static extern void rlSetShader(int id, int * locs);
|
||||||
|
|
||||||
|
/// Load compute shader program
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadComputeShaderProgram")]
|
||||||
|
public static extern int rlLoadComputeShaderProgram(int shaderId);
|
||||||
|
|
||||||
|
/// Dispatch compute shader (equivalent to *draw* for graphics pipeline)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlComputeShaderDispatch")]
|
||||||
|
public static extern void rlComputeShaderDispatch(int groupX, int groupY, int groupZ);
|
||||||
|
|
||||||
|
/// Load shader storage buffer object (SSBO)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadShaderBuffer")]
|
||||||
|
public static extern int rlLoadShaderBuffer(int size, void * data, int usageHint);
|
||||||
|
|
||||||
|
/// Unload shader storage buffer object (SSBO)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUnloadShaderBuffer")]
|
||||||
|
public static extern void rlUnloadShaderBuffer(int ssboId);
|
||||||
|
|
||||||
|
/// Update SSBO buffer data
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlUpdateShaderBuffer")]
|
||||||
|
public static extern void rlUpdateShaderBuffer(int id, void * data, int dataSize, int offset);
|
||||||
|
|
||||||
|
/// Bind SSBO buffer
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlBindShaderBuffer")]
|
||||||
|
public static extern void rlBindShaderBuffer(int id, int index);
|
||||||
|
|
||||||
|
/// Read SSBO buffer data (GPU->CPU)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlReadShaderBuffer")]
|
||||||
|
public static extern void rlReadShaderBuffer(int id, void * dest, int count, int offset);
|
||||||
|
|
||||||
|
/// Copy SSBO data between buffers
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlCopyShaderBuffer")]
|
||||||
|
public static extern void rlCopyShaderBuffer(int destId, int srcId, int destOffset, int srcOffset, int count);
|
||||||
|
|
||||||
|
/// Get SSBO buffer size
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetShaderBufferSize")]
|
||||||
|
public static extern int rlGetShaderBufferSize(int id);
|
||||||
|
|
||||||
|
/// Bind image texture
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlBindImageTexture")]
|
||||||
|
public static extern void rlBindImageTexture(int id, int index, int format, bool @readonly);
|
||||||
|
|
||||||
|
/// Get internal modelview matrix
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetMatrixModelview")]
|
||||||
|
public static extern Matrix rlGetMatrixModelview();
|
||||||
|
|
||||||
|
/// Get internal projection matrix
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetMatrixProjection")]
|
||||||
|
public static extern Matrix rlGetMatrixProjection();
|
||||||
|
|
||||||
|
/// Get internal accumulated transform matrix
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetMatrixTransform")]
|
||||||
|
public static extern Matrix rlGetMatrixTransform();
|
||||||
|
|
||||||
|
/// Get internal projection matrix for stereo render (selected eye)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetMatrixProjectionStereo")]
|
||||||
|
public static extern Matrix rlGetMatrixProjectionStereo(int eye);
|
||||||
|
|
||||||
|
/// Get internal view offset matrix for stereo render (selected eye)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlGetMatrixViewOffsetStereo")]
|
||||||
|
public static extern Matrix rlGetMatrixViewOffsetStereo(int eye);
|
||||||
|
|
||||||
|
/// Set a custom projection matrix (replaces internal projection matrix)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetMatrixProjection")]
|
||||||
|
public static extern void rlSetMatrixProjection(Matrix proj);
|
||||||
|
|
||||||
|
/// Set a custom modelview matrix (replaces internal modelview matrix)
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetMatrixModelview")]
|
||||||
|
public static extern void rlSetMatrixModelview(Matrix view);
|
||||||
|
|
||||||
|
/// Set eyes projection matrices for stereo rendering
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetMatrixProjectionStereo")]
|
||||||
|
public static extern void rlSetMatrixProjectionStereo(Matrix right, Matrix left);
|
||||||
|
|
||||||
|
/// Set eyes view offsets matrices for stereo rendering
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlSetMatrixViewOffsetStereo")]
|
||||||
|
public static extern void rlSetMatrixViewOffsetStereo(Matrix right, Matrix left);
|
||||||
|
|
||||||
|
/// Load and draw a cube
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadDrawCube")]
|
||||||
|
public static extern void rlLoadDrawCube();
|
||||||
|
|
||||||
|
/// Load and draw a quad
|
||||||
|
[Import("raylib.dll"), CallingConvention(.Cdecl), LinkName("rlLoadDrawQuad")]
|
||||||
|
public static extern void rlLoadDrawQuad();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -6,10 +6,10 @@ namespace Raylib;
|
||||||
[CRepr]
|
[CRepr]
|
||||||
public struct Vector2
|
public struct Vector2
|
||||||
{
|
{
|
||||||
/// Vector x component
|
///
|
||||||
public float x;
|
public float x;
|
||||||
|
|
||||||
/// Vector y component
|
///
|
||||||
public float y;
|
public float y;
|
||||||
|
|
||||||
public this(float x, float y)
|
public this(float x, float y)
|
||||||
|
|
|
@ -6,13 +6,13 @@ namespace Raylib;
|
||||||
[CRepr]
|
[CRepr]
|
||||||
public struct Vector3
|
public struct Vector3
|
||||||
{
|
{
|
||||||
/// Vector x component
|
///
|
||||||
public float x;
|
public float x;
|
||||||
|
|
||||||
/// Vector y component
|
///
|
||||||
public float y;
|
public float y;
|
||||||
|
|
||||||
/// Vector z component
|
///
|
||||||
public float z;
|
public float z;
|
||||||
|
|
||||||
public this(float x, float y, float z)
|
public this(float x, float y, float z)
|
||||||
|
|
|
@ -8,16 +8,16 @@ typealias Quaternion = Vector4;
|
||||||
[CRepr]
|
[CRepr]
|
||||||
public struct Vector4
|
public struct Vector4
|
||||||
{
|
{
|
||||||
/// Vector x component
|
///
|
||||||
public float x;
|
public float x;
|
||||||
|
|
||||||
/// Vector y component
|
///
|
||||||
public float y;
|
public float y;
|
||||||
|
|
||||||
/// Vector z component
|
///
|
||||||
public float z;
|
public float z;
|
||||||
|
|
||||||
/// Vector w component
|
///
|
||||||
public float w;
|
public float w;
|
||||||
|
|
||||||
public this(float x, float y, float z, float w)
|
public this(float x, float y, float z, float w)
|
||||||
|
|
16
raylib-beef/src/float16.bf
Normal file
16
raylib-beef/src/float16.bf
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
[CRepr]
|
||||||
|
public struct float16
|
||||||
|
{
|
||||||
|
///
|
||||||
|
public float[16] v;
|
||||||
|
|
||||||
|
public this(float[16] v)
|
||||||
|
{
|
||||||
|
this.v = v;
|
||||||
|
}
|
||||||
|
}
|
16
raylib-beef/src/float3.bf
Normal file
16
raylib-beef/src/float3.bf
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
[CRepr]
|
||||||
|
public struct float3
|
||||||
|
{
|
||||||
|
///
|
||||||
|
public float[3] v;
|
||||||
|
|
||||||
|
public this(float[3] v)
|
||||||
|
{
|
||||||
|
this.v = v;
|
||||||
|
}
|
||||||
|
}
|
25
raylib-beef/src/rlBlendMode.bf
Normal file
25
raylib-beef/src/rlBlendMode.bf
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
/// Color blending modes (pre-defined)
|
||||||
|
public enum rlBlendMode : c_int
|
||||||
|
{
|
||||||
|
/// Blend textures considering alpha (default)
|
||||||
|
RL_BLEND_ALPHA = 0,
|
||||||
|
/// Blend textures adding colors
|
||||||
|
RL_BLEND_ADDITIVE = 1,
|
||||||
|
/// Blend textures multiplying colors
|
||||||
|
RL_BLEND_MULTIPLIED = 2,
|
||||||
|
/// Blend textures adding colors (alternative)
|
||||||
|
RL_BLEND_ADD_COLORS = 3,
|
||||||
|
/// Blend textures subtracting colors (alternative)
|
||||||
|
RL_BLEND_SUBTRACT_COLORS = 4,
|
||||||
|
/// Blend premultiplied textures considering alpha
|
||||||
|
RL_BLEND_ALPHA_PREMULTIPLY = 5,
|
||||||
|
/// Blend textures using custom src/dst factors (use rlSetBlendFactors())
|
||||||
|
RL_BLEND_CUSTOM = 6,
|
||||||
|
/// Blend textures using custom src/dst factors (use rlSetBlendFactorsSeparate())
|
||||||
|
RL_BLEND_CUSTOM_SEPARATE = 7,
|
||||||
|
}
|
13
raylib-beef/src/rlCullMode.bf
Normal file
13
raylib-beef/src/rlCullMode.bf
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
/// Face culling mode
|
||||||
|
public enum rlCullMode : c_int
|
||||||
|
{
|
||||||
|
///
|
||||||
|
RL_CULL_FACE_FRONT = 0,
|
||||||
|
///
|
||||||
|
RL_CULL_FACE_BACK = 1,
|
||||||
|
}
|
28
raylib-beef/src/rlDrawCall.bf
Normal file
28
raylib-beef/src/rlDrawCall.bf
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
[CRepr]
|
||||||
|
public struct rlDrawCall
|
||||||
|
{
|
||||||
|
/// Drawing mode: LINES, TRIANGLES, QUADS
|
||||||
|
public int mode;
|
||||||
|
|
||||||
|
/// Number of vertex of the draw
|
||||||
|
public int vertexCount;
|
||||||
|
|
||||||
|
/// Number of vertex required for index alignment (LINES, TRIANGLES)
|
||||||
|
public int vertexAlignment;
|
||||||
|
|
||||||
|
/// Texture id to be used on the draw -> Use to create new draw call if changes
|
||||||
|
public int textureId;
|
||||||
|
|
||||||
|
public this(int mode, int vertexCount, int vertexAlignment, int textureId)
|
||||||
|
{
|
||||||
|
this.mode = mode;
|
||||||
|
this.vertexCount = vertexCount;
|
||||||
|
this.vertexAlignment = vertexAlignment;
|
||||||
|
this.textureId = textureId;
|
||||||
|
}
|
||||||
|
}
|
25
raylib-beef/src/rlFramebufferAttachTextureType.bf
Normal file
25
raylib-beef/src/rlFramebufferAttachTextureType.bf
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
/// Framebuffer texture attachment type
|
||||||
|
public enum rlFramebufferAttachTextureType : c_int
|
||||||
|
{
|
||||||
|
/// Framebuffer texture attachment type: cubemap, +X side
|
||||||
|
RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0,
|
||||||
|
/// Framebuffer texture attachment type: cubemap, -X side
|
||||||
|
RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = 1,
|
||||||
|
/// Framebuffer texture attachment type: cubemap, +Y side
|
||||||
|
RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = 2,
|
||||||
|
/// Framebuffer texture attachment type: cubemap, -Y side
|
||||||
|
RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3,
|
||||||
|
/// Framebuffer texture attachment type: cubemap, +Z side
|
||||||
|
RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4,
|
||||||
|
/// Framebuffer texture attachment type: cubemap, -Z side
|
||||||
|
RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5,
|
||||||
|
/// Framebuffer texture attachment type: texture2d
|
||||||
|
RL_ATTACHMENT_TEXTURE2D = 100,
|
||||||
|
/// Framebuffer texture attachment type: renderbuffer
|
||||||
|
RL_ATTACHMENT_RENDERBUFFER = 200,
|
||||||
|
}
|
29
raylib-beef/src/rlFramebufferAttachType.bf
Normal file
29
raylib-beef/src/rlFramebufferAttachType.bf
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
/// Framebuffer attachment type
|
||||||
|
public enum rlFramebufferAttachType : c_int
|
||||||
|
{
|
||||||
|
/// Framebuffer attachment type: color 0
|
||||||
|
RL_ATTACHMENT_COLOR_CHANNEL0 = 0,
|
||||||
|
/// Framebuffer attachment type: color 1
|
||||||
|
RL_ATTACHMENT_COLOR_CHANNEL1 = 1,
|
||||||
|
/// Framebuffer attachment type: color 2
|
||||||
|
RL_ATTACHMENT_COLOR_CHANNEL2 = 2,
|
||||||
|
/// Framebuffer attachment type: color 3
|
||||||
|
RL_ATTACHMENT_COLOR_CHANNEL3 = 3,
|
||||||
|
/// Framebuffer attachment type: color 4
|
||||||
|
RL_ATTACHMENT_COLOR_CHANNEL4 = 4,
|
||||||
|
/// Framebuffer attachment type: color 5
|
||||||
|
RL_ATTACHMENT_COLOR_CHANNEL5 = 5,
|
||||||
|
/// Framebuffer attachment type: color 6
|
||||||
|
RL_ATTACHMENT_COLOR_CHANNEL6 = 6,
|
||||||
|
/// Framebuffer attachment type: color 7
|
||||||
|
RL_ATTACHMENT_COLOR_CHANNEL7 = 7,
|
||||||
|
/// Framebuffer attachment type: depth
|
||||||
|
RL_ATTACHMENT_DEPTH = 100,
|
||||||
|
/// Framebuffer attachment type: stencil
|
||||||
|
RL_ATTACHMENT_STENCIL = 200,
|
||||||
|
}
|
19
raylib-beef/src/rlGlVersion.bf
Normal file
19
raylib-beef/src/rlGlVersion.bf
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
/// OpenGL version
|
||||||
|
public enum rlGlVersion : c_int
|
||||||
|
{
|
||||||
|
/// OpenGL 1.1
|
||||||
|
RL_OPENGL_11 = 1,
|
||||||
|
/// OpenGL 2.1 (GLSL 120)
|
||||||
|
RL_OPENGL_21 = 2,
|
||||||
|
/// OpenGL 3.3 (GLSL 330)
|
||||||
|
RL_OPENGL_33 = 3,
|
||||||
|
/// OpenGL 4.3 (using GLSL 330)
|
||||||
|
RL_OPENGL_43 = 4,
|
||||||
|
/// OpenGL ES 2.0 (GLSL 100)
|
||||||
|
RL_OPENGL_ES_20 = 5,
|
||||||
|
}
|
51
raylib-beef/src/rlPixelFormat.bf
Normal file
51
raylib-beef/src/rlPixelFormat.bf
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
/// Texture pixel formats
|
||||||
|
public enum rlPixelFormat : c_int
|
||||||
|
{
|
||||||
|
/// 8 bit per pixel (no alpha)
|
||||||
|
RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1,
|
||||||
|
/// 8*2 bpp (2 channels)
|
||||||
|
RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2,
|
||||||
|
/// 16 bpp
|
||||||
|
RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3,
|
||||||
|
/// 24 bpp
|
||||||
|
RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4,
|
||||||
|
/// 16 bpp (1 bit alpha)
|
||||||
|
RL_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5,
|
||||||
|
/// 16 bpp (4 bit alpha)
|
||||||
|
RL_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6,
|
||||||
|
/// 32 bpp
|
||||||
|
RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7,
|
||||||
|
/// 32 bpp (1 channel - float)
|
||||||
|
RL_PIXELFORMAT_UNCOMPRESSED_R32 = 8,
|
||||||
|
/// 32*3 bpp (3 channels - float)
|
||||||
|
RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9,
|
||||||
|
/// 32*4 bpp (4 channels - float)
|
||||||
|
RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10,
|
||||||
|
/// 4 bpp (no alpha)
|
||||||
|
RL_PIXELFORMAT_COMPRESSED_DXT1_RGB = 11,
|
||||||
|
/// 4 bpp (1 bit alpha)
|
||||||
|
RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12,
|
||||||
|
/// 8 bpp
|
||||||
|
RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13,
|
||||||
|
/// 8 bpp
|
||||||
|
RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14,
|
||||||
|
/// 4 bpp
|
||||||
|
RL_PIXELFORMAT_COMPRESSED_ETC1_RGB = 15,
|
||||||
|
/// 4 bpp
|
||||||
|
RL_PIXELFORMAT_COMPRESSED_ETC2_RGB = 16,
|
||||||
|
/// 8 bpp
|
||||||
|
RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17,
|
||||||
|
/// 4 bpp
|
||||||
|
RL_PIXELFORMAT_COMPRESSED_PVRT_RGB = 18,
|
||||||
|
/// 4 bpp
|
||||||
|
RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19,
|
||||||
|
/// 8 bpp
|
||||||
|
RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20,
|
||||||
|
/// 2 bpp
|
||||||
|
RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21,
|
||||||
|
}
|
36
raylib-beef/src/rlRenderBatch.bf
Normal file
36
raylib-beef/src/rlRenderBatch.bf
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
[CRepr]
|
||||||
|
public struct rlRenderBatch
|
||||||
|
{
|
||||||
|
/// Number of vertex buffers (multi-buffering support)
|
||||||
|
public int bufferCount;
|
||||||
|
|
||||||
|
/// Current buffer tracking in case of multi-buffering
|
||||||
|
public int currentBuffer;
|
||||||
|
|
||||||
|
/// Dynamic buffer(s) for vertex data
|
||||||
|
public rlVertexBuffer * vertexBuffer;
|
||||||
|
|
||||||
|
/// Draw calls array, depends on textureId
|
||||||
|
public rlDrawCall * draws;
|
||||||
|
|
||||||
|
/// Draw calls counter
|
||||||
|
public int drawCounter;
|
||||||
|
|
||||||
|
/// Current depth value for next draw
|
||||||
|
public float currentDepth;
|
||||||
|
|
||||||
|
public this(int bufferCount, int currentBuffer, rlVertexBuffer * vertexBuffer, rlDrawCall * draws, int drawCounter, float currentDepth)
|
||||||
|
{
|
||||||
|
this.bufferCount = bufferCount;
|
||||||
|
this.currentBuffer = currentBuffer;
|
||||||
|
this.vertexBuffer = vertexBuffer;
|
||||||
|
this.draws = draws;
|
||||||
|
this.drawCounter = drawCounter;
|
||||||
|
this.currentDepth = currentDepth;
|
||||||
|
}
|
||||||
|
}
|
17
raylib-beef/src/rlShaderAttributeDataType.bf
Normal file
17
raylib-beef/src/rlShaderAttributeDataType.bf
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
/// Shader attribute data types
|
||||||
|
public enum rlShaderAttributeDataType : c_int
|
||||||
|
{
|
||||||
|
/// Shader attribute type: float
|
||||||
|
RL_SHADER_ATTRIB_FLOAT = 0,
|
||||||
|
/// Shader attribute type: vec2 (2 float)
|
||||||
|
RL_SHADER_ATTRIB_VEC2 = 1,
|
||||||
|
/// Shader attribute type: vec3 (3 float)
|
||||||
|
RL_SHADER_ATTRIB_VEC3 = 2,
|
||||||
|
/// Shader attribute type: vec4 (4 float)
|
||||||
|
RL_SHADER_ATTRIB_VEC4 = 3,
|
||||||
|
}
|
61
raylib-beef/src/rlShaderLocationIndex.bf
Normal file
61
raylib-beef/src/rlShaderLocationIndex.bf
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
/// Shader location point type
|
||||||
|
public enum rlShaderLocationIndex : c_int
|
||||||
|
{
|
||||||
|
/// Shader location: vertex attribute: position
|
||||||
|
RL_SHADER_LOC_VERTEX_POSITION = 0,
|
||||||
|
/// Shader location: vertex attribute: texcoord01
|
||||||
|
RL_SHADER_LOC_VERTEX_TEXCOORD01 = 1,
|
||||||
|
/// Shader location: vertex attribute: texcoord02
|
||||||
|
RL_SHADER_LOC_VERTEX_TEXCOORD02 = 2,
|
||||||
|
/// Shader location: vertex attribute: normal
|
||||||
|
RL_SHADER_LOC_VERTEX_NORMAL = 3,
|
||||||
|
/// Shader location: vertex attribute: tangent
|
||||||
|
RL_SHADER_LOC_VERTEX_TANGENT = 4,
|
||||||
|
/// Shader location: vertex attribute: color
|
||||||
|
RL_SHADER_LOC_VERTEX_COLOR = 5,
|
||||||
|
/// Shader location: matrix uniform: model-view-projection
|
||||||
|
RL_SHADER_LOC_MATRIX_MVP = 6,
|
||||||
|
/// Shader location: matrix uniform: view (camera transform)
|
||||||
|
RL_SHADER_LOC_MATRIX_VIEW = 7,
|
||||||
|
/// Shader location: matrix uniform: projection
|
||||||
|
RL_SHADER_LOC_MATRIX_PROJECTION = 8,
|
||||||
|
/// Shader location: matrix uniform: model (transform)
|
||||||
|
RL_SHADER_LOC_MATRIX_MODEL = 9,
|
||||||
|
/// Shader location: matrix uniform: normal
|
||||||
|
RL_SHADER_LOC_MATRIX_NORMAL = 10,
|
||||||
|
/// Shader location: vector uniform: view
|
||||||
|
RL_SHADER_LOC_VECTOR_VIEW = 11,
|
||||||
|
/// Shader location: vector uniform: diffuse color
|
||||||
|
RL_SHADER_LOC_COLOR_DIFFUSE = 12,
|
||||||
|
/// Shader location: vector uniform: specular color
|
||||||
|
RL_SHADER_LOC_COLOR_SPECULAR = 13,
|
||||||
|
/// Shader location: vector uniform: ambient color
|
||||||
|
RL_SHADER_LOC_COLOR_AMBIENT = 14,
|
||||||
|
/// Shader location: sampler2d texture: albedo (same as: RL_SHADER_LOC_MAP_DIFFUSE)
|
||||||
|
RL_SHADER_LOC_MAP_ALBEDO = 15,
|
||||||
|
/// Shader location: sampler2d texture: metalness (same as: RL_SHADER_LOC_MAP_SPECULAR)
|
||||||
|
RL_SHADER_LOC_MAP_METALNESS = 16,
|
||||||
|
/// Shader location: sampler2d texture: normal
|
||||||
|
RL_SHADER_LOC_MAP_NORMAL = 17,
|
||||||
|
/// Shader location: sampler2d texture: roughness
|
||||||
|
RL_SHADER_LOC_MAP_ROUGHNESS = 18,
|
||||||
|
/// Shader location: sampler2d texture: occlusion
|
||||||
|
RL_SHADER_LOC_MAP_OCCLUSION = 19,
|
||||||
|
/// Shader location: sampler2d texture: emission
|
||||||
|
RL_SHADER_LOC_MAP_EMISSION = 20,
|
||||||
|
/// Shader location: sampler2d texture: height
|
||||||
|
RL_SHADER_LOC_MAP_HEIGHT = 21,
|
||||||
|
/// Shader location: samplerCube texture: cubemap
|
||||||
|
RL_SHADER_LOC_MAP_CUBEMAP = 22,
|
||||||
|
/// Shader location: samplerCube texture: irradiance
|
||||||
|
RL_SHADER_LOC_MAP_IRRADIANCE = 23,
|
||||||
|
/// Shader location: samplerCube texture: prefilter
|
||||||
|
RL_SHADER_LOC_MAP_PREFILTER = 24,
|
||||||
|
/// Shader location: sampler2d texture: brdf
|
||||||
|
RL_SHADER_LOC_MAP_BRDF = 25,
|
||||||
|
}
|
27
raylib-beef/src/rlShaderUniformDataType.bf
Normal file
27
raylib-beef/src/rlShaderUniformDataType.bf
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
/// Shader uniform data type
|
||||||
|
public enum rlShaderUniformDataType : c_int
|
||||||
|
{
|
||||||
|
/// Shader uniform type: float
|
||||||
|
RL_SHADER_UNIFORM_FLOAT = 0,
|
||||||
|
/// Shader uniform type: vec2 (2 float)
|
||||||
|
RL_SHADER_UNIFORM_VEC2 = 1,
|
||||||
|
/// Shader uniform type: vec3 (3 float)
|
||||||
|
RL_SHADER_UNIFORM_VEC3 = 2,
|
||||||
|
/// Shader uniform type: vec4 (4 float)
|
||||||
|
RL_SHADER_UNIFORM_VEC4 = 3,
|
||||||
|
/// Shader uniform type: int
|
||||||
|
RL_SHADER_UNIFORM_INT = 4,
|
||||||
|
/// Shader uniform type: ivec2 (2 int)
|
||||||
|
RL_SHADER_UNIFORM_IVEC2 = 5,
|
||||||
|
/// Shader uniform type: ivec3 (3 int)
|
||||||
|
RL_SHADER_UNIFORM_IVEC3 = 6,
|
||||||
|
/// Shader uniform type: ivec4 (4 int)
|
||||||
|
RL_SHADER_UNIFORM_IVEC4 = 7,
|
||||||
|
/// Shader uniform type: sampler2d
|
||||||
|
RL_SHADER_UNIFORM_SAMPLER2D = 8,
|
||||||
|
}
|
21
raylib-beef/src/rlTextureFilter.bf
Normal file
21
raylib-beef/src/rlTextureFilter.bf
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
/// Texture parameters: filter mode
|
||||||
|
public enum rlTextureFilter : c_int
|
||||||
|
{
|
||||||
|
/// No filter, just pixel approximation
|
||||||
|
RL_TEXTURE_FILTER_POINT = 0,
|
||||||
|
/// Linear filtering
|
||||||
|
RL_TEXTURE_FILTER_BILINEAR = 1,
|
||||||
|
/// Trilinear filtering (linear with mipmaps)
|
||||||
|
RL_TEXTURE_FILTER_TRILINEAR = 2,
|
||||||
|
/// Anisotropic filtering 4x
|
||||||
|
RL_TEXTURE_FILTER_ANISOTROPIC_4X = 3,
|
||||||
|
/// Anisotropic filtering 8x
|
||||||
|
RL_TEXTURE_FILTER_ANISOTROPIC_8X = 4,
|
||||||
|
/// Anisotropic filtering 16x
|
||||||
|
RL_TEXTURE_FILTER_ANISOTROPIC_16X = 5,
|
||||||
|
}
|
25
raylib-beef/src/rlTraceLogLevel.bf
Normal file
25
raylib-beef/src/rlTraceLogLevel.bf
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
/// Trace log level
|
||||||
|
public enum rlTraceLogLevel : c_int
|
||||||
|
{
|
||||||
|
/// Display all logs
|
||||||
|
RL_LOG_ALL = 0,
|
||||||
|
/// Trace logging, intended for internal use only
|
||||||
|
RL_LOG_TRACE = 1,
|
||||||
|
/// Debug logging, used for internal debugging, it should be disabled on release builds
|
||||||
|
RL_LOG_DEBUG = 2,
|
||||||
|
/// Info logging, used for program execution info
|
||||||
|
RL_LOG_INFO = 3,
|
||||||
|
/// Warning logging, used on recoverable failures
|
||||||
|
RL_LOG_WARNING = 4,
|
||||||
|
/// Error logging, used on unrecoverable failures
|
||||||
|
RL_LOG_ERROR = 5,
|
||||||
|
/// Fatal logging, used to abort program: exit(EXIT_FAILURE)
|
||||||
|
RL_LOG_FATAL = 6,
|
||||||
|
/// Disable logging
|
||||||
|
RL_LOG_NONE = 7,
|
||||||
|
}
|
40
raylib-beef/src/rlVertexBuffer.bf
Normal file
40
raylib-beef/src/rlVertexBuffer.bf
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
using System;
|
||||||
|
using System.Interop;
|
||||||
|
|
||||||
|
namespace Raylib;
|
||||||
|
|
||||||
|
[CRepr]
|
||||||
|
public struct rlVertexBuffer
|
||||||
|
{
|
||||||
|
/// Number of elements in the buffer (QUADS)
|
||||||
|
public int elementCount;
|
||||||
|
|
||||||
|
/// Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
|
||||||
|
public float * vertices;
|
||||||
|
|
||||||
|
/// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
|
||||||
|
public float * texcoords;
|
||||||
|
|
||||||
|
/// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
|
||||||
|
public char8 * colors;
|
||||||
|
|
||||||
|
/// Vertex indices (in case vertex data comes indexed) (6 indices per quad)
|
||||||
|
public int * indices;
|
||||||
|
|
||||||
|
/// OpenGL Vertex Array Object id
|
||||||
|
public int vaoId;
|
||||||
|
|
||||||
|
/// OpenGL Vertex Buffer Objects id (4 types of vertex data)
|
||||||
|
public int[4] vboId;
|
||||||
|
|
||||||
|
public this(int elementCount, float * vertices, float * texcoords, char8 * colors, int * indices, int vaoId, int[4] vboId)
|
||||||
|
{
|
||||||
|
this.elementCount = elementCount;
|
||||||
|
this.vertices = vertices;
|
||||||
|
this.texcoords = texcoords;
|
||||||
|
this.colors = colors;
|
||||||
|
this.indices = indices;
|
||||||
|
this.vaoId = vaoId;
|
||||||
|
this.vboId = vboId;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue