Space Engineers
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | Events | List of all members
Sandbox.MySandboxGame Class Reference
Inheritance diagram for Sandbox.MySandboxGame:
Sandbox.Engine.Platform.Game Sandbox.MySandboxExternal SpaceEngineers.Game.SpaceEngineersGame SpaceEngineers.Game.SpaceEngineersGame

Classes

interface  IGameCustomInitialization
 

Public Member Functions

 MySandboxGame (VRageGameServices services, string[] commandlineArgs)
 
void Run (bool customRenderLoop=false, Action disposeSplashScreen=null)
 
void EndLoop ()
 
virtual void SwitchSettings (MyRenderDeviceSettings settings)
 
void Invoke (Action action)
 Invokes the specified action on main thread. More...
 
void ClearInvokeQueue ()
 
void SetMouseVisible (bool visible)
 
void Dispose ()
 
- Public Member Functions inherited from Sandbox.Engine.Platform.Game
 Game ()
 Initializes a new instance of the Game class. More...
 
void SetNextFrameDelayDelta (int delta)
 
void Exit ()
 Exits the game. More...
 
void RunSingleFrame ()
 

Static Public Member Functions

static void AfterLogos ()
 
static void UpdateScreenSize (int width, int height, MyViewport viewport)
 
static void ForceStaticCtor (Type[] types)
 
static void StartPreload ()
 
static void PausePush ()
 
static void PausePop ()
 
static void PauseToggle ()
 
static void AssertUpdateThread ()
 
static void ProcessRenderOutput ()
 Safe to anytime from update thread, synchronized internally More...
 
static void ExitThreadSafe ()
 
static void ReloadDedicatedServerSession ()
 

Public Attributes

MyGameRenderComponent GameRenderComponent
 
MySessionCompatHelper SessionCompatHelper = null
 
- Public Attributes inherited from Sandbox.Engine.Platform.Game
long FrameTimeTicks
 

Static Public Attributes

static readonly MyStringId DirectX11RendererKey = MyStringId.GetOrCompute("DirectX 11")
 
static Version BuildVersion = Assembly.GetExecutingAssembly().GetName().Version
 
static DateTime BuildDateTime = new DateTime(2000, 1, 1).AddDays(BuildVersion.Build).AddSeconds(BuildVersion.Revision * 2)
 Build time of GameLib. Local time (without DST) of machine which build the assembly. More...
 
static MySandboxGame Static
 
static Vector2I ScreenSize
 
static Vector2I ScreenSizeHalf
 
static MyViewport ScreenViewport
 
static bool IsUpdateReady = true
 
static bool IsConsoleVisible = false
 
static bool IsReloading = false
 
static bool FatalErrorDuringInit = false
 
static readonly MyLog Log = new MyLog()
 
static int NumberOfCores
 
static bool ShowIsBetterGCAvailableNotification = false
 
static bool ShowGpuUnderMinimumNotification = false
 
static MyConfig Config
 
static IMyConfigDedicated ConfigDedicated
 
static IntPtr GameWindowHandle
 
- Static Public Attributes inherited from Sandbox.Engine.Platform.Game
static bool IsDedicated = false
 
static bool IsPirated = false
 
static bool IgnoreLastSession = false
 
static IPEndPoint ConnectToServer = null
 
static bool EnableSimSpeedLocking = false
 

Protected Member Functions

virtual void InitInput ()
 
virtual void InitSteamWorkshop ()
 
virtual IMyRenderWindow InitializeRenderThread ()
 
void RenderThread_SizeChanged (int width, int height, MyViewport viewport)
 
void RenderThread_BeforeDraw ()
 
void CheckGraphicsCard (MyRenderMessageVideoAdaptersResponse msgVideoAdapters)
 
virtual void Initialize ()
 
virtual void StartRenderComponent (MyRenderDeviceSettings?settingsToTry)
 
virtual void LoadGui ()
 
override void Update ()
 Reference page contains links to related conceptual articles. More...
 
override void LoadData_UpdateThread ()
 
override void UnloadData_UpdateThread ()
 
override void PrepareForDraw ()
 
- Protected Member Functions inherited from Sandbox.Engine.Platform.Game
void RunLoop ()
 Updates the game's clock and calls Update More...
 

Static Protected Member Functions

static void AddDefaultGameControl (Dictionary< MyStringId, MyControl > self, MyGuiControlTypeEnum controlTypeEnum, MyStringId controlId, MyMouseButtonsEnum?mouse=null, MyKeys?key=null, MyKeys?key2=null)
 

Protected Attributes

