示例#1
0
        protected override void Load()
        {
            Title     = "LancerEdit";
            guiHelper = new ImGuiHelper(this);
            guiHelper.PauseWhenUnfocused = Config.PauseWhenUnfocused;
            Audio = new AudioManager(this);
            FileDialog.RegisterParent(this);
            Viewport = new ViewportManager(RenderState);
            InitOptions();
            Resources   = new GameResourceManager(this);
            Commands    = new CommandBuffer();
            Billboards  = new Billboards();
            Polyline    = new PolylineRender(Commands);
            DebugRender = new PhysicsDebugRenderer();
            Viewport.Push(0, 0, 800, 600);
            Keyboard.KeyDown += Keyboard_KeyDown;

            //TODO: Icon-setting code very messy
            int w, h, c;
            var stream = typeof(MainWindow).Assembly.GetManifestResourceStream("LancerEdit.reactor_64.png");
            var bytes  = new byte[stream.Length];

            stream.Read(bytes, 0, (int)stream.Length);
            StbSharp.Stb.stbi_set_flip_vertically_on_load(0);
            var img = StbSharp.Stb.stbi_load_from_memory(bytes, out w, out h, out c, StbSharp.Stb.STBI_rgb_alpha);

            StbSharp.Stb.stbi_set_flip_vertically_on_load(1);
            SetWindowIcon(w, h, img);

            //Open passed in files!
            if (InitOpenFile != null)
            {
                foreach (var f in InitOpenFile)
                {
                    OpenFile(f);
                }
            }

            Renderer2D = new Renderer2D(RenderState);
            RichText   = Renderer2D.CreateRichTextEngine();
            Services.Add(Renderer2D);
            Fonts = new FontManager(this);
            Fonts.ConstructDefaultFonts();
            Services.Add(Fonts);
        }
示例#2
0
 protected override void Load()
 {
     Title     = "System Viewer";
     guiHelper = new ImGuiHelper(this);
     FileDialog.RegisterParent(this);
     Viewport = new ViewportManager(this.RenderState);
     Viewport.Push(0, 0, 800, 600);
     Billboards = new Billboards();
     Nebulae    = new NebulaVertices();
     Resources  = new GameResourceManager(this);
     Renderer2D = new Renderer2D(this.RenderState);
     RichText   = Renderer2D.CreateRichTextEngine();
     Services.Add(Billboards);
     Services.Add(Nebulae);
     Services.Add(Resources);
     Services.Add(Renderer2D);
     fontMan = new FontManager(this);
     fontMan.ConstructDefaultFonts();
     Services.Add(fontMan);
     Services.Add(new GameConfig());
 }
示例#3
0
 protected override void Load()
 {
     Title     = "LancerEdit";
     guiHelper = new ImGuiHelper(this);
     guiHelper.PauseWhenUnfocused = Config.PauseWhenUnfocused;
     Audio = new AudioManager(this);
     FileDialog.RegisterParent(this);
     Viewport    = new ViewportManager(RenderState);
     options     = new OptionsWindow(this);
     Resources   = new GameResourceManager(this);
     Commands    = new CommandBuffer();
     Billboards  = new Billboards();
     Polyline    = new PolylineRender(Commands);
     DebugRender = new PhysicsDebugRenderer();
     Viewport.Push(0, 0, 800, 600);
     Keyboard.KeyDown += Keyboard_KeyDown;
     //TODO: Icon-setting code very messy
     using (var stream = typeof(MainWindow).Assembly.GetManifestResourceStream("LancerEdit.reactor_64.png"))
     {
         var icon = LibreLancer.ImageLib.Generic.BytesFromStream(stream);
         SetWindowIcon(icon.Width, icon.Height, icon.Data);
     }
     //Open passed in files!
     if (InitOpenFile != null)
     {
         foreach (var f in InitOpenFile)
         {
             OpenFile(f);
         }
     }
     Renderer2D = new Renderer2D(RenderState);
     RichText   = Renderer2D.CreateRichTextEngine();
     Services.Add(Renderer2D);
     Fonts = new FontManager();
     Fonts.ConstructDefaultFonts();
     Services.Add(Fonts);
     gen3dbDlg = new CommodityIconDialog(this);
 }