Godot.GodotInstance
Controls the running Godot instance returned by twodog.Engine.Start().
public class GodotInstance : IDisposablePackage: 2dog.engine
Namespace: Godot
This class is one of the few differences from stock Godot, where it's not exposed.
Create this object through twodog.Engine.Start() rather than its low-level static factory methods.
Methods
Iteration
public bool Iteration()Processes one main-loop frame. Returns true when Godot wants to quit.
while (!godot.Iteration())
{
// One frame has completed.
}IsStarted
public bool IsStarted()Returns whether this instance has started.
FocusIn and FocusOut
public void FocusIn()
public void FocusOut()Notify Godot that the host has gained or lost focus. Ordinary generic hosts let Godot's display server handle focus and do not call these methods directly.
Pause and Resume
public void Pause()
public void Resume()Notify Godot that the host application has paused or resumed. These lifecycle hooks are useful when another application framework owns the outer window.
Dispose
public void Dispose()Shuts down the native instance. Dispose it before its owning Engine.
Choose one loop owner
Call Iteration() yourself or call Engine.Run(). Do not use both for the same instance.