Beispiel #1
0
        protected override void OnResize(EventArgs e)
        {
            base.OnResize(e);

            GLRenderer.OnResize(e);
            _interface.OnResize(e);

            windowSize = new Vector2(Width, Height);
        }
Beispiel #2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            Logger.Log(LogLevel.INFO, "Initializing game");

            Title = _title;

            ScreenBuffer = new ScreenBuffer((uint)_windowSize.X, (uint)_windowSize.Y, (uint)TextureMinFilter.Nearest, 4);

            GL.ClearColor(Color.MidnightBlue);
            GLRenderer.Initialize();

            // load content

            _defaultShader = new Shader("Content/default");
            _mvpLoc        = _defaultShader.GetVariableLocation("mvp");
            _diffuseLoc    = _defaultShader.GetVariableLocation("diffuse");

            GL.ActiveTexture(TextureUnit.Texture0);
            GL.Uniform1(_diffuseLoc, 0);

            Simulation = new Simulation();

            _screenQuad = new QuadPrimitive(0, 0, (uint)_windowSize.X, (uint)_windowSize.Y);

            Controller = new Controller();

            _interface = new InterfaceManager();
            _interface.OnLoad(e);

            Input.OnLoad(e);

            // end load content
            isRunning = true;

            Logger.Log(LogLevel.INFO, "Done initializing game");
        }