Toast Engine
Loading...
Searching...
No Matches
toast::Engine Class Referencefinal

Public Member Functions

 Engine (Engine &)=delete
 Engine (Engine &&)=delete
auto operator= (const Engine &) -> Engine &=delete
auto operator= (const Engine &&) -> Engine &=delete
void init ()
void tick ()
auto shouldClose () -> bool
void test ()
void reloadSettings ()
void createSDLWindow (const char *)
void createAvaloniaWindow ()
auto shootVoxel (const glm::vec3 &origin, const glm::vec3 &direction, float max_distance, float energy_density, float fracture_radius) -> bool
auto createWorkspace (std::string_view type) -> std::pair< UID, std::string >
auto openWorkspace (UID uid) -> std::pair< UID, std::string >
auto openWorkspace (UID uid, std::string_view source_uri) -> std::pair< UID, std::string >
 autosave recovery
auto playWorkspace (UID source_handle) -> std::pair< UID, std::string >
 Clones the given workspace's into a new ticking PlayWorkspace.
void destroyWorkspace (UID handle)
void requireTickThread (std::string_view what) const
auto onTickThread () const -> bool
 Before the first tick the thread that created the engine counts.
auto activeWorkspace () -> UID
void publishPrefab (UID uid, const assets::Prefab &prefab)
void refreshNodeInfos ()
 Re-resolves NodeInfo after a project reload.
auto getViewportFrame (void *dst, uint32_t dst_capacity, renderer::ViewportFrameDesc *out) -> int
 Copies the latest viewport frame into dst.
auto viewportTarget () -> renderer::SharedTextureOutputTarget *
 Editor viewport.
void beginApplication ()
 Calls begin() on the currently registered application layer (if any).
void popApplication ()
 Destroys the active application layer and nulls the pointer.
void startGame ()
 Creates the World, then loads and activates the init_scene from project settings.

Static Public Member Functions

static auto get () noexcept -> Engine *

Member Function Documentation

◆ getViewportFrame()

auto toast::Engine::getViewportFrame ( void * dst,
uint32_t dst_capacity,
renderer::ViewportFrameDesc * out ) -> int

Copies the latest viewport frame into dst.

Returns
1 copied, 0 none available, -1 destination too small
Here is the caller graph for this function:

◆ startGame()

void toast::Engine::startGame ( )

Creates the World, then loads and activates the init_scene from project settings.

Note
Must be called after toast_init() and toast_create_*_window()
Here is the caller graph for this function:

The documentation for this class was generated from the following files:
  • engine/src/toast/engine.hpp
  • engine/src/toast/engine.cpp