Ejemplo n.º 1
0
        protected override void OnLoad(EventArgs e)
        {
            WindowState = WindowState.Maximized;
            GL.ClearColor(Color4.CornflowerBlue);

            GameRegistry.LoadContent();

            GL.Viewport(ClientRectangle);
            GL.Enable(EnableCap.CullFace);
            GL.Enable(EnableCap.Blend);
            GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);

            Shader = new Shader("assets/shaders/sprite/vertex.glsl", "assets/shaders/sprite/fragment.glsl");
            Shader.Use();
            Shader.SetInt("image", 0);
            Shader.SetMatrix4("projection", Matrix4.CreateOrthographic(1920, 1080, -30.0f, 30.0f));

            texture2D = new Texture2D("assets/sprites/sheet.png");
            //texture2D = new Texture2D("Resources/container.png");
            texture2D.Use();

            base.OnLoad(e);

            GraphicsManager.CreateBuffers();
        }