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()
|
protected override void Render()
|
||||||
{
|
{
|
||||||
PlatformLayer.EditorRenderBegin();
|
PlatformLayer.ImGuiRenderBegin();
|
||||||
UI();
|
UI();
|
||||||
PlatformLayer.EditorRenderEnd();
|
PlatformLayer.ImGuiRenderEnd();
|
||||||
PlatformLayer.RenderEnd();
|
PlatformLayer.RenderEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,9 +99,9 @@ namespace Strawberry
|
||||||
|
|
||||||
if (DebugOverlay)
|
if (DebugOverlay)
|
||||||
{
|
{
|
||||||
PlatformLayer.EditorRenderBegin();
|
PlatformLayer.ImGuiRenderBegin();
|
||||||
DebugOverlay();
|
DebugOverlay();
|
||||||
PlatformLayer.EditorRenderEnd();
|
PlatformLayer.ImGuiRenderEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
PlatformLayer.RenderEnd();
|
PlatformLayer.RenderEnd();
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace Strawberry
|
||||||
PlatformLayer = platformLayer;
|
PlatformLayer = platformLayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Module Run()
|
private Module Run()
|
||||||
{
|
{
|
||||||
Time.RawPreviousElapsed = 0;
|
Time.RawPreviousElapsed = 0;
|
||||||
Time.RawElapsed = 0;
|
Time.RawElapsed = 0;
|
||||||
|
@ -22,6 +22,8 @@ namespace Strawberry
|
||||||
Time.Elapsed = 0;
|
Time.Elapsed = 0;
|
||||||
Time.Freeze = 0;
|
Time.Freeze = 0;
|
||||||
|
|
||||||
|
Started();
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
let tick = PlatformLayer.Ticks;
|
let tick = PlatformLayer.Ticks;
|
||||||
|
|
|
@ -28,10 +28,10 @@ namespace Strawberry
|
||||||
public abstract bool Closed(); // Returns whether the game window has been closed
|
public abstract bool Closed(); // Returns whether the game window has been closed
|
||||||
|
|
||||||
//Rendering
|
//Rendering
|
||||||
public abstract void EditorRenderBegin();
|
|
||||||
public abstract void EditorRenderEnd();
|
|
||||||
public abstract void GameRenderBegin();
|
public abstract void GameRenderBegin();
|
||||||
public abstract void GameRenderEnd();
|
public abstract void GameRenderEnd();
|
||||||
|
public abstract void ImGuiRenderBegin();
|
||||||
|
public abstract void ImGuiRenderEnd();
|
||||||
public abstract void RenderEnd();
|
public abstract void RenderEnd();
|
||||||
|
|
||||||
//Update
|
//Update
|
||||||
|
|
|
@ -171,14 +171,14 @@ namespace Strawberry.SDL2
|
||||||
|
|
||||||
public override uint32 Ticks => SDL.GetTicks();
|
public override uint32 Ticks => SDL.GetTicks();
|
||||||
|
|
||||||
public override void EditorRenderBegin()
|
public override void ImGuiRenderBegin()
|
||||||
{
|
{
|
||||||
ImGuiImplOpenGL3.NewFrame();
|
ImGuiImplOpenGL3.NewFrame();
|
||||||
ImGuiImplSDL2.NewFrame(window);
|
ImGuiImplSDL2.NewFrame(window);
|
||||||
ImGui.NewFrame();
|
ImGui.NewFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void EditorRenderEnd()
|
public override void ImGuiRenderEnd()
|
||||||
{
|
{
|
||||||
ImGui.Render();
|
ImGui.Render();
|
||||||
ImGuiImplOpenGL3.RenderDrawData(ImGui.ImGui.GetDrawData());
|
ImGuiImplOpenGL3.RenderDrawData(ImGui.ImGui.GetDrawData());
|
||||||
|
|
|
@ -7,23 +7,12 @@ namespace Strawberry
|
||||||
{
|
{
|
||||||
Startup();
|
Startup();
|
||||||
|
|
||||||
Module current = module;
|
Module currentModule = module;
|
||||||
current.[Friend]Started();
|
while (currentModule != null)
|
||||||
while (true)
|
|
||||||
{
|
{
|
||||||
let newModule = current.Run();
|
let newModule = currentModule.[Friend]Run();
|
||||||
|
delete currentModule;
|
||||||
if (newModule != null)
|
currentModule = newModule;
|
||||||
{
|
|
||||||
delete current;
|
|
||||||
current = newModule;
|
|
||||||
current.[Friend]Started();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
delete current;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Shutdown();
|
Shutdown();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user