Exemplo n.º 1
0
        private static void Main(string[] args)
        {
            library = nativeLibrary.ActivateInterface <IX3DNative>("EngineRenderer");

            FileLoader.TestPath();
            Debug.Log("Opening window");
            _mainWindow = new GlfwWindow();

            TestError();

            RustError  err     = library.last_error_message();
            RustString message = new RustString(err.message);

            Console.WriteLine(message.AsString());

            while (!_mainWindow.Closed())
            {
                var currentFrame = DateTime.Now;
                var deltaTime    = (currentFrame - _lastFrame).TotalSeconds;
                var deltaTimeMs  = (currentFrame - _lastFrame).TotalMilliseconds;
                _mainWindow.UpdateTitle($"Crazy Engine - {deltaTimeMs} ms -- FPS: {1.0 / deltaTime}");
                // TestRender();
                _mainWindow.Update();
                _lastFrame = currentFrame;
            }

            _mainWindow.Dispose();
        }
Exemplo n.º 2
0
        private static void RustLog(RustLogMessage rs)
        {
            RustString message = new RustString(rs.message);
            RustString target  = new RustString(rs.target);

            Log(target.ToString() + " > " + message.ToString());
        }