Kemena3D
Loading...
Searching...
No Matches
kscriptmanager.h File Reference
module nullptr

AngelScript engine wrapper: script-asset registry, text/bytecode compilation, and per-object script instances. More...

#include "kexport.h"
#include <cassert>
#include <vector>
#include <map>
#include <cstdio>
#include <iostream>
#include <angelscript.h>
#include <scriptstdstring/scriptstdstring.h>
#include <scriptbuilder/scriptbuilder.h>
#include "kdatatype.h"
Include dependency graph for kscriptmanager.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  kemena::kScript
 Per-object script component descriptor. More...
struct  kemena::kScriptAsset
 A registered script asset: a compilable unit of script source. More...
struct  kemena::kScriptInstance
 A live, per-object compiled script module. More...
class  kemena::kFileByteStream
 Minimal file-backed asIBinaryStream for bytecode I/O. More...
class  kemena::kScriptManager
 Manages the AngelScript engine, a registry of script assets, and the live per-object script module instances. More...

Namespaces

namespace  kemena
 Top-level Kemena3D engine namespace.

Macros

#define FUNCTION   asFUNCTION

Enumerations

enum  kemena::kScriptSourceType { kemena::K_SCRIPT_TEXT = 0 , kemena::K_SCRIPT_NODEGRAPH = 1 }
 How a script asset's source is authored. More...
enum  kemena::kScriptEvent {
  kemena::K_SCRIPT_AWAKE = 0 , kemena::K_SCRIPT_START , kemena::K_SCRIPT_UPDATE , kemena::K_SCRIPT_FIXED_UPDATE ,
  kemena::K_SCRIPT_LATE_UPDATE , kemena::K_SCRIPT_ON_ENABLE , kemena::K_SCRIPT_ON_DISABLE , kemena::K_SCRIPT_ON_DESTROY ,
  kemena::K_SCRIPT_EVENT_COUNT
}
 Lifecycle events dispatched to every active script each frame. More...

Functions

KEMENA3D_API const char * kemena::kScriptEventDecl (kScriptEvent evt)
 AngelScript declaration string for each kScriptEvent (indexed by enum).

Detailed Description

AngelScript engine wrapper: script-asset registry, text/bytecode compilation, and per-object script instances.

A script asset is a UUID-keyed source file (a text .as file, or the .as text generated from a node graph). The manager can compile a script asset to AngelScript bytecode (SaveByteCode) and, at runtime, build a private asIScriptModule for each object that attaches the script — preferring the precompiled bytecode and falling back to the source text.

Each object gets its own module instance so that script-global variables are independent per object (the lifecycle-function script style used by the editor's sample.as template).

Macro Definition Documentation

◆ FUNCTION

#define FUNCTION   asFUNCTION