Beispiel #1
0
        public Engine()
            : base(1024, 768, new GraphicsMode(32, 24, 0, 4), typeof( Engine ).Assembly.GetName().Name, GameWindowFlags.Default)
        {
            var settings = new Settings();
            settings.Width = this.Width;
            settings.Height = this.Height;
            settings.Samples = this.Context.GraphicsMode.Samples;
            settings.WindowMode = this.WindowState;

            _engineInit(settings);
        }
Beispiel #2
0
 public Engine(Settings engineSettings, string title)
     : base(engineSettings.Width, engineSettings.Height, new GraphicsMode(32, 24, 0, engineSettings.Samples), title, engineSettings.WindowMode == WindowState.Fullscreen && engineSettings.NoBorder ? GameWindowFlags.Fullscreen : GameWindowFlags.Default)
 {
     _engineInit(engineSettings);
 }
Beispiel #3
0
 public Engine(Settings engineSettings)
     : base(engineSettings.Width, engineSettings.Height, new GraphicsMode(32, 24, 0, engineSettings.Samples), typeof(Engine).Assembly.GetName().Name, engineSettings.WindowMode == WindowState.Fullscreen && engineSettings.NoBorder ? GameWindowFlags.Fullscreen : GameWindowFlags.Default)
 {
     _engineInit(engineSettings);
 }
Beispiel #4
0
        private void _engineInit(Settings engineSettings)
        {
            Utilities.Print("==================================", Utilities.PrintCode.INFO);
            Utilities.Print("OLEG ENGINE \n{0}", Utilities.PrintCode.INFO, typeof(Engine).Assembly.GetName().Version.ToString());
            Utilities.Print("==================================\n", Utilities.PrintCode.INFO);

            //Store the current settings
            Utilities.EngineSettings = engineSettings;

            //Toggle VSync
            this.VSync = engineSettings.VSync;

            //Noborder if applicable
            if (engineSettings.NoBorder)
                this.WindowBorder = OpenTK.WindowBorder.Hidden;

            //If we don't want noborder and we're set to fullscreen, change our windowmode to whatever
            if (!engineSettings.NoBorder && engineSettings.WindowMode == OpenTK.WindowState.Fullscreen)
                this.WindowState = engineSettings.WindowMode;
            //BUT if we're set to noborder, require the windowstate is 'normal'
            else if (engineSettings.NoBorder)
                this.WindowState = OpenTK.WindowState.Normal;

            //Hook into some engine callbacks
            //this.OnRenderSceneOpaque += new Action<FrameEventArgs>(RenderSceneOpaque);
            //this.OnRenderSceneTranslucent += new Action<FrameEventArgs>(RenderSceneTranslucent);

            //Make a furious attempt to change the window's icon
            try { this.Icon = System.Drawing.Icon.ExtractAssociatedIcon(System.AppDomain.CurrentDomain.FriendlyName); }
            catch (Exception e) { Utilities.Print("Failed to load icon! {0}", Utilities.PrintCode.WARNING, e.Message); }

            //Hide the console if we want
            if (!engineSettings.ShowConsole)
                ConsoleManager.ShowWindow(ConsoleManager.GetConsoleWindow(), ConsoleManager.SW_HIDE);
        }
Beispiel #5
0
 public Program(Settings settings, string title)
     : base(settings, title)
 {
 }
Beispiel #6
0
 public Program(Settings settings)
     : base(settings)
 {
 }