This commit is contained in:
2026-06-08 16:43:18 +02:00
parent d0789d2ef7
commit 5638772ec2
8 changed files with 70 additions and 131 deletions

View File

@@ -5,23 +5,6 @@ using System.Interop;
namespace Glfw;
static class Glfw
{
public struct Bool : c_int
{
public static operator Self(bool b) => b ? True : False;
public static operator bool(Self b) => b != False;
}
// Vulkan
public typealias PFN_vkGetInstanceProcAddr = void*;
public struct VkInstance : int;
public struct VkPhysicalDevice : int;
public typealias VkResult = c_int;
public struct VkAllocationCallbacks;
public struct VkSurfaceKHR : int;
}
static
{
/*************************************************************************

34
src/Library.bf Normal file
View File

@@ -0,0 +1,34 @@
using System;
using System.Interop;
using CxxBuildTool;
namespace Glfw;
static class Glfw
{
public struct Bool : c_int
{
public static operator Self(bool b) => b ? True : False;
public static operator bool(Self b) => b != False;
}
// Vulkan
public typealias PFN_vkGetInstanceProcAddr = void*;
public struct VkInstance : int;
public struct VkPhysicalDevice : int;
public typealias VkResult = c_int;
public struct VkAllocationCallbacks;
public struct VkSurfaceKHR : int;
[OnCompile(.TypeDone)]
private static void Build()
{
if (!Compiler.IsBuilding) return;
CxxBuildTool.CMake(
Compiler.ProjectDir + "/glfw",
Compiler.BuildDir + "/" + Compiler.ProjectName,
"-DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -DGLFW_INSTALL=OFF"
);
}
}