Example #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;
        }
Example #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"];
        }
 public Sandbox(WindowProp prop) : base(prop)
 {
     this.PushLayer(new TestLayer());
     this.PushOverlay(new ImGuiLayer());
 }
Example #4
0
 public Window(WindowProp prop)
 {
     Init(prop);
 }