OmegaEngine API  1.0.3
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Properties | Events | List of all members
OmegaEngine.Engine Class Reference

Provides central control for 3D rendering, sound management, asset caching, etc. More...

Inheritance diagram for OmegaEngine.Engine:
OmegaEngine.EngineElement

Public Member Functions

 Engine (Control target, EngineConfig config)
 Initializes the Engine and its components. More...
 
void Screenshot (string filename)
 Saves the current screen at it's current resolution More...
 
void Screenshot (string filename, int width, int height)
 Saves the current screen at a scaled resolution as JPG More...
 
void Screenshot (string filename, Size size)
 Saves the current screen at a scaled resolution More...
 
void Debug ()
 Displays a debug interface for the engine, allowing easy manipulation of Views, Renderable, etc. More...
 
void DebugClose ()
 Closes the windows displayed by Debug More...
 
void Render ()
 Renders all Views. Tracks elapsed game time automatically. More...
 
void Render (double elapsedGameTime, bool noPresent=false)
 Renders all Views. Uses external game time tracking. More...
 
- Public Member Functions inherited from OmegaEngine.EngineElement
void Dispose ()
 

Public Attributes

ICollection< ViewViews => _views
 A list of all views to be rendered by the engine More...
 
- Public Attributes inherited from OmegaEngine.EngineElement
bool IsEngineSet => _engine != null
 true if the Engine has been set. More...
 

Static Public Attributes

static Version Version => Assembly.GetExecutingAssembly().GetName().Version
 The version number of the engine. More...
 

Protected Member Functions

override void OnDispose ()
 Hook that is called when the object needs to dispose its internal resources. More...
 
- Protected Member Functions inherited from OmegaEngine.EngineElement
void RegisterChild (EngineElement element, bool autoDispose=true)
 Registers a child EngineElement for automatic Engine setting and Dispose calling. More...
 
void UnregisterChild (EngineElement element)
 Unregisters a child EngineElement (opposite of RegisterChild). More...
 
virtual void OnEngineSet ()
 Hook that is calld when Engine is set for the first time. More...
 

Properties

DirectSound AudioDevice [get]
 The DirectSound device More...
 
MusicManager Music [get]
 Controls the playback of music (theme-selection, cross-fading, etc.) More...
 
static CultureInfo ResourceCulture [get, set]
 The culture used for loading the assembly resources. More...
 
Control Target [get]
 The System.Windows.Forms.Control the engine draws onto. More...
 
EngineConfig Config [get, set]
 The settings the engine was initialized with. More...
 
EngineCapabilities Capabilities [get]
 Methods for determining the rendering capabilities of the graphics hardware. More...
 
EngineEffects Effects [get]
 Turn specific rendering effects in the engine on or off. More...
 
EngineState State [get]
 Used by Renderable implementations to manipulate the graphics render state. Should not be manipulated manually. More...
 
EnginePerformance Performance [get]
 Tracks the performance/speed of the engine. More...
 
CacheManager Cache = new CacheManager() [get]
 The central cache used for all graphics and sound assets. More...
 
double LastFrameGameTime [get]
 How many seconds of game time have elapsed since the last frame started drawing. More...
 
double TotalGameTime [get]
 How many seconds of game time have elapsed in total. More...
 
Device Device [get]
 The Direct3D device. Use State instead of manipulating this directly when possible. More...
 
bool NeedsReset [get]
 The engine will be reset on the next Render() call More...
 
Viewport RenderViewport [get]
 The viewport for the render target More...
 
Size RenderSize [get, set]
 The size of the render target More...
 
bool Anisotropic [get, set]
 Use anisotropic texture filtering More...
 
string ShaderDir [get]
 The base directory where shader files are stored More...
 
GeneralShader DefaultShader [get]
 A shader used for default lighting More...
 
int FadeLevel [get, set]
 The level of scene fading from 0 (fully visible) to 255 (invisible). More...
 
bool FadeExtra [get, set]
 Is Engine.ExtraRender faded along with the scene? More...
 
- Properties inherited from OmegaEngine.EngineElement
Engine Engine [get, set]
 The Engine instance used by this object. Must be set before using the object. May not be changed once it has been set! More...
 
bool IsDisposed [get]
 Indicates whether this object has been disposed and can therefore no longer be used. More...
 

Events

Action PreRender
 Occurs once for every frame before rendering. More...
 
Action ExtraRender
 Allows the integration of external render processes at the end of the Engine's presentation scheme. More...
 
Action PostRender
 Occurs once for every frame after rendering More...
 
Action DeviceLost
 Occurs after the Device was lost. This usually happens when switching to or from fullscreen mode. More...
 
Action DeviceReset
 Occurs after the Device was reset. This needs to be done to continue using it after DeviceLost. More...
 

Detailed Description

Provides central control for 3D rendering, sound management, asset caching, etc.

Constructor & Destructor Documentation

◆ Engine()

OmegaEngine.Engine.Engine ( Control  target,
EngineConfig  config 
)
inline

Initializes the Engine and its components.

Parameters
targetThe System.Windows.Forms.Control the engine should draw onto.
configSettings for initializing the engine.
Exceptions
NotSupportedExceptionThe graphics card does not meet the engine's minimum requirements.
Direct3D9NotFoundExceptionThrow if required DirectX version is missing.
Direct3DX9NotFoundExceptionThrow if required DirectX version is missing.
Direct3D9Exceptioninternal errors occurred while intiliazing the graphics card.
SlimDX.DirectSound.DirectSoundExceptioninternal errors occurred while intiliazing the sound card.

Member Function Documentation

◆ Debug()

void OmegaEngine.Engine.Debug ( )
inline

