TiledMapStaticLayerModel.cs 900 B

12345678910111213141516171819202122
  1. using Microsoft.Xna.Framework.Graphics;
  2. namespace MonoGame.Extended.Tiled.Renderers
  3. {
  4. public sealed class TiledMapStaticLayerModel : TiledMapLayerModel
  5. {
  6. public TiledMapStaticLayerModel(GraphicsDevice graphicsDevice, Texture2D texture, VertexPositionTexture[] vertices, ushort[] indices)
  7. : base(graphicsDevice, texture, vertices, indices)
  8. {
  9. }
  10. protected override VertexBuffer CreateVertexBuffer(GraphicsDevice graphicsDevice, int vertexCount)
  11. {
  12. return new VertexBuffer(graphicsDevice, VertexPositionTexture.VertexDeclaration, vertexCount, BufferUsage.WriteOnly);
  13. }
  14. protected override IndexBuffer CreateIndexBuffer(GraphicsDevice graphicsDevice, int indexCount)
  15. {
  16. return new IndexBuffer(graphicsDevice, IndexElementSize.SixteenBits, indexCount, BufferUsage.WriteOnly); ;
  17. }
  18. }
  19. }