public static int Run(Type appDelegateType, string[] args) { // Create the Application AppBase app = null; #if ATOMIC_DESKTOP app = NETIPCPlayerApp.Create(args); #endif #if ATOMIC_ANDROID app = NETAtomicPlayer.Create(args); var renderer = AtomicNET.GetSubsystem <Renderer>(); renderer.ReuseShadowMaps = false; renderer.ShadowQuality = ShadowQuality.SHADOWQUALITY_SIMPLE_16BIT; #endif appDelegate = (AppDelegate)Activator.CreateInstance(appDelegateType); appDelegate.Start(); // Managed code in charge of main loop while (app.RunFrame()) { appDelegate.PostFrame(); } appDelegate.Shutdown(); // Shut 'er down app.Shutdown(); return(0); }
public static int Run(Type appDelegateType, string[] args) { // Create the Application AppBase app = null; #if ATOMIC_DESKTOP app = NETIPCPlayerApp.Create(args); #endif #if ATOMIC_IOS // On iOS, we need to set main ready as main() isn't being called SDLEvents.SetMainReady(); #endif #if ATOMIC_MOBILE app = NETAtomicPlayer.Create(args); var renderer = AtomicNET.GetSubsystem <Renderer>(); renderer.ReuseShadowMaps = false; renderer.ShadowQuality = ShadowQuality.SHADOWQUALITY_SIMPLE_16BIT; #endif appDelegate = (AppDelegate)Activator.CreateInstance(appDelegateType); try { appDelegate.Start(); // Managed code in charge of main loop while (app.RunFrame()) { appDelegate.PostFrame(); } appDelegate.Shutdown(); // Shut 'er down app.Shutdown(); } catch (Exception e) { if (e.InnerException != null) { Log.Error(e.InnerException.StackTrace); // rethrow inner exception throw e.InnerException; } else { Log.Error(e.StackTrace); // rethrow throw e; } } return(0); }
static protected void RegisterSubsystems() { // TODO: Refactor these registrations AtomicNET.RegisterSubsystem("FileSystem"); AtomicNET.RegisterSubsystem("Graphics"); AtomicNET.RegisterSubsystem("Player"); AtomicNET.RegisterSubsystem("Input"); AtomicNET.RegisterSubsystem("Renderer"); AtomicNET.RegisterSubsystem("ResourceCache"); AtomicNET.Cache = AtomicNET.GetSubsystem <ResourceCache>(); }
static protected void RegisterSubsystems() { // TODO: Refactor these registrations AtomicNET.RegisterSubsystem("FileSystem"); AtomicNET.RegisterSubsystem("Graphics"); AtomicNET.RegisterSubsystem("Player"); AtomicNET.RegisterSubsystem("Input"); AtomicNET.RegisterSubsystem("Renderer"); AtomicNET.RegisterSubsystem("ResourceCache"); AtomicNET.Cache = AtomicNET.GetSubsystem <ResourceCache>(); AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.AssemblyResolve += new ResolveEventHandler(AtomicResolveEventHandler); }
public static void SendWindowEvent(SdlWindowEvent wndEvent, int data1 = 0, int data2 = 0) { var graphics = AtomicNET.GetSubsystem <Graphics>(); SDL_SendWindowEvent(graphics.SDLWindow, (byte)wndEvent, data1, data2); }
public static T GetSubsystem <T>() where T : AObject { return(AtomicNET.GetSubsystem <T>()); }