add steam module

This commit is contained in:
2025-05-24 21:29:58 -05:00
parent 01eff40690
commit e929f43a96
6 changed files with 793 additions and 0 deletions

View File

@@ -48,6 +48,9 @@
#include "qjs_spline.h"
#include "qjs_js.h"
#include "qjs_debug.h"
#ifndef NSTEAM
#include "qjs_steam.h"
#endif
SDL_Window *global_window;
@@ -1041,6 +1044,9 @@ JS_FreeValue(js,v); \
} \
JSC_CCALL(os_engine_start,
if (!SDL_Init(SDL_INIT_VIDEO))
return JS_ThrowInternalError(js, "Unable to initialize video subsystem: %s", SDL_GetError());
if (SDL_GetCurrentThreadID() != main_thread)
return JS_ThrowInternalError(js, "This can only be called from the root actor.");
@@ -2870,6 +2876,10 @@ void ffi_load(JSContext *js)
arrput(rt->module_registry, MISTLINE(tracy));
#endif
#ifndef NSTEAM
arrput(rt->module_registry, MISTLINE(steam));
#endif
JSValue globalThis = JS_GetGlobalObject(js);
JSValue prosp = JS_NewObject(js);