/// <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);
        }
Beispiel #2
0
        /// <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);
        }