16struct ImGuiPluginContext;
59 lua_State* (*GetLua)();
82 const char* (*Lua_tostring)(lua_State* L,
int idx);
83 void* (*Lua_touserdata)(lua_State* L,
int idx);
93 void* (*Lua_newuserdata)(lua_State* L,
size_t sz);
113 void* (*LuaL_checkudata)(lua_State* L,
int ud,
const char* tname);
116 const char* (*LuaL_checkstring)(lua_State* L,
int arg);
231 Asset* (*LoadAsset)(
const char* name);
238 Asset* (*FetchAsset)(
const char* name);
259 int32_t* outTokens, int32_t maxTokens);
271 char* outStr, int32_t maxLen);
309 uint32_t (*
Audio_OpenStream)(uint32_t sampleRate, uint32_t numChannels, uint32_t bitsPerSample);
464 void (*
Gizmos_DrawRay)(
float ox,
float oy,
float oz,
float dx,
float dy,
float dz);
Engine API provided to plugins during OnLoad.
Definition PolyphaseEngineAPI.h:32
void(* LuaL_setfuncs)(lua_State *L, const void *l, int nup)
Definition PolyphaseEngineAPI.h:117
void(* Node3D_SetScale)(Node3D *node, float x, float y, float z)
Set the local scale of a Node3D.
Definition PolyphaseEngineAPI.h:222
void(* Lua_pushnil)(lua_State *L)
Definition PolyphaseEngineAPI.h:86
void(* Lua_pushstring)(lua_State *L, const char *s)
Definition PolyphaseEngineAPI.h:89
uint32_t(* Audio_OpenStream)(uint32_t sampleRate, uint32_t numChannels, uint32_t bitsPerSample)
Definition PolyphaseEngineAPI.h:309
void(* Node3D_AddRotation)(Node3D *node, float x, float y, float z)
Add rotation to a Node3D in euler angles (degrees).
Definition PolyphaseEngineAPI.h:186
void(* Gizmos_DrawRay)(float ox, float oy, float oz, float dx, float dy, float dz)
Draw a ray gizmo (from origin along direction).
Definition PolyphaseEngineAPI.h:464
void(* Node3D_SetPosition)(Node3D *node, float x, float y, float z)
Set the local position of a Node3D.
Definition PolyphaseEngineAPI.h:204
void(* Node3D_GetRotation)(Node3D *node, float *outX, float *outY, float *outZ)
Get the local rotation of a Node3D in euler angles (degrees).
Definition PolyphaseEngineAPI.h:168
int32_t(* Audio_SubmitStreamBuffer)(uint32_t streamId, const uint8_t *data, uint32_t byteSize)
Definition PolyphaseEngineAPI.h:311
int(* Lua_isfunction)(lua_State *L, int idx)
Definition PolyphaseEngineAPI.h:74
void(* Lua_setfield)(lua_State *L, int idx, const char *k)
Definition PolyphaseEngineAPI.h:97
int(* Lua_getmetatable)(lua_State *L, int objindex)
Definition PolyphaseEngineAPI.h:108
void(* Gizmos_DrawWireSphere)(float cx, float cy, float cz, float radius)
Draw a wireframe sphere gizmo.
Definition PolyphaseEngineAPI.h:442
void(* Lua_rawget)(lua_State *L, int idx)
Definition PolyphaseEngineAPI.h:102
bool(* IsMouseButtonJustPressed)(int32_t button)
Check if a mouse button was just pressed this frame.
Definition PolyphaseEngineAPI.h:356
void(* Lua_pop)(lua_State *L, int n)
Definition PolyphaseEngineAPI.h:69
void(* Lua_settable)(lua_State *L, int idx)
Definition PolyphaseEngineAPI.h:103
void(* Node3D_GetPosition)(Node3D *node, float *outX, float *outY, float *outZ)
Get the local position of a Node3D.
Definition PolyphaseEngineAPI.h:195
double(* Lua_tonumber)(lua_State *L, int idx)
Definition PolyphaseEngineAPI.h:81
void(* Lua_gettable)(lua_State *L, int idx)
Definition PolyphaseEngineAPI.h:104
int(* Lua_toboolean)(lua_State *L, int idx)
Definition PolyphaseEngineAPI.h:80
void(* Lua_rawset)(lua_State *L, int idx)
Definition PolyphaseEngineAPI.h:101
void(* PlaySound2D)(SoundWave *sound, float volume, float pitch)
Play a 2D sound (non-positional).
Definition PolyphaseEngineAPI.h:281
void(* Audio_SetStreamVolume)(uint32_t streamId, float volume)
Definition PolyphaseEngineAPI.h:313
float(* GetDeltaTime)()
Get the time elapsed since last frame (in seconds).
Definition PolyphaseEngineAPI.h:384
void(* Node3D_GetScale)(Node3D *node, float *outX, float *outY, float *outZ)
Get the local scale of a Node3D.
Definition PolyphaseEngineAPI.h:213
int32_t(* GetNumWorlds)()
Get the number of active worlds.
Definition PolyphaseEngineAPI.h:133
int(* Lua_istable)(lua_State *L, int idx)
Definition PolyphaseEngineAPI.h:75
void(* Audio_FlushStream)(uint32_t streamId)
Definition PolyphaseEngineAPI.h:319
uint64_t(* Audio_GetStreamPlayedSamples)(uint32_t streamId)
Definition PolyphaseEngineAPI.h:312
int(* Lua_setmetatable)(lua_State *L, int objindex)
Definition PolyphaseEngineAPI.h:107
void(* GetMousePosition)(int32_t *x, int32_t *y)
Get the current mouse position.
Definition PolyphaseEngineAPI.h:363
void(* LogError)(const char *fmt,...)
Log an error message.
Definition PolyphaseEngineAPI.h:51
void(* Gizmos_ResetState)()
Reset gizmo state to default (white color, identity matrix).
Definition PolyphaseEngineAPI.h:412
long long(* LuaL_checkinteger)(lua_State *L, int arg)
Definition PolyphaseEngineAPI.h:115
void(* Lua_pushnumber)(lua_State *L, double n)
Definition PolyphaseEngineAPI.h:88
void(* UnloadAsset)(const char *name)
Unload an asset by name.
Definition PolyphaseEngineAPI.h:244
void(* DestroyNode)(Node *node)
Destroy a node.
Definition PolyphaseEngineAPI.h:149
int(* Lua_gettop)(lua_State *L)
Definition PolyphaseEngineAPI.h:70
void(* Gizmos_DrawCube)(float cx, float cy, float cz, float sx, float sy, float sz)
Draw a solid cube gizmo.
Definition PolyphaseEngineAPI.h:423
void(* GetImGuiContext)(ImGuiPluginContext *outCtx)
Get ImGui context for plugin use (Editor builds only).
Definition PolyphaseEngineAPI.h:484
void(* LuaL_getmetatable)(lua_State *L, const char *tname)
Definition PolyphaseEngineAPI.h:118
int(* Lua_isnil)(lua_State *L, int idx)
Definition PolyphaseEngineAPI.h:77
void(* Gizmos_DrawLine)(float x0, float y0, float z0, float x1, float y1, float z1)
Draw a line gizmo.
Definition PolyphaseEngineAPI.h:453
float(* GetElapsedTime)()
Get the total time elapsed since engine start (in seconds).
Definition PolyphaseEngineAPI.h:390
void(* Audio_SetStreamPaused)(uint32_t streamId, bool paused)
Definition PolyphaseEngineAPI.h:314
void(* LogDebug)(const char *fmt,...)
Log a debug message.
Definition PolyphaseEngineAPI.h:39
void(* StopAllSounds)()
Stop all currently playing sounds.
Definition PolyphaseEngineAPI.h:286
EditorUIHooks * editorUI
Pointer to editor UI hooks struct.
Definition PolyphaseEngineAPI.h:474
bool(* IsKeyDown)(int32_t key)
Check if a key is currently held down.
Definition PolyphaseEngineAPI.h:328
void(* Node3D_SetRotation)(Node3D *node, float x, float y, float z)
Set the local rotation of a Node3D in euler angles (degrees).
Definition PolyphaseEngineAPI.h:177
int(* Lua_type)(lua_State *L, int idx)
Definition PolyphaseEngineAPI.h:73
bool(* IsKeyJustPressed)(int32_t key)
Check if a key was just pressed this frame.
Definition PolyphaseEngineAPI.h:335
float(* GetMasterVolume)()
Get the master audio volume.
Definition PolyphaseEngineAPI.h:298
void(* Lua_pushboolean)(lua_State *L, int b)
Definition PolyphaseEngineAPI.h:87
void(* Lua_setglobal)(lua_State *L, const char *name)
Definition PolyphaseEngineAPI.h:99
bool(* IsKeyJustReleased)(int32_t key)
Check if a key was just released this frame.
Definition PolyphaseEngineAPI.h:342
void(* LogWarning)(const char *fmt,...)
Log a warning message.
Definition PolyphaseEngineAPI.h:45
void(* LuaL_setmetatable)(lua_State *L, const char *tname)
Definition PolyphaseEngineAPI.h:112
void(* SetMasterVolume)(float volume)
Set the master audio volume.
Definition PolyphaseEngineAPI.h:292
double(* LuaL_checknumber)(lua_State *L, int arg)
Definition PolyphaseEngineAPI.h:114
void(* Gizmos_SetMatrix)(const float *matrix16)
Set the gizmo transformation matrix (column-major, 16 floats).
Definition PolyphaseEngineAPI.h:407
int32_t(* GetScrollWheelDelta)()
Get the scroll wheel delta.
Definition PolyphaseEngineAPI.h:376
void(* Lua_settop)(lua_State *L, int idx)
Definition PolyphaseEngineAPI.h:67
void(* Lua_getglobal)(lua_State *L, const char *name)
Definition PolyphaseEngineAPI.h:100
void(* Lua_pushvalue)(lua_State *L, int idx)
Definition PolyphaseEngineAPI.h:68
int(* LuaL_newmetatable)(lua_State *L, const char *tname)
Definition PolyphaseEngineAPI.h:111
void(* GetMouseDelta)(int32_t *deltaX, int32_t *deltaY)
Get the mouse movement since last frame.
Definition PolyphaseEngineAPI.h:370
int(* Lua_isuserdata)(lua_State *L, int idx)
Definition PolyphaseEngineAPI.h:76
void(* Lua_getfield)(lua_State *L, int idx, const char *k)
Definition PolyphaseEngineAPI.h:98
void(* Audio_CloseStream)(uint32_t streamId)
Definition PolyphaseEngineAPI.h:310
void(* Lua_pushinteger)(lua_State *L, long long n)
Definition PolyphaseEngineAPI.h:90
void(* Gizmos_SetColor)(float r, float g, float b, float a)
Set the gizmo drawing color.
Definition PolyphaseEngineAPI.h:401
void(* Gizmos_DrawSphere)(float cx, float cy, float cz, float radius)
Draw a solid sphere gizmo.
Definition PolyphaseEngineAPI.h:437
int32_t(* TinyLLM_Encode)(Asset *model, const char *text, bool addBos, bool addEos, int32_t *outTokens, int32_t maxTokens)
Encode text to tokens using a TinyLLMAsset's tokenizer.
Definition PolyphaseEngineAPI.h:258
int32_t(* TinyLLM_Decode)(Asset *model, int32_t prevToken, int32_t token, char *outStr, int32_t maxLen)
Decode a token to string using a TinyLLMAsset's tokenizer.
Definition PolyphaseEngineAPI.h:270
bool(* IsMouseButtonDown)(int32_t button)
Check if a mouse button is currently held down.
Definition PolyphaseEngineAPI.h:349
void(* Lua_createtable)(lua_State *L, int narr, int nrec)
Definition PolyphaseEngineAPI.h:96
void(* Gizmos_DrawWireCube)(float cx, float cy, float cz, float sx, float sy, float sz)
Draw a wireframe cube gizmo.
Definition PolyphaseEngineAPI.h:428