示例#1
0
        private static void Load()
        {
            IInputContext input = window.CreateInput();

            foreach (IKeyboard keyboard in input.Keyboards)
            {
                keyboard.KeyDown += KeyDown;
            }
            foreach (IMouse mouse in input.Mice)
            {
                mouse.MouseMove += MouseMove;
            }

            gl = window.CreateOpenGL();

            OpenGLRenderer nvgRenderer = new(CreateFlags.Antialias | CreateFlags.StencilStrokes | CreateFlags.Debug, gl);

            nvg = Nvg.Create(nvgRenderer);

            demo = new Demo(nvg);

            timer = Stopwatch.StartNew();

            timer.Restart();

            prevTime = timer.Elapsed.TotalMilliseconds;
        }
示例#2
0
        private static void Load()
        {
            IInputContext input = window.CreateInput();

            foreach (IKeyboard keyboard in input.Keyboards)
            {
                keyboard.KeyDown += KeyDown;
            }

            gl = window.CreateOpenGL();

            OpenGLRenderer nvgRenderer = new(CreateFlags.Antialias | CreateFlags.StencilStrokes | CreateFlags.Debug, gl);

            nvg = Nvg.Create(nvgRenderer);

            fontSize = 20.0f;
            _        = nvg.CreateFont("Roboto", "Roboto-Regular.ttf");
        }