mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2024-11-25 16:18:56 +08:00
More Module setup
This commit is contained in:
parent
bb7e3de917
commit
bc2dfc73ce
|
@ -15,9 +15,9 @@ namespace Strawberry
|
|||
|
||||
protected override void Render()
|
||||
{
|
||||
PlatformLayer.EditorRenderBegin();
|
||||
PlatformLayer.ImGuiRenderBegin();
|
||||
UI();
|
||||
PlatformLayer.EditorRenderEnd();
|
||||
PlatformLayer.ImGuiRenderEnd();
|
||||
PlatformLayer.RenderEnd();
|
||||
}
|
||||
|
||||
|
|
|
@ -99,9 +99,9 @@ namespace Strawberry
|
|||
|
||||
if (DebugOverlay)
|
||||
{
|
||||
PlatformLayer.EditorRenderBegin();
|
||||
PlatformLayer.ImGuiRenderBegin();
|
||||
DebugOverlay();
|
||||
PlatformLayer.EditorRenderEnd();
|
||||
PlatformLayer.ImGuiRenderEnd();
|
||||
}
|
||||
|
||||
PlatformLayer.RenderEnd();
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Strawberry
|
|||
PlatformLayer = platformLayer;
|
||||
}
|
||||
|
||||
public Module Run()
|
||||
private Module Run()
|
||||
{
|
||||
Time.RawPreviousElapsed = 0;
|
||||
Time.RawElapsed = 0;
|
||||
|
@ -22,6 +22,8 @@ namespace Strawberry
|
|||
Time.Elapsed = 0;
|
||||
Time.Freeze = 0;
|
||||
|
||||
Started();
|
||||
|
||||
while (true)
|
||||
{
|
||||
let tick = PlatformLayer.Ticks;
|
||||
|
|
|
@ -28,10 +28,10 @@ namespace Strawberry
|
|||
public abstract bool Closed(); // Returns whether the game window has been closed
|
||||
|
||||
//Rendering
|
||||
public abstract void EditorRenderBegin();
|
||||
public abstract void EditorRenderEnd();
|
||||
public abstract void GameRenderBegin();
|
||||
public abstract void GameRenderEnd();
|
||||
public abstract void ImGuiRenderBegin();
|
||||
public abstract void ImGuiRenderEnd();
|
||||
public abstract void RenderEnd();
|
||||
|
||||
//Update
|
||||
|
|
|
@ -171,14 +171,14 @@ namespace Strawberry.SDL2
|
|||
|
||||
public override uint32 Ticks => SDL.GetTicks();
|
||||
|
||||
public override void EditorRenderBegin()
|
||||
public override void ImGuiRenderBegin()
|
||||
{
|
||||
ImGuiImplOpenGL3.NewFrame();
|
||||
ImGuiImplSDL2.NewFrame(window);
|
||||
ImGui.NewFrame();
|
||||
}
|
||||
|
||||
public override void EditorRenderEnd()
|
||||
public override void ImGuiRenderEnd()
|
||||
{
|
||||
ImGui.Render();
|
||||
ImGuiImplOpenGL3.RenderDrawData(ImGui.ImGui.GetDrawData());
|
||||
|
|
|
@ -7,23 +7,12 @@ namespace Strawberry
|
|||
{
|
||||
Startup();
|
||||
|
||||
Module current = module;
|
||||
current.[Friend]Started();
|
||||
while (true)
|
||||
Module currentModule = module;
|
||||
while (currentModule != null)
|
||||
{
|
||||
let newModule = current.Run();
|
||||
|
||||
if (newModule != null)
|
||||
{
|
||||
delete current;
|
||||
current = newModule;
|
||||
current.[Friend]Started();
|
||||
}
|
||||
else
|
||||
{
|
||||
delete current;
|
||||
break;
|
||||
}
|
||||
let newModule = currentModule.[Friend]Run();
|
||||
delete currentModule;
|
||||
currentModule = newModule;
|
||||
}
|
||||
|
||||
Shutdown();
|
||||
|
|
Loading…
Reference in New Issue
Block a user