Beispiel #1
0
        private static Viewport2D Create2D(Viewport2D.ViewDirection direction)
        {
            var viewport = new Viewport2D(direction)
            {
                Dock  = DockStyle.Fill,
                VSync = false
            };

            viewport.MakeCurrent();
            GraphicsHelper.InitGL2D();
            GL.ClearColor(CBRE.Settings.Grid.Background);
            viewport.Listeners.Add(new ViewportLabelListener(viewport));
            viewport.Listeners.Add(new Camera2DViewportListener(viewport));
            viewport.Listeners.Add(new Grid2DEventListener(viewport));
            viewport.Listeners.Add(new ToolViewportListener(viewport));
            return(viewport);
        }