mirror of https://github.com/auygun/kaliber.git
Consume input events when switching between renderers
This commit is contained in:
parent
1d1452d4aa
commit
5c6e414a15
|
@ -201,6 +201,7 @@ bool Menu::Initialize() {
|
|||
: RendererType::kOpenGL);
|
||||
renderer_type_.SetEnabled(
|
||||
(Engine::Get().GetRendererType() == RendererType::kVulkan));
|
||||
Engine::Get().ConsumeInputEvents();
|
||||
},
|
||||
true, Engine::Get().GetRendererType() == RendererType::kVulkan,
|
||||
kColorFadeOut, {Vector4f{1, 1, 1, 1}, Vector4f{1, 1, 1, 1}});
|
||||
|
|
|
@ -396,6 +396,10 @@ std::unique_ptr<InputEvent> Engine::GetNextInputEvent() {
|
|||
return event;
|
||||
}
|
||||
|
||||
void Engine::ConsumeInputEvents() {
|
||||
input_queue_.clear();
|
||||
}
|
||||
|
||||
void Engine::StartRecording(const Json::Value& payload) {
|
||||
if (!replaying_ && !recording_) {
|
||||
recording_ = true;
|
||||
|
|
|
@ -84,6 +84,7 @@ class Engine : public PlatformObserver {
|
|||
void RemoveCustomShader(const std::string& asset_name);
|
||||
|
||||
std::unique_ptr<InputEvent> GetNextInputEvent();
|
||||
void ConsumeInputEvents();
|
||||
|
||||
void StartRecording(const Json::Value& payload);
|
||||
void EndRecording(const std::string file_name);
|
||||
|
|
Loading…
Reference in New Issue