Skip to content

Commit

Permalink
feat(sdl) update to 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Spasi committed Jan 22, 2025
1 parent 327b77e commit b7fdb7c
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ private Functions() {}
SDL_HINT_MAC_BACKGROUND_APP = "SDL_MAC_BACKGROUND_APP",
SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK = "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK",
SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH = "SDL_MAC_OPENGL_ASYNC_DISPATCH",
SDL_HINT_MAC_OPTION_AS_ALT = "SDL_MAC_OPTION_AS_ALT",
SDL_HINT_MAC_SCROLL_MOMENTUM = "SDL_MAC_SCROLL_MOMENTUM",
SDL_HINT_MAIN_CALLBACK_RATE = "SDL_MAIN_CALLBACK_RATE",
SDL_HINT_MOUSE_AUTO_CAPTURE = "SDL_MOUSE_AUTO_CAPTURE",
Expand Down
24 changes: 12 additions & 12 deletions modules/lwjgl/sdl/src/generated/java/org/lwjgl/sdl/SDLStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,20 +332,20 @@ public static boolean nSDL_EnumerateStorageDirectory(long storage, long path, lo

/** {@code bool SDL_EnumerateStorageDirectory(SDL_Storage * storage, char const * path, SDL_EnumerateDirectoryCallback callback, void * userdata)} */
@NativeType("bool")
public static boolean SDL_EnumerateStorageDirectory(@NativeType("SDL_Storage *") long storage, @NativeType("char const *") ByteBuffer path, @NativeType("SDL_EnumerateDirectoryCallback") SDL_EnumerateDirectoryCallbackI callback, @NativeType("void *") long userdata) {
public static boolean SDL_EnumerateStorageDirectory(@NativeType("SDL_Storage *") long storage, @NativeType("char const *") @Nullable ByteBuffer path, @NativeType("SDL_EnumerateDirectoryCallback") SDL_EnumerateDirectoryCallbackI callback, @NativeType("void *") long userdata) {
if (CHECKS) {
checkNT1(path);
checkNT1Safe(path);
}
return nSDL_EnumerateStorageDirectory(storage, memAddress(path), callback.address(), userdata);
return nSDL_EnumerateStorageDirectory(storage, memAddressSafe(path), callback.address(), userdata);
}

/** {@code bool SDL_EnumerateStorageDirectory(SDL_Storage * storage, char const * path, SDL_EnumerateDirectoryCallback callback, void * userdata)} */
@NativeType("bool")
public static boolean SDL_EnumerateStorageDirectory(@NativeType("SDL_Storage *") long storage, @NativeType("char const *") CharSequence path, @NativeType("SDL_EnumerateDirectoryCallback") SDL_EnumerateDirectoryCallbackI callback, @NativeType("void *") long userdata) {
public static boolean SDL_EnumerateStorageDirectory(@NativeType("SDL_Storage *") long storage, @NativeType("char const *") @Nullable CharSequence path, @NativeType("SDL_EnumerateDirectoryCallback") SDL_EnumerateDirectoryCallbackI callback, @NativeType("void *") long userdata) {
MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
try {
stack.nUTF8(path, true);
long pathEncoded = stack.getPointerAddress();
stack.nUTF8Safe(path, true);
long pathEncoded = path == null ? NULL : stack.getPointerAddress();
return nSDL_EnumerateStorageDirectory(storage, pathEncoded, callback.address(), userdata);
} finally {
stack.setPointer(stackPointer);
Expand Down Expand Up @@ -515,15 +515,15 @@ public static long nSDL_GlobStorageDirectory(long storage, long path, long patte

/** {@code char ** SDL_GlobStorageDirectory(SDL_Storage * storage, char const * path, char const * pattern, SDL_GlobFlags flags, int * count)} */
@NativeType("char **")
public static @Nullable PointerBuffer SDL_GlobStorageDirectory(@NativeType("SDL_Storage *") long storage, @NativeType("char const *") ByteBuffer path, @NativeType("char const *") @Nullable ByteBuffer pattern, @NativeType("SDL_GlobFlags") int flags) {
public static @Nullable PointerBuffer SDL_GlobStorageDirectory(@NativeType("SDL_Storage *") long storage, @NativeType("char const *") @Nullable ByteBuffer path, @NativeType("char const *") @Nullable ByteBuffer pattern, @NativeType("SDL_GlobFlags") int flags) {
if (CHECKS) {
checkNT1(path);
checkNT1Safe(path);
checkNT1Safe(pattern);
}
MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
IntBuffer count = stack.callocInt(1);
try {
long __result = nSDL_GlobStorageDirectory(storage, memAddress(path), memAddressSafe(pattern), flags, memAddress(count));
long __result = nSDL_GlobStorageDirectory(storage, memAddressSafe(path), memAddressSafe(pattern), flags, memAddress(count));
return memPointerBufferSafe(__result, count.get(0));
} finally {
stack.setPointer(stackPointer);
Expand All @@ -532,12 +532,12 @@ public static long nSDL_GlobStorageDirectory(long storage, long path, long patte

/** {@code char ** SDL_GlobStorageDirectory(SDL_Storage * storage, char const * path, char const * pattern, SDL_GlobFlags flags, int * count)} */
@NativeType("char **")
public static @Nullable PointerBuffer SDL_GlobStorageDirectory(@NativeType("SDL_Storage *") long storage, @NativeType("char const *") CharSequence path, @NativeType("char const *") @Nullable CharSequence pattern, @NativeType("SDL_GlobFlags") int flags) {
public static @Nullable PointerBuffer SDL_GlobStorageDirectory(@NativeType("SDL_Storage *") long storage, @NativeType("char const *") @Nullable CharSequence path, @NativeType("char const *") @Nullable CharSequence pattern, @NativeType("SDL_GlobFlags") int flags) {
MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
try {
IntBuffer count = stack.callocInt(1);
stack.nUTF8(path, true);
long pathEncoded = stack.getPointerAddress();
stack.nUTF8Safe(path, true);
long pathEncoded = path == null ? NULL : stack.getPointerAddress();
stack.nUTF8Safe(pattern, true);
long patternEncoded = pattern == null ? NULL : stack.getPointerAddress();
long __result = nSDL_GlobStorageDirectory(storage, pathEncoded, patternEncoded, flags, memAddress(count));
Expand Down
11 changes: 10 additions & 1 deletion modules/lwjgl/sdl/src/generated/java/org/lwjgl/sdl/SDLTray.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ private Functions() {}
DestroyTray = apiGetFunctionAddress(SDL.getLibrary(), "SDL_DestroyTray"),
GetTrayEntryParent = apiGetFunctionAddress(SDL.getLibrary(), "SDL_GetTrayEntryParent"),
GetTrayMenuParentEntry = apiGetFunctionAddress(SDL.getLibrary(), "SDL_GetTrayMenuParentEntry"),
GetTrayMenuParentTray = apiGetFunctionAddress(SDL.getLibrary(), "SDL_GetTrayMenuParentTray");
GetTrayMenuParentTray = apiGetFunctionAddress(SDL.getLibrary(), "SDL_GetTrayMenuParentTray"),
UpdateTrays = apiGetFunctionAddress(SDL.getLibrary(), "SDL_UpdateTrays");

}

Expand Down Expand Up @@ -430,4 +431,12 @@ public static long SDL_GetTrayMenuParentTray(@NativeType("SDL_TrayMenu *") long
return invokePP(menu, __functionAddress);
}

// --- [ SDL_UpdateTrays ] ---

/** {@code void SDL_UpdateTrays(void)} */
public static void SDL_UpdateTrays() {
long __functionAddress = Functions.UpdateTrays;
invokeV(__functionAddress);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ private Functions() {}

public static final int SDL_MAJOR_VERSION = 3;

public static final int SDL_MINOR_VERSION = 1;
public static final int SDL_MINOR_VERSION = 2;

public static final int SDL_MICRO_VERSION = 10;
public static final int SDL_MICRO_VERSION = 0;

public static final int SDL_VERSION = SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_MICRO_VERSION);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ val SDL_hints = "SDLHints".nativeClassSDL("SDL_hints") {
"HINT_MAC_BACKGROUND_APP".."SDL_MAC_BACKGROUND_APP",
"HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK".."SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK",
"HINT_MAC_OPENGL_ASYNC_DISPATCH".."SDL_MAC_OPENGL_ASYNC_DISPATCH",
"HINT_MAC_OPTION_AS_ALT".."SDL_MAC_OPTION_AS_ALT",
"HINT_MAC_SCROLL_MOMENTUM".."SDL_MAC_SCROLL_MOMENTUM",
"HINT_MAIN_CALLBACK_RATE".."SDL_MAIN_CALLBACK_RATE",
"HINT_MOUSE_AUTO_CAPTURE".."SDL_MOUSE_AUTO_CAPTURE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ val SDL_storage = "SDLStorage".nativeClassSDL("SDL_storage") {
"EnumerateStorageDirectory",

SDL_Storage.p("storage"),
charUTF8.const.p("path"),
nullable..charUTF8.const.p("path"),
SDL_EnumerateDirectoryCallback("callback"),
nullable..opaque_p("userdata")
)
Expand Down Expand Up @@ -131,7 +131,7 @@ val SDL_storage = "SDLStorage".nativeClassSDL("SDL_storage") {
"GlobStorageDirectory",

SDL_Storage.p("storage"),
charUTF8.const.p("path"),
nullable..charUTF8.const.p("path"),
nullable..charUTF8.const.p("pattern"),
SDL_GlobFlags("flags"),
AutoSizeResult..int.p("count")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,10 @@ val SDL_tray = "SDLTray".nativeClassSDL("SDL_tray") {

SDL_TrayMenu.p("menu")
)

void(
"UpdateTrays",

void()
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import sdl.*

val SDL_version = "SDLVersion".nativeClassSDL("SDL_version") {
IntConstant("MAJOR_VERSION".."3")
IntConstant("MINOR_VERSION".."1")
IntConstant("MICRO_VERSION".."10")
IntConstant("MINOR_VERSION".."2")
IntConstant("MICRO_VERSION".."0")

int("GetVersion", void())
charASCII.const.p("GetRevision", void())
Expand Down

0 comments on commit b7fdb7c

Please sign in to comment.