Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - beto

Pages: [1]
1
Graphics / Re: using VertexArray, am i rigth?? (SOLVED)
« on: June 19, 2015, 02:48:15 am »
very thnaks, i thought it was the same but i wasn't sure  ;D ;D

2
Graphics / using VertexArray, am i rigth?? (SOLVED)
« on: June 18, 2015, 10:45:32 pm »
Hi guys, i was reading the tutorials from SFML page, in the tutorial "Designing your own entities with vertex array" they explain that performance depend from number of calls of "draw" function. I created a class to draw batches of entities with different texture, this class inherit from "sf::Drawable" class and, in her method "virtual void draw (RenderTarget &target, RenderStates states) const;" i wrote the next code:
void Menu::draw (RenderTarget &target, RenderStates states) const
{
    for (i = 0; i < quantityVertex; i++)
    {
        states.texture = &textures [i];
        target.draw (vertexArray [i[, states);
    }
}
this also can be done with the next code inside main game loop
for (i = 0; i < quantitySprites; i++)
   window.draw (sprites [i]);
 

ok, my question is, which is more efficient??  ;D ;D

thank so much for your answers  ;), i don't know english  ???

Conclusion:
   The performance of the function "draw" is given from the number of calls of the function "RenderTarget::draw (const Drawable &drawable, const RenderStates &states), that if someone serves you  ;)

Pages: [1]