コード例 #1
0
        /// <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
        }
コード例 #2
0
ファイル: SpriteBatch.cs プロジェクト: rmckirby/XogoEngine
        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();
        }
コード例 #3
0
 public UpdateVisitor(IDrawAdapter adapter)
 {
     this.adapter = adapter;
 }
コード例 #4
0
 public DrawVisitor(IDrawAdapter adapter)
 {
     this.adapter = adapter;
 }