Skip to content

Commit

Permalink
feat(api): [vulkan] update
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 committed Jan 26, 2025
1 parent 55ae810 commit 393f511
Show file tree
Hide file tree
Showing 2,065 changed files with 137,364 additions and 191,054 deletions.
10 changes: 3 additions & 7 deletions generators/glfw/src/main/resources/glfw3native.gen
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
// glfw3native.h

import "windows.gen";
import "x11.gen";

using GLFWmonitor = struct GLFWmonitor;
using GLFWwindow = struct GLFWwindow;

using HWND = void*;
using HGLRC = void*;
using CGDirectDisplayID = uint32_t;
using id = void*;
using XID = unsigned long;
using Display = int; // enum Display {}
using RRCrtc = XID;
using RROutput = XID;
using Window = XID;
using GLXContext = struct __GLXcontextRec *;
using GLXWindow = XID;
using EGLDisplay = void*;
Expand Down
13 changes: 9 additions & 4 deletions generators/nfd/src/main/kotlin/overrungl/nfd/NFDGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,30 @@ import overrungl.gen.writeNativeImageRegistration

const val nfdPackage = "overrungl.nfd"
const val nfdLookup = "NFDInternal.lookup()"
const val nfdnchar_t_LAYOUT = "NFDInternal.nfdnchar_t"
const val nfdpathsetsize_t_LAYOUT = "NFDInternal.nfdpathsetsize_t"

fun main() {
registerDefType(
"nfdnchar_t", DynamicValueType(
"nfdnchar_t",
"int",
memoryLayout = DefTypeDynamicValueLayout(
memoryLayout = "NFDInternal.nfdnchar_t",
memoryLayout = nfdnchar_t_LAYOUT,
possibleActualTypes = listOf("ValueLayout.OfByte", "ValueLayout.OfChar"),
carrierMap = mapOf("ValueLayout.OfByte" to "byte", "ValueLayout.OfChar" to "char"),
asCharMap = mapOf("ValueLayout.OfByte" to 'B', "ValueLayout.OfChar" to 'C'),
),
processor = wchar_t.processor
processor = SizingProcessor(nfdnchar_t_LAYOUT, "Int")
)
)
registerDefType(
"nfdpathsetsize_t",
size_t.copy(memoryLayout = (size_t.memoryLayout as DefTypeDynamicValueLayout)
.copy(memoryLayout = "NFDInternal.nfdpathsetsize_t"))
size_t.copy(
memoryLayout = (size_t.memoryLayout as DefTypeDynamicValueLayout)
.copy(memoryLayout = nfdpathsetsize_t_LAYOUT),
processor = SizingProcessor(nfdpathsetsize_t_LAYOUT, "Long")
)
)
DefinitionFile("nfd.gen").compile(nfdPackage, "NFD", nfdLookup)

Expand Down
10 changes: 5 additions & 5 deletions generators/nfd/src/main/resources/nfd.gen
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fn nfdresult_t NFD_OpenDialog_With_Impl(nfdversion_t version,
const nfdopendialognargs_t* args) @NFD_OpenDialogN_With_Impl;
fn nfdresult_t NFD_OpenDialog_With(nfdnchar_t** outPath,
const nfdopendialognargs_t* args) {
return NFD_OpenDialog_With_Impl(NFD_INTERFACE_VERSION, outPath, args);
"return NFD_OpenDialog_With_Impl(NFD_INTERFACE_VERSION, outPath, args);"
}

fn nfdresult_t NFD_OpenDialogMultiple(const nfdpathset_t** outPaths,
Expand All @@ -82,7 +82,7 @@ fn nfdresult_t NFD_OpenDialogMultiple_With_Impl(nfdversion_t version,
const nfdopendialognargs_t* args) @NFD_OpenDialogMultipleN_With_Impl;
fn nfdresult_t NFD_OpenDialogMultiple_With(const nfdpathset_t** outPaths,
const nfdopendialognargs_t* args) {
return NFD_OpenDialogMultiple_With_Impl(NFD_INTERFACE_VERSION, outPaths, args);
"return NFD_OpenDialogMultiple_With_Impl(NFD_INTERFACE_VERSION, outPaths, args);"
}

fn nfdresult_t NFD_SaveDialog(nfdnchar_t** outPath,
Expand All @@ -95,7 +95,7 @@ fn nfdresult_t NFD_SaveDialog_With_Impl(nfdversion_t version,
const nfdsavedialognargs_t* args) @NFD_SaveDialogN_With_Impl;
fn nfdresult_t NFD_SaveDialog_With(nfdnchar_t** outPath,
const nfdsavedialognargs_t* args) {
return NFD_SaveDialog_With_Impl(NFD_INTERFACE_VERSION, outPath, args);
"return NFD_SaveDialog_With_Impl(NFD_INTERFACE_VERSION, outPath, args);"
}

fn nfdresult_t NFD_PickFolder(nfdnchar_t** outPath, const nfdnchar_t* defaultPath) @NFD_PickFolderN;
Expand All @@ -104,7 +104,7 @@ fn nfdresult_t NFD_PickFolder_With_Impl(nfdversion_t version,
const nfdpickfoldernargs_t* args) @NFD_PickFolderN_With_Impl;
fn nfdresult_t NFD_PickFolder_With(nfdnchar_t** outPath,
const nfdpickfoldernargs_t* args) {
return NFD_PickFolder_With_Impl(NFD_INTERFACE_VERSION, outPath, args);
"return NFD_PickFolder_With_Impl(NFD_INTERFACE_VERSION, outPath, args);"
}

fn nfdresult_t NFD_PickFolderMultiple(const nfdpathset_t** outPaths,
Expand All @@ -114,7 +114,7 @@ fn nfdresult_t NFD_PickFolderMultiple_With_Impl(nfdversion_t version,
const nfdpickfoldernargs_t* args) @NFD_PickFolderMultipleN_With_Impl;
fn nfdresult_t NFD_PickFolderMultiple_With(const nfdpathset_t** outPaths,
const nfdpickfoldernargs_t* args) {
return NFD_PickFolderMultiple_With_Impl(NFD_INTERFACE_VERSION, outPaths, args);
"return NFD_PickFolderMultiple_With_Impl(NFD_INTERFACE_VERSION, outPaths, args);"
}

fn const char* NFD_GetError();
Expand Down
1 change: 1 addition & 0 deletions generators/openal/src/main/resources/alc.gen
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ fn ALCboolean alcMakeContextCurrent(ALCcontext *context);
fn void alcProcessContext(ALCcontext *context);
fn void alcSuspendContext(ALCcontext *context);
fn void alcDestroyContext(ALCcontext *context);
fn ALCcontext* alcGetCurrentContext();
fn ALCdevice* alcGetContextsDevice(ALCcontext *context);

fn ALCdevice* alcOpenDevice(const ALCchar *devicename);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class InstanceDowncall(
var constructorParam: String? = null
var handlesConstructorCode: String? = null
var constructorCode: String? = null
var customCode: String? = null
private val extends = mutableListOf<String>()
private val fields = mutableListOf<InstanceDowncallField>()
val handleFields = mutableListOf<InstanceDowncallField>()
Expand Down Expand Up @@ -141,11 +140,6 @@ class InstanceDowncall(
writeFunction(sb, m, handlesInstance = "handles", staticMethod = false)
}

if (customCode != null) {
sb.appendLine(" // --- OverrunGL custom code ---")
sb.appendLine(customCode!!.prependIndent(" "))
}

sb.appendLine("}")

writeString(path, sb.toString())
Expand Down
Loading

0 comments on commit 393f511

Please sign in to comment.