Exemplo n.º 1
0
        static void Main()
        {
            GL.Initialize(new DummyGL());
            GraphicsContextBackend.SetInstance(new DummyGC());
            WindowBackend.SetInstance(new DummyWindow());

            UnoGenerated();
            DotNetApplication.Start();

            const double targetTime = 1.0 / 60;

            while (Application.Current != null)
            {
                var startTime = Clock.GetSeconds();

                Bootstrapper.OnUpdate();
                Bootstrapper.OnDraw();

                var renderTime = Clock.GetSeconds() - startTime;
                var msTimeout  = (int)((targetTime - renderTime) * 1000.0 + 0.5);

                if (msTimeout > 0)
                {
                    Thread.Sleep(msTimeout);
                }
            }
        }
Exemplo n.º 2
0
        public MainForm(Action initializeApp)
        {
            InitializeComponent();
            Controls.Add(_control);
            _control.Initialize(this);
            var dpi = DpiAwareness.GetDpi(Handle);

            _control.SetDensity((float)dpi);
            ClientSize   = new Size((int)(375 * dpi), (int)(667 * dpi));
            FormClosing += (sender, e) => e.Cancel = _control.OnClosing();
            FormClosed  += (sender, e) => _control.OnClosed();
            Title        = GetAssemblyTitle();

            initializeApp();
            DotNetApplication.Start();
        }
Exemplo n.º 3
0
        public override void DidFinishLaunching(NSNotification notification)
        {
            var initialWindowSize = new CGRect(0, 0, 375, 667);
            var windowStyle       = NSWindowStyle.Titled | NSWindowStyle.Resizable | NSWindowStyle.Miniaturizable | NSWindowStyle.Closable;

            _control = new UnoGLView(initialWindowSize);
            _window  = new NSWindow(
                initialWindowSize,
                windowStyle,
                NSBackingStore.Buffered,
                false)
            {
                Title       = GetAssemblyTitle(),
                ContentView = _control
            };

            _window.MakeKeyAndOrderFront(_control);
            _control.Initialize();

            Program.UnoGenerated();
            DotNetApplication.Start();
            _control.Run(60.0);
        }
Exemplo n.º 4
0
 public void StartApp(MethodInfo entrypoint)
 {
     entrypoint.Invoke(null, null);
     DotNetApplication.Start();
 }