예제 #1
0
파일: SpriteBatch.cs 프로젝트: khbecker/FNA
        public SpriteBatch(GraphicsDevice graphicsDevice)
        {
            if (graphicsDevice == null)
            {
                throw new ArgumentNullException("graphicsDevice");
            }
            GraphicsDevice = graphicsDevice;

            vertexInfo   = new VertexPositionColorTexture[MAX_VERTICES];
            spriteData   = new SpriteInfo[MAX_SPRITES];
            vertexBuffer = new DynamicVertexBuffer(
                graphicsDevice,
                typeof(VertexPositionColorTexture),
                MAX_VERTICES,
                BufferUsage.WriteOnly
                );
            indexBuffer = new DynamicIndexBuffer(
                graphicsDevice,
                IndexElementSize.SixteenBits,
                MAX_INDICES,
                BufferUsage.WriteOnly
                );
            indexBuffer.SetData(indexData);

            spriteEffect = new Effect(
                graphicsDevice,
                spriteEffectCode
                );
            spriteMatrixTransform = spriteEffect.Parameters["MatrixTransform"];
            spriteEffectPass      = spriteEffect.CurrentTechnique.Passes[0];

            beginCalled = false;
            numSprites  = 0;
        }
예제 #2
0
 public void SetVertexBuffer(DynamicVertexBuffer dynamicVertexBuffer)
 {
 }