示例#1
0
        public void Begin(TextureAtlas atlas, Camera camera)
        {
            if (_beginCalled) throw new Exception("Begin called twice without a call to end.");

            _atlas = atlas;
            _camera = camera;
            _blendState = BlendState.AlphaBlend;
            _sortMode = SpriteSortMode.None;
            _beginCalled = true;
        }
示例#2
0
        public void Render(double time, Camera camera)
        {
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            SpriteBatch.Begin(_atlas, camera);

            foreach (var actor in Repository.Get())
            {
                SpriteBatch.Draw(actor);
            }

            SpriteBatch.End();

            OpenTK.Graphics.GraphicsContext.CurrentContext.SwapBuffers();
        }