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; }
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(); }