|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
#include <EstellaContext.hpp>
Public Member Functions | |
| EstellaContext () | |
| ~EstellaContext () | |
| EstellaContext (const EstellaContext &)=delete | |
| EstellaContext & | operator= (const EstellaContext &)=delete |
| bool | init (int webglContextHandle) |
| Initialize with an existing WebGL context handle. | |
| bool | init (int webglContextHandle, bool ownsContext) |
| bool | init (Unique< GfxDevice > device) |
| Initialize with an injected render backend. | |
| void | shutdown () |
| Shut down all subsystems and release resources. | |
| bool | isInitialized () const |
| Check if the context is initialized. | |
| RenderThread & | renderThread () |
| ServiceRegistry & | services () |
| template<typename T> | |
| T & | require () |
| template<typename T> | |
| T * | tryGet () |
| EngineState & | state () |
| const EngineState & | state () const |
Definition at line 24 of file EstellaContext.hpp.
| esengine::EstellaContext::EstellaContext | ( | ) |
Definition at line 54 of file EstellaContext.cpp.
Referenced by EstellaContext(), and operator=().
| esengine::EstellaContext::~EstellaContext | ( | ) |
Definition at line 92 of file EstellaContext.cpp.
References shutdown().
|
delete |
References EstellaContext().
| bool esengine::EstellaContext::init | ( | int | webglContextHandle | ) |
Initialize with an existing WebGL context handle.
| webglContextHandle | Valid WebGL context (from emscripten_webgl_create_context) |
Convenience for the GL backend: makes the context current and delegates to init(UniquePtr<GfxDevice>) with a GLDevice. Borrows the handle; its owner must keep it registered until shutdown.
Referenced by EMSCRIPTEN_BINDINGS().
| bool esengine::EstellaContext::init | ( | int | webglContextHandle, |
| bool | ownsContext ) |
Adopt a WebGL handle only when its creator explicitly transfers ownership.
Initialize with an injected render backend.
| device | A ready-to-use GfxDevice (e.g. a WebGPUDevice whose surface is already configured). The platform edge owns backend selection — exactly as the WebGL overload receives an externally created context handle — so this class needs no backend-specific code. |
Definition at line 126 of file EstellaContext.cpp.
References ES_LOG_ERROR, and ES_LOG_WARN.
|
inline |
Check if the context is initialized.
Definition at line 61 of file EstellaContext.hpp.
Referenced by EMSCRIPTEN_BINDINGS().
|
delete |
References EstellaContext().
|
inline |
Definition at line 63 of file EstellaContext.hpp.
Referenced by esengine::initRendererWebGPU(), esengine::renderThread_complete(), esengine::renderThread_enabled(), esengine::renderThread_fence(), esengine::renderThread_flush(), esengine::renderThread_resizeSurface(), and esengine::startRenderThread().
|
inline |
Definition at line 68 of file EstellaContext.hpp.
Referenced by esengine::uiHitTest_getHitEntity(), esengine::uiHitTest_inputsChanged(), esengine::uiHitTest_pick(), esengine::uiHitTest_pickAll(), esengine::uiHitTest_pickResult(), esengine::uiHitTest_update(), esengine::uiHitTest_updateDomains(), and esengine::uiLayout_update().
|
inline |
Definition at line 65 of file EstellaContext.hpp.
Referenced by esengine::renderer_renderMaterialPreview(), esengine::renderer_renderMeshPreview(), and esengine::transform_update().
| void esengine::EstellaContext::shutdown | ( | ) |
Shut down all subsystems and release resources.
Definition at line 246 of file EstellaContext.cpp.
References ES_LOG_INFO, shutdown(), and tryGet().
Referenced by ~EstellaContext(), EMSCRIPTEN_BINDINGS(), and shutdown().
|
inline |
Definition at line 73 of file EstellaContext.hpp.
Referenced by esengine::draw_begin(), esengine::draw_deferEnd(), esengine::draw_end(), esengine::gl_checkErrors(), esengine::gl_enableErrorCheck(), esengine::renderer_init(), esengine::renderer_resize(), and esengine::renderer_setClearColor().
|
inline |
Definition at line 74 of file EstellaContext.hpp.
|
inline |
Definition at line 71 of file EstellaContext.hpp.
Referenced by esengine::anim_createTween(), EMSCRIPTEN_BINDINGS(), esengine::engine_prepareMeshPrograms(), esengine::environment_create(), esengine::environment_setSky(), esengine::environment_setSun(), esengine::mesh_createFromChannels(), esengine::mesh_rematerializeFromChannels(), esengine::mesh_setClusters(), esengine::mesh_setSkinChunks(), esengine::probe_volume_create(), esengine::probe_volume_createBricks(), esengine::probe_volume_getBricks(), esengine::probe_volume_getResolution(), esengine::probe_volume_setSkyVisibility(), esengine::renderer_getProbeAtlasBytes(), esengine::renderer_getProbeDraws(), esengine::renderer_renderMaterialPreview(), esengine::renderer_renderMeshPreview(), esengine::renderer_retainedTextStale(), esengine::screenDomain(), shutdown(), and esengine::ui_isScreenDomain().