◆ AddReplaceWorld()
| void App::AddReplaceWorld |
( |
Ref< World > |
oldWorld, |
|
|
Ref< World > |
newWorld |
|
) |
| |
Replace a loaded world with a different world, transferring render state if necessary
- Parameters
-
| oldWorld | the world to replace |
| newWorld | the world to replace with. Cannot be already loaded. |
◆ AddWorld()
| void App::AddWorld |
( |
Ref< World > |
world | ) |
|
Add a world to be ticked
- Parameters
-
◆ CurrentTPS()
| float App::CurrentTPS |
( |
| ) |
|
- Returns
- the current application tick rate
◆ DispatchMainThread()
Dispatch a task to be executed on the main thread.
@param f the block to execute
@note To pass parameters, do not reference! Instead, you must explicitly copy the values you want to pass:
@code
int x = 5; int y = 6; RavEngine::GetApp()->DispatchMainThread([=]{ std::cout << x << y << std::endl; });
◆ GetCurrentTime()
| double RavEngine::App::GetCurrentTime |
( |
| ) |
|
|
inline |
- Returns
- the current time, measured in seconds since the application launched
◆ OnDropAudioWorklets()
| void App::OnDropAudioWorklets |
( |
uint32_t |
ndropped | ) |
|
|
virtual |
Override to be notified if too much audio work was submitted. The default implementation logs a warning.
◆ OnFatal()
| virtual void RavEngine::App::OnFatal |
( |
const std::string_view |
msg | ) |
|
|
inlinevirtual |
Override this method to provide a custom fatal handler
◆ OnShutdown()
| virtual int RavEngine::App::OnShutdown |
( |
| ) |
|
|
inlineprotectedvirtual |
Invoked before destructor when the application is expected to shut down. You can return exit codes from here.
◆ OnStartup()
| virtual void RavEngine::App::OnStartup |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
|
inlineprotectedvirtual |
The startup hook.
- Parameters
-
| argc | the number of command line arguments |
| argv | the command line arguments |
◆ Quit()
Signal to gracefully shut down the application
◆ RemoveAllWorlds()
| void App::RemoveAllWorlds |
( |
| ) |
|
◆ RemoveWorld()
| void App::RemoveWorld |
( |
Ref< World > |
world | ) |
|
Remove a world from the tick list
- Parameters
-
◆ run()
| int App::run |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Invoked automatically. Passes command line arguments.
◆ SetRenderedWorld()
| void App::SetRenderedWorld |
( |
Ref< World > |
newWorld | ) |
|
Set the current world to tick automatically
- Parameters
-
◆ SetWindowTitle()
| void App::SetWindowTitle |
( |
const char * |
title | ) |
|
Set the window titlebar text
- Parameters
-
| title | the text for the titlebar |
- Note
- Do not call this every frame. To update periodically with data such as frame rates, use a scheduled system.
◆ executor
| tf::Executor RavEngine::App::executor |
Initial value:{
std::max<size_t>(std::thread::hardware_concurrency() - 2, 2)
}
The documentation for this class was generated from the following files: