1
DotNet / Re: Vertex Or Sprite Batching in Csharp
« on: June 01, 2023, 11:28:47 pm »
I'm thinking of making everything a sprite , then cycle trought all of them every frame then put it into a vertexarray , but i dont know if it is a good idea ,
VA = new VertexArray();
foreach(sprites){
vertex = new Vertex();
vertex.position = sprites.getPosition();
vertex.texture.position = sprite.GetTexturePosition();
VA.AddVertex(vertex);
}
window.Draw(VA,Renderstates);
something around those lines would work i think.
VA = new VertexArray();
foreach(sprites){
vertex = new Vertex();
vertex.position = sprites.getPosition();
vertex.texture.position = sprite.GetTexturePosition();
VA.AddVertex(vertex);
}
window.Draw(VA,Renderstates);
something around those lines would work i think.