Displays a debug interface for the engine, allowing easy manipulation of Views, Renderable, etc.

◆ DebugClose()

void OmegaEngine.Engine.DebugClose ( )
inline

Closes the windows displayed by Debug

◆ OnDispose()

override void OmegaEngine.Engine.OnDispose ( )
inlineprotectedvirtual

Hook that is called when the object needs to dispose its internal resources.

Reimplemented from OmegaEngine.EngineElement.

◆ Render() [1/2]

void OmegaEngine.Engine.Render ( )
inline

Renders all Views. Tracks elapsed game time automatically.

◆ Render() [2/2]

void OmegaEngine.Engine.Render ( double  elapsedGameTime,
bool  noPresent = false 
)
inline

Renders all Views. Uses external game time tracking.

Parameters
elapsedGameTimeHow many seconds of game time have elapsed since the last frame was drawn.
noPresenttrue to supress actually displaying the render output at the end.

◆ Screenshot() [1/3]

void OmegaEngine.Engine.Screenshot ( string  filename)
inline

Saves the current screen at it's current resolution

Parameters
filenameThe file name to save the screenshot too

◆ Screenshot() [2/3]

void OmegaEngine.Engine.Screenshot ( string  filename,
int  width,
int  height 
)
inline

Saves the current screen at a scaled resolution as JPG

Parameters
filenameThe file name to save the screenshot too
widthThe width to scale the resolution down too
heightThe height to scale the resolution down too

◆ Screenshot() [3/3]

void OmegaEngine.Engine.Screenshot ( string  filename,
Size  size 
)
inline

Saves the current screen at a scaled resolution

Parameters
filenameThe file name to save the screenshot too
sizeThe size to scale the resolution down too

Member Data Documentation

◆ Version

Version OmegaEngine.Engine.Version => Assembly.GetExecutingAssembly().GetName().Version
static

The version number of the engine.

◆ Views

ICollection<View> OmegaEngine.Engine.Views => _views

A list of all views to be rendered by the engine

Will be disposed when EngineElement.Dispose is called.

Property Documentation

◆ Anisotropic

bool OmegaEngine.Engine.Anisotropic
getset

Use anisotropic texture filtering

See also
EngineCapabilities.Anisotropic

◆ AudioDevice

DirectSound OmegaEngine.Engine.AudioDevice
get

The DirectSound device

◆ Cache

CacheManager OmegaEngine.Engine.Cache = new CacheManager()
get

The central cache used for all graphics and sound assets.

◆ Capabilities

EngineCapabilities OmegaEngine.Engine.Capabilities
get

Methods for determining the rendering capabilities of the graphics hardware.

◆ Config

EngineConfig OmegaEngine.Engine.Config
getset

The settings the engine was initialized with.

Changing this will cause the engine to reset on the next Render() call

◆ DefaultShader

GeneralShader OmegaEngine.Engine.DefaultShader
get

A shader used for default lighting

◆ Device

Device OmegaEngine.Engine.Device
get

The Direct3D device. Use State instead of manipulating this directly when possible.

◆ Effects

EngineEffects OmegaEngine.Engine.Effects
get

Turn specific rendering effects in the engine on or off.

◆ FadeExtra

bool OmegaEngine.Engine.FadeExtra
getset

Is Engine.ExtraRender faded along with the scene?

◆ FadeLevel

int OmegaEngine.Engine.FadeLevel
getset

The level of scene fading from 0 (fully visible) to 255 (invisible).

◆ LastFrameGameTime

double OmegaEngine.Engine.LastFrameGameTime
get

How many seconds of game time have elapsed since the last frame started drawing.

◆ Music

MusicManager OmegaEngine.Engine.Music
get

Controls the playback of music (theme-selection, cross-fading, etc.)

◆ NeedsReset

bool OmegaEngine.Engine.NeedsReset
get

The engine will be reset on the next Render() call

Do not try to add new assets while this is true!

Just run Render() to fix the problem.

◆ Performance

EnginePerformance OmegaEngine.Engine.Performance
get

Tracks the performance/speed of the engine.

◆ RenderSize

Size OmegaEngine.Engine.RenderSize
getset

The size of the render target

◆ RenderViewport

Viewport OmegaEngine.Engine.RenderViewport
get

The viewport for the render target

◆ ResourceCulture

CultureInfo OmegaEngine.Engine.ResourceCulture
staticgetset

The culture used for loading the assembly resources.

◆ ShaderDir

string OmegaEngine.Engine.ShaderDir
get

The base directory where shader files are stored

◆ State

EngineState OmegaEngine.Engine.State
get

Used by Renderable implementations to manipulate the graphics render state. Should not be manipulated manually.

◆ Target

Control OmegaEngine.Engine.Target
get

The System.Windows.Forms.Control the engine draws onto.

◆ TotalGameTime

double OmegaEngine.Engine.TotalGameTime
get

How many seconds of game time have elapsed in total.

Event Documentation

◆ DeviceLost

Action OmegaEngine.Engine.DeviceLost

Occurs after the Device was lost. This usually happens when switching to or from fullscreen mode.

◆ DeviceReset

Action OmegaEngine.Engine.DeviceReset

Occurs after the Device was reset. This needs to be done to continue using it after DeviceLost.

◆ ExtraRender

Action OmegaEngine.Engine.ExtraRender

Allows the integration of external render processes at the end of the Engine's presentation scheme.

◆ PostRender

Action OmegaEngine.Engine.PostRender

Occurs once for every frame after rendering

◆ PreRender

Action OmegaEngine.Engine.PreRender

Occurs once for every frame before rendering.


The documentation for this class was generated from the following files: