Exemplo n.º 1
0
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);
            GL.Clear(ClearBufferMask.ColorBufferBit);
            GL.ClearColor(Color.CornflowerBlue);

            Spritebatch.Begin(this.Width, this.Height);
            view.ApplyTranform();

            for (int i = -960; i < 960; i += 48) //земля
            {
                Spritebatch.Draw(textures[3], new Vector2(i, 0), new Vector2(3f, 3f), Color.Transparent, new Vector2(0, 0));
                for (int j = 48; j < 480; j += 48) //земля
                {
                    Spritebatch.Draw(textures[2], new Vector2(i, j), new Vector2(3f, 3f), Color.Transparent, new Vector2(0, 0));
                }
            }
            Spritebatch.Draw(textures[0], new Vector2(-96, 0), new Vector2(3f, 3f), Color.Transparent, new Vector2(0, 0));
            Spritebatch.Draw(textures[0], new Vector2(240, 0), new Vector2(3f, 3f), Color.Transparent, new Vector2(0, 0));

            for (int i = -48; i < 240; i += 48)
            {
                for (int j = -144; j < 0; j += 48)
                {
                    Spritebatch.Draw(textures[1], new Vector2(i, j), new Vector2(3f, 3f), Color.DarkGray, new Vector2(0, 0));
                }
            }
            Spritebatch.Draw(textures[1], new Vector2(-96, -48), new Vector2(3f, 3f), Color.DarkGray, new Vector2(0, 0));
            Spritebatch.Draw(textures[1], new Vector2(-96, -96), new Vector2(3f, 3f), Color.DarkGray, new Vector2(0, 0));
            Spritebatch.Draw(textures[1], new Vector2(240, -48), new Vector2(3f, 3f), Color.DarkGray, new Vector2(0, 0));
            Spritebatch.Draw(textures[1], new Vector2(240, -96), new Vector2(3f, 3f), Color.DarkGray, new Vector2(0, 0));

            for (int i = -48; i < 240; i += 48)
            {
                Spritebatch.Draw(textures[1], new Vector2(i, 0), new Vector2(3f, 3f), Color.Transparent, new Vector2(0, 0));
            }

            for (int i = -96; i < 288; i += 48)
            {
                Spritebatch.Draw(textures[0], new Vector2(i, -192), new Vector2(3f, 3f), Color.Transparent, new Vector2(0, 0));
            }
            Spritebatch.Draw(textures[0], new Vector2(-96, -144), new Vector2(3f, 3f), Color.Transparent, new Vector2(0, 0));
            Spritebatch.Draw(textures[0], new Vector2(240, -144), new Vector2(3f, 3f), Color.Transparent, new Vector2(0, 0));

            SwapBuffers();
        }