Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions libs/sdl/sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,10 @@ HL_PRIM const char *HL_NAME(detect_keyboard_layout)() {
return "unknown";
}

HL_PRIM const char *HL_NAME(get_pref_path)(const char *org, const char *app) {
return SDL_GetPrefPath(org, app);
}

DEFINE_PRIM(_BOOL, init_once, _NO_ARG);
DEFINE_PRIM(_VOID, gl_options, _I32 _I32 _I32 _I32 _I32 _I32);
DEFINE_PRIM(_BOOL, event_loop, _DYN );
Expand All @@ -419,6 +423,7 @@ DEFINE_PRIM(_VOID, text_input, _BOOL);
DEFINE_PRIM(_I32, set_relative_mouse_mode, _BOOL);
DEFINE_PRIM(_BYTES, detect_keyboard_layout, _NO_ARG);
DEFINE_PRIM(_BOOL, hint_value, _BYTES _BYTES);
DEFINE_PRIM(_BYTES, get_pref_path, _BYTES _BYTES);

// Window

Expand Down
8 changes: 8 additions & 0 deletions libs/sdl/sdl/Sdl.hx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ class Sdl {
else
return @:privateAccess String.fromUTF8(t);
}

static function get_pref_path(org: hl.Bytes, app: hl.Bytes) : hl.Bytes {
return null;
}

public static function getPrefPath(org: String, app: String) {
return @:privateAccess String.fromUTF8(get_pref_path(org.toUtf8(), app.toUtf8()));
}
}

@:enum
Expand Down