mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Added single stepping
This commit is contained in:
@@ -67,24 +67,49 @@ namespace GlitchyEngine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if APP_SINGLESTEP
|
||||||
|
bool allowFrame = false;
|
||||||
|
bool disableSingleFrame = false;
|
||||||
|
#else
|
||||||
|
const bool allowFrame = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
public void Run()
|
public void Run()
|
||||||
{
|
{
|
||||||
while(_running)
|
while(_running)
|
||||||
|
{
|
||||||
|
if(allowFrame)
|
||||||
{
|
{
|
||||||
_gameTime.NewFrame();
|
_gameTime.NewFrame();
|
||||||
|
}
|
||||||
|
|
||||||
Input.NewFrame();
|
Input.NewFrame();
|
||||||
|
|
||||||
|
#if APP_SINGLESTEP
|
||||||
|
allowFrame = disableSingleFrame || Input.IsKeyPressing(Key.F10);
|
||||||
|
|
||||||
|
if(Input.IsKeyPressing(Key.F11))
|
||||||
|
{
|
||||||
|
disableSingleFrame = !disableSingleFrame;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(allowFrame)
|
||||||
|
{
|
||||||
for(Layer layer in _layerStack)
|
for(Layer layer in _layerStack)
|
||||||
layer.Update(_gameTime);
|
layer.Update(_gameTime);
|
||||||
|
}
|
||||||
|
|
||||||
_window.Update();
|
_window.Update();
|
||||||
|
|
||||||
|
if(allowFrame)
|
||||||
|
{
|
||||||
_imGuiLayer.ImGuiRender();
|
_imGuiLayer.ImGuiRender();
|
||||||
|
|
||||||
_window.Context.SwapChain.Present();
|
_window.Context.SwapChain.Present();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void PushLayer(Layer ownLayer) => _layerStack.PushLayer(ownLayer);
|
public void PushLayer(Layer ownLayer) => _layerStack.PushLayer(ownLayer);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user