add bindings

This commit is contained in:
2026-06-08 16:15:11 +02:00
commit c1d7ca709d
13 changed files with 59885 additions and 0 deletions

19745
src/Functions.bf Normal file

File diff suppressed because it is too large Load Diff

26
src/Library.bf Normal file
View File

@@ -0,0 +1,26 @@
using System;
using CxxBuildTool;
namespace VulkanMemoryAllocator;
static
{
[CLink, AlwaysInclude, Export]
private static void __VMA_BF_FATAL_ERROR(char8* msg, char8* file, int32 line)
{
Runtime.FatalError(scope .(msg), scope .(file), line);
}
[OnCompile(.TypeDone)]
private static void Build()
{
if (!Compiler.IsBuilding) return;
String flags = scope .(128);
if (Environment.GetEnvironmentVariable("VULKAN_SDK", flags) case .Ok)
{
flags.Insert(0, "-I");
flags.Append("/include");
}
CxxBuildTool.Ninja(Compiler.ProjectDir + "/src", Compiler.BuildDir + "/" + Compiler.ProjectName, "vk_mem_alloc", flags, "vk_mem_alloc.cpp");
}
}

19739
src/VkMemAlloc.bf Normal file

File diff suppressed because it is too large Load Diff

9
src/vk_mem_alloc.cpp Normal file
View File

@@ -0,0 +1,9 @@
extern "C" void
__VMA_BF_FATAL_ERROR(const char* message, const char* file, int line);
#define VMA_ASSERT(expr) \
if (!(expr)) \
__VMA_BF_FATAL_ERROR("VMA Assert Failed: " #expr, __FILE__, __LINE__);
#define VMA_IMPLEMENTATION
#define VK_NO_PROTOTYPES
#include "vk_mem_alloc.h"

19975
src/vk_mem_alloc.h Normal file

File diff suppressed because it is too large Load Diff