Exemplo n.º 1
0
        void Init(WindowProp props)
        {
            Log.CoreLogger.Info("Creating window {0} ({1}, {2})", props.Title, props.Width, props.Height);

            _nativeWindow = new NativeWindow(props.Width, props.Height, props.Title, GameWindowFlags.Default, GraphicsMode.Default, DisplayDevice.Default);

            GraphicsContextFlags flags = GraphicsContextFlags.Default;

            _graphicsContext = new GraphicsContext(GraphicsMode.Default, _nativeWindow.WindowInfo, 3, 0, flags);
            _graphicsContext.MakeCurrent(_nativeWindow.WindowInfo);
            _graphicsContext.LoadAll(); // wtf is this?

            SetVSync(true);

            _nativeWindow.Visible = true;

            ////Set callbacks

            _nativeWindow.Closed     += HandleWindowClosed;
            _nativeWindow.KeyPress   += HandleWindowKeyPress;
            _nativeWindow.KeyUp      += HandleKeyUp;
            _nativeWindow.KeyDown    += HandleKeyDown;
            _nativeWindow.MouseMove  += HandleMouseMoved;
            _nativeWindow.MouseWheel += HandleMouseScroll;
            _nativeWindow.Resize     += HandleWindowSizeChanged;
            _nativeWindow.MouseUp    += HandleMouseUp;
            _nativeWindow.MouseDown  += HandleMouseDown;
        }
Exemplo n.º 2
0
        private void InitConf()
        {
            ShowProp show = Configurer.conf.Show;

            ColHeaderConf = show.ColHeaderConf;
            ToolBarConf   = show.ToolBarConf;
            if (!show.WindowConf.ContainsKey("FileManager"))
            {
                show.WindowConf.Add("FileManager", new WindowProp());
            }
            FileManagerConf = Configurer.conf.Show.WindowConf["FileManager"];
        }
Exemplo n.º 3
0
 public Sandbox(WindowProp prop) : base(prop)
 {
     this.PushLayer(new TestLayer());
     this.PushOverlay(new ImGuiLayer());
 }
Exemplo n.º 4
0
 public Window(WindowProp prop)
 {
     Init(prop);
 }