OmegaEngine API
1.0.3
|
Automatically provides an Engine instance with a fullscreen-capable window, render loop, input handling, etc. More...
Classes | |
class | GameForm |
An internal Windows Form to use as Engine render target with mouse+keyboard event handling More... | |
Public Member Functions | |
virtual void | Run () |
Shows the window and runs the render loop until Exit is called. More... | |
void | Exit () |
Stops the render loop and closes the window More... | |
void | AddInputReceiver (IInputReceiver receiver) |
Calls InputProvider.AddReceiver for all default InputProviders. More... | |
void | RemoveInputReceiver (IInputReceiver receiver) |
Calls InputProvider.RemoveReceiver for all default InputProviders. More... | |
virtual void | Debug () |
Called when the debug form is to be displayed More... | |
virtual Lua | NewLua () |
Creates a new Lua instance with commonly used objects preloaded. More... | |
void | Dispose () |
Dispose the Engine, the internal windows form, etc. More... | |
Static Public Member Functions | |
static void | Crash () |
Crashes the game for testing purposes More... | |
Protected Member Functions | |
GameBase (string name, Icon icon=null, Image background=null, bool stretch=false) | |
Sets up the Form. Call ToWindowed or ToFullscreen and Run afterwards. More... | |
void | ToFullscreen () |
Sets up the System.Windows.Forms.Form for fullscreen display More... | |
void | ToWindowed (Size size) |
Sets up the System.Windows.Forms.Form for normal windowed (non-fullscreen) mode More... | |
void | UpdateStatus (string message) |
Updates the current status of the loading process More... | |
virtual void | Dispose (bool disposing) |
To be called by IDisposable.Dispose and the object destructor. More... | |
virtual void | ResetEngine () |
Resets the Engine More... | |
virtual EngineConfig | BuildEngineConfig (bool fullscreen) |
Called to generate an EngineConfig based on external settings More... | |
virtual void | ApplyGraphicsSettings () |
Called when graphics settings from an external source need to be applied to the Engine More... | |
virtual bool | Initialize () |
To be called after the window is ready and the Engine needs to be set up More... | |
virtual void | Render (double elapsedTime) |
Called when the next frame needs to be rendered. More... | |
Protected Attributes | |
readonly GameForm | Form |
The internal form used as the Engine render-targets More... | |
Properties | |
bool | Disposed [get] |
Has the game been shutdown? More... | |
Engine | Engine [get] |
The Engine instance used by the game. Warning! Only set after Control.Show has been called More... | |
bool | Fullscreen [get] |
Is the game in fullscreen mode? More... | |
bool? | Loading [get, set] |
Indicates the game is currently loading something and the user must wait. More... | |
KeyboardInputProvider | KeyboardInputProvider [get] |
A default Input.KeyboardInputProvider hooked up to the Form. More... | |
MouseInputProvider | MouseInputProvider [get] |
A default Input.MouseInputProvider hooked up to the Form. More... | |
TouchInputProvider | TouchInputProvider [get] |
A default Input.TouchInputProvider hooked up to the Form. More... | |
Automatically provides an Engine instance with a fullscreen-capable window, render loop, input handling, etc.
By using this class, you don't need to create a window, set up InputProviders, provide access to DebugConsole, etc. yourself.
You should override at least Initialize and Render. This corresponds to the template method pattern.
|
inlineprotected |
Sets up the Form. Call ToWindowed or ToFullscreen and Run afterwards.
name | The name of the application for the title bar |
icon | The icon of the application for the title bar |
background | A background image for the window while loading |
stretch | Stretch background to fit the screen? (false will center it instead) |
|
inline |
Calls InputProvider.AddReceiver for all default InputProviders.
receiver | The object to receive the commands. |
|
inlineprotectedvirtual |
Called when graphics settings from an external source need to be applied to the Engine
|
inlineprotectedvirtual |
Called to generate an EngineConfig based on external settings
fullscreen | Shall the configuration be generated for fullscreen mode? |
|
inlinestatic |
Crashes the game for testing purposes
|
inlinevirtual |
Called when the debug form is to be displayed
|
inline |
Dispose the Engine, the internal windows form, etc.
|
inlineprotectedvirtual |
To be called by IDisposable.Dispose and the object destructor.
disposing | true if called manually and not by the garbage collector. |
|
inline |
Stops the render loop and closes the window
|
inlineprotectedvirtual |
To be called after the window is ready and the Engine needs to be set up
true
if the initialization worked, false
if it failed an the app must be closed
|
inlinevirtual |
Creates a new Lua instance with commonly used objects preloaded.
|
inline |
Calls InputProvider.RemoveReceiver for all default InputProviders.
receiver | The object to no longer receive the commands. |
|
inlineprotectedvirtual |
Called when the next frame needs to be rendered.
elapsedTime | The number of seconds that have passed since this method was last called. |
|
inlineprotectedvirtual |
Resets the Engine
|
inlinevirtual |
Shows the window and runs the render loop until Exit is called.
|
inlineprotected |
Sets up the System.Windows.Forms.Form for fullscreen display
|
inlineprotected |
Sets up the System.Windows.Forms.Form for normal windowed (non-fullscreen) mode
size | The window size |
|
inlineprotected |
Updates the current status of the loading process
message | The new message to display |
|
protected |
The internal form used as the Engine render-targets
|
get |
Has the game been shutdown?
|
get |
The Engine instance used by the game. Warning! Only set after Control.Show has been called
|
get |
Is the game in fullscreen mode?
|
get |
A default Input.KeyboardInputProvider hooked up to the Form.
|
getset |
Indicates the game is currently loading something and the user must wait.
On Windows 7 and newer this will cause a neat taskbar animation.
|
get |
A default Input.MouseInputProvider hooked up to the Form.
|
get |
A default Input.TouchInputProvider hooked up to the Form.