/// <summary> /// Runs the NUIApplication. /// </summary> /// <param name="args">Arguments from commandline.</param> /// <since_tizen> 4 </since_tizen> public override void Run(string[] args) { Backend.AddEventHandler(EventType.PreCreated, OnPreCreate); Backend.AddEventHandler(EventType.Resumed, OnResume); Backend.AddEventHandler(EventType.Paused, OnPause); base.Run(args); }
/// <summary> /// Runs the UI applications' main loop. /// </summary> /// <param name="args">Arguments from the commandline.</param> /// <since_tizen> 4 </since_tizen> public override void Run(string[] args) { Backend.AddEventHandler(EventType.Resumed, OnResume); Backend.AddEventHandler(EventType.Paused, OnPause); Backend.AddEventHandler <TimeEventArgs>(WatchEventType.TimeTick, OnTick); Backend.AddEventHandler <TimeEventArgs>(WatchEventType.AmbientTick, OnAmbientTick); Backend.AddEventHandler <AmbientEventArgs>(WatchEventType.AmbientChanged, OnAmbientChanged); base.Run(args); }
/// <summary> /// Runs the UI application's main loop. The GameWindow updates and renders at the specified frequency. /// </summary> /// <param name="args">Arguments from the commandline.</param> /// <param name="updatesPerSecond">The frequency of UpdateFrame events.</param> /// <param name="framesPerSecond">The frequency of RenderFrame events.</param> /// <since_tizen> 5 </since_tizen> public void Run(string[] args, double updatesPerSecond, double framesPerSecond) { // Initialize SDL2 SDL2.SDL.TizenAppInit(args.Length, args); SDL2.SDL.SetMainReady(); Toolkit.Init(); // Set Create Window Backend.AddEventHandler(TizenGameCoreBackend.WindowCreationEventType, () => { window = new TizenGameWindow(GraphicsMode, DisplayDevice.Default, GLMajor, GLMinor); }); // Configure callbacks for application events base.Run(args); // Run mainloop window.RunInternal(updatesPerSecond, framesPerSecond); }
/// <summary> /// Runs the UI application's main loop. The GameWindow updates and renders at the specified frequency. /// </summary> /// <param name="args">Arguments from the commandline.</param> /// <param name="updatesPerSecond">The frequency of UpdateFrame events.</param> /// <param name="framesPerSecond">The frequency of RenderFrame events.</param> public void Run(string[] args, double updatesPerSecond, double framesPerSecond) { // Initialize SDL2 SDL.TizenAppInit(args.Length, args); SDL.SetMainReady(); Toolkit.Init(); // Set Internal Event Handlers Backend.AddEventHandler(TizenGameCoreBackend.InternalCreateEventType, () => { // In Tizen SDL Backend, GL Attributes should be set before creating the window. SetGLAttributes(GraphicsMode, GLMajor, GLMinor); window = new TizenGameWindow(GraphicsMode, DisplayDevice.Default, Current.ApplicationInfo.ExecutablePath, GLMajor, GLMinor); }); Backend.AddEventHandler(TizenGameCoreBackend.InternalTerminateEventType, () => { window.Exit(); }); Backend.AddEventHandler(TizenGameCoreBackend.InternalResumeEventType, () => { window.Paused = false; }); Backend.AddEventHandler(TizenGameCoreBackend.InternalPauseEventType, () => { window.Paused = true; }); // Configure callbacks for application events base.Run(args); // Run mainloop window.RunInternal(updatesPerSecond, framesPerSecond); }