IMyBufferedInputSource m_bufferedInputSource
 
Action< bool > m_setMouseVisible
 
- Protected Attributes inherited from Sandbox.Engine.Platform.Game
readonly MyGameTimer m_gameTimer = new MyGameTimer()
 

Static Protected Attributes

static ManualResetEvent m_windowCreatedEvent = new ManualResetEvent(false)
 

Properties

static bool IsDirectX11 [get]
 
static bool IsGameReady [get]
 
static bool IsPreloading [get]
 
static bool AreClipmapsReady [get, set]
 
static VRageGameServices Services [get]
 
static int TotalGamePlayTimeInMilliseconds [get]
 
static int TotalTimeInMilliseconds [get]
 
static double SecondsSinceLastFrame [get]
 
IntPtr WindowHandle [get, protected set]
 
bool EnableDamageEffects [get, set]
 
static IGameCustomInitialization GameCustomInitialization [get, set]
 
static bool IsPaused [get]
 
static IErrorConsumer ErrorConsumer [get, set]
 
- Properties inherited from Sandbox.Engine.Platform.Game
MyTimeSpan DrawTime [get]
 
MyTimeSpan UpdateTime [get]
 
MyTimeSpan SimulationTime [get]
 
double TimerMultiplier [get, set]
 
Thread UpdateThread [get, protected set]
 
Thread DrawThread [get, protected set]
 
static float SimulationRatio [get]
 
bool IsActive [get]
 Gets a value indicating whether this instance is active. More...
 
bool IsRunning [get]
 Gets a value indicating whether is running. More...
 
bool IsFirstUpdateDone [get]
 
bool EnableMaxSpeed [get, set]
 

Events

EventHandler OnGameLoaded
 
EventHandler OnScreenshotTaken
 
- Events inherited from Sandbox.Engine.Platform.Game
Action OnGameExit
 

Detailed Description

Definition at line 74 of file MySandboxGame.cs.

Constructor & Destructor Documentation

Sandbox.MySandboxGame.MySandboxGame ( VRageGameServices  services,
string[]  commandlineArgs 
)
inline

Definition at line 218 of file MySandboxGame.cs.

Member Function Documentation

static void Sandbox.MySandboxGame.AddDefaultGameControl ( Dictionary< MyStringId, MyControl self,
MyGuiControlTypeEnum  controlTypeEnum,
MyStringId  controlId,
MyMouseButtonsEnum mouse = null,
MyKeys key = null,
MyKeys key2 = null 
)
inlinestaticprotected

Definition at line 611 of file MySandboxGame.cs.

static void Sandbox.MySandboxGame.AfterLogos ( )
inlinestatic

Definition at line 654 of file MySandboxGame.cs.

static void Sandbox.MySandboxGame.AssertUpdateThread ( )
inlinestatic

Definition at line 1926 of file MySandboxGame.cs.

void Sandbox.MySandboxGame.CheckGraphicsCard ( MyRenderMessageVideoAdaptersResponse  msgVideoAdapters)
inlineprotected

Definition at line 978 of file MySandboxGame.cs.

void Sandbox.MySandboxGame.ClearInvokeQueue ( )
inline

Definition at line 2283 of file MySandboxGame.cs.

void Sandbox.MySandboxGame.Dispose ( )
inline

Definition at line 2475 of file MySandboxGame.cs.

void Sandbox.MySandboxGame.EndLoop ( )
inline

Definition at line 390 of file MySandboxGame.cs.

static void Sandbox.MySandboxGame.ExitThreadSafe ( )
inlinestatic

Definition at line 2470 of file MySandboxGame.cs.

static void Sandbox.MySandboxGame.ForceStaticCtor ( Type[]  types)
inlinestatic

Definition at line 1159 of file MySandboxGame.cs.

virtual void Sandbox.MySandboxGame.Initialize ( )
inlineprotectedvirtual

Definition at line 998 of file MySandboxGame.cs.

virtual IMyRenderWindow Sandbox.MySandboxGame.InitializeRenderThread ( )
inlineprotectedvirtual

Definition at line 908 of file MySandboxGame.cs.

virtual void Sandbox.MySandboxGame.InitInput ( )
inlineprotectedvirtual

Reimplemented in SpaceEngineers.Game.SpaceEngineersGame.

Definition at line 403 of file MySandboxGame.cs.

virtual void Sandbox.MySandboxGame.InitSteamWorkshop ( )
inlineprotectedvirtual

Definition at line 580 of file MySandboxGame.cs.

void Sandbox.MySandboxGame.Invoke ( Action  action)
inline

Invokes the specified action on main thread.

Definition at line 2253 of file MySandboxGame.cs.

override void Sandbox.MySandboxGame.LoadData_UpdateThread ( )
inlineprotectedvirtual

Implements Sandbox.Engine.Platform.Game.

Definition at line 2205 of file MySandboxGame.cs.

virtual void Sandbox.MySandboxGame.LoadGui ( )
inlineprotectedvirtual

Definition at line 1330 of file MySandboxGame.cs.

static void Sandbox.MySandboxGame.PausePop ( )
inlinestatic

Definition at line 1907 of file MySandboxGame.cs.

static void Sandbox.MySandboxGame.PausePush ( )
inlinestatic

Definition at line 1901 of file MySandboxGame.cs.

static void Sandbox.MySandboxGame.PauseToggle ( )
inlinestatic

Definition at line 1913 of file MySandboxGame.cs.

override void Sandbox.MySandboxGame.PrepareForDraw ( )
inlineprotectedvirtual

Implements Sandbox.Engine.Platform.Game.

Definition at line 2229 of file MySandboxGame.cs.

static void Sandbox.MySandboxGame.ProcessRenderOutput ( )
inlinestatic

Safe to anytime from update thread, synchronized internally

Definition at line 2316 of file MySandboxGame.cs.

static void Sandbox.MySandboxGame.ReloadDedicatedServerSession ( )
inlinestatic

Definition at line 2550 of file MySandboxGame.cs.

void Sandbox.MySandboxGame.RenderThread_BeforeDraw ( )
inlineprotected

Definition at line 972 of file MySandboxGame.cs.

void Sandbox.MySandboxGame.RenderThread_SizeChanged ( int  width,
int  height,
MyViewport  viewport 
)
inlineprotected

Definition at line 967 of file MySandboxGame.cs.

void Sandbox.MySandboxGame.Run ( bool  customRenderLoop = false,
Action  disposeSplashScreen = null 
)
inline

Definition at line 336 of file MySandboxGame.cs.

void Sandbox.MySandboxGame.SetMouseVisible ( bool  visible)
inline

Definition at line 2295 of file MySandboxGame.cs.

static void Sandbox.MySandboxGame.StartPreload ( )
inlinestatic

Definition at line 1287 of file MySandboxGame.cs.

virtual void Sandbox.MySandboxGame.StartRenderComponent ( MyRenderDeviceSettings settingsToTry)
inlineprotectedvirtual

Reimplemented in Sandbox.MySandboxExternal.

Definition at line 1049 of file MySandboxGame.cs.

virtual void Sandbox.MySandboxGame.SwitchSettings ( MyRenderDeviceSettings  settings)
inlinevirtual

Reimplemented in Sandbox.MySandboxExternal.

Definition at line 398 of file MySandboxGame.cs.

override void Sandbox.MySandboxGame.UnloadData_UpdateThread ( )
inlineprotectedvirtual

Implements Sandbox.Engine.Platform.Game.

Definition at line 2211 of file MySandboxGame.cs.

override void Sandbox.MySandboxGame.Update ( )
inlineprotectedvirtual

Reference page contains links to related conceptual articles.

Parameters
gameTimeTime passed since the last call to Update.

Reimplemented from Sandbox.Engine.Platform.Game.

Definition at line 1940 of file MySandboxGame.cs.

static void Sandbox.MySandboxGame.UpdateScreenSize ( int  width,
int  height,
MyViewport  viewport 
)
inlinestatic

Definition at line 1064 of file MySandboxGame.cs.

Member Data Documentation

DateTime Sandbox.MySandboxGame.BuildDateTime = new DateTime(2000, 1, 1).AddDays(BuildVersion.Build).AddSeconds(BuildVersion.Revision * 2)
static

Build time of GameLib. Local time (without DST) of machine which build the assembly.

Definition at line 92 of file MySandboxGame.cs.

Version Sandbox.MySandboxGame.BuildVersion = Assembly.GetExecutingAssembly().GetName().Version
static

Definition at line 85 of file MySandboxGame.cs.

MyConfig Sandbox.MySandboxGame.Config
static

Definition at line 184 of file MySandboxGame.cs.

IMyConfigDedicated Sandbox.MySandboxGame.ConfigDedicated
static

Definition at line 185 of file MySandboxGame.cs.

readonly MyStringId Sandbox.MySandboxGame.DirectX11RendererKey = MyStringId.GetOrCompute("DirectX 11")
static

Definition at line 82 of file MySandboxGame.cs.

bool Sandbox.MySandboxGame.FatalErrorDuringInit = false
static

Definition at line 132 of file MySandboxGame.cs.

MyGameRenderComponent Sandbox.MySandboxGame.GameRenderComponent

Definition at line 180 of file MySandboxGame.cs.

IntPtr Sandbox.MySandboxGame.GameWindowHandle
static

Definition at line 187 of file MySandboxGame.cs.

bool Sandbox.MySandboxGame.IsConsoleVisible = false
static

Definition at line 129 of file MySandboxGame.cs.

bool Sandbox.MySandboxGame.IsReloading = false
static

Definition at line 130 of file MySandboxGame.cs.

bool Sandbox.MySandboxGame.IsUpdateReady = true
static

Definition at line 127 of file MySandboxGame.cs.

readonly MyLog Sandbox.MySandboxGame.Log = new MyLog()
static

Definition at line 137 of file MySandboxGame.cs.

IMyBufferedInputSource Sandbox.MySandboxGame.m_bufferedInputSource
protected

Definition at line 173 of file MySandboxGame.cs.

Action<bool> Sandbox.MySandboxGame.m_setMouseVisible
protected

Definition at line 906 of file MySandboxGame.cs.

ManualResetEvent Sandbox.MySandboxGame.m_windowCreatedEvent = new ManualResetEvent(false)
staticprotected

Definition at line 135 of file MySandboxGame.cs.

int Sandbox.MySandboxGame.NumberOfCores
static

Definition at line 161 of file MySandboxGame.cs.

Vector2I Sandbox.MySandboxGame.ScreenSize
static

Definition at line 96 of file MySandboxGame.cs.

Vector2I Sandbox.MySandboxGame.ScreenSizeHalf
static

Definition at line 97 of file MySandboxGame.cs.

MyViewport Sandbox.MySandboxGame.ScreenViewport
static

Definition at line 98 of file MySandboxGame.cs.

MySessionCompatHelper Sandbox.MySandboxGame.SessionCompatHelper = null

Definition at line 182 of file MySandboxGame.cs.

bool Sandbox.MySandboxGame.ShowGpuUnderMinimumNotification = false
static

Definition at line 167 of file MySandboxGame.cs.

bool Sandbox.MySandboxGame.ShowIsBetterGCAvailableNotification = false
static

Definition at line 166 of file MySandboxGame.cs.

MySandboxGame Sandbox.MySandboxGame.Static
static

Definition at line 95 of file MySandboxGame.cs.

Property Documentation

bool Sandbox.MySandboxGame.AreClipmapsReady
staticgetset

Definition at line 122 of file MySandboxGame.cs.

bool Sandbox.MySandboxGame.EnableDamageEffects
getset

Definition at line 191 of file MySandboxGame.cs.

IErrorConsumer Sandbox.MySandboxGame.ErrorConsumer
staticgetset

Definition at line 2310 of file MySandboxGame.cs.

IGameCustomInitialization Sandbox.MySandboxGame.GameCustomInitialization
staticgetset

Definition at line 212 of file MySandboxGame.cs.

bool Sandbox.MySandboxGame.IsDirectX11
staticget

Definition at line 101 of file MySandboxGame.cs.

bool Sandbox.MySandboxGame.IsGameReady
staticget

Definition at line 106 of file MySandboxGame.cs.

bool Sandbox.MySandboxGame.IsPaused
staticget

Definition at line 1861 of file MySandboxGame.cs.

bool Sandbox.MySandboxGame.IsPreloading
staticget

Definition at line 117 of file MySandboxGame.cs.

double Sandbox.MySandboxGame.SecondsSinceLastFrame
staticget

Definition at line 159 of file MySandboxGame.cs.

VRageGameServices Sandbox.MySandboxGame.Services
staticget

Definition at line 133 of file MySandboxGame.cs.

int Sandbox.MySandboxGame.TotalGamePlayTimeInMilliseconds
staticget

Definition at line 144 of file MySandboxGame.cs.

int Sandbox.MySandboxGame.TotalTimeInMilliseconds
staticget

Definition at line 152 of file MySandboxGame.cs.

IntPtr Sandbox.MySandboxGame.WindowHandle
getprotected set

Definition at line 171 of file MySandboxGame.cs.

Event Documentation

EventHandler Sandbox.MySandboxGame.OnGameLoaded

Definition at line 203 of file MySandboxGame.cs.

EventHandler Sandbox.MySandboxGame.OnScreenshotTaken

Definition at line 204 of file MySandboxGame.cs.


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