mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
This adds a mechanism for running generic operations at specific points of the frame execution. This can be used by any part of the code an not just Lua since it simply executes std::functions. It also adds an "execution context" concept that specifies in which situation an operation should be executed. This is then used by the Lua Coroutines code for resuming coroutines at specific points instead of always when the awaited promise resolves.
19 lines
381 B
C++
19 lines
381 B
C++
#pragma once
|
|
|
|
#include "Executor.h"
|
|
|
|
namespace executor
|
|
{
|
|
|
|
/**
|
|
* @brief Executor that will be called at the end of every simulation frame.
|
|
*/
|
|
extern const std::shared_ptr<Executor> OnSimulationExecutor;
|
|
|
|
/**
|
|
* @brief Executor that will be called just before the game triggers the presentation of the current frame.
|
|
*/
|
|
extern const std::shared_ptr<Executor> OnFrameExecutor;
|
|
|
|
}
|