/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. font = Content.Load <SpriteFont>("default"); spriteBatch = new SpriteBatch(GraphicsDevice); drawAdapter = new MonogameAdapter(spriteBatch); drawVisitor = new DrawVisitor(drawAdapter); updateVisitor = new UpdateVisitor(drawAdapter); // TODO: use this.Content to load your game content here }
internal SpriteBatch( ISpriteSheet spriteSheet, IShaderProgram shaderProgram, IVertexArrayObject vao, IVertexBuffer<VertexPositionColourTexture> vbo, IDrawAdapter adapter) { spriteSheet.ThrowIfNull(nameof(spriteSheet)); this.spriteSheet = spriteSheet; Debug.Assert(shaderProgram != null, $"{nameof(shaderProgram)} was null in SpriteBatch"); Debug.Assert(vao != null, $"{nameof(vao)} was null in SpriteBatch"); Debug.Assert(vbo != null, $"{nameof(vbo)} was null ins SpriteBatch"); Debug.Assert(adapter != null, $"{nameof(adapter)} was null in SpriteBatch"); this.shaderProgram = shaderProgram; this.vao = vao; this.vbo = vbo; this.adapter = adapter; Initialise(); }
public UpdateVisitor(IDrawAdapter adapter) { this.adapter = adapter; }
public DrawVisitor(IDrawAdapter adapter) { this.adapter = adapter; }