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

Author Topic: "Cost" of setting textures  (Read 2661 times)

0 Members and 1 Guest are viewing this topic.

Olysold

  • Newbie
  • *
  • Posts: 1
    • View Profile
"Cost" of setting textures
« on: July 16, 2013, 01:50:04 pm »
Hello. I was wondering, is it an expensive operation to constantly keep setting textures to a sprite? Say I have a character that shoots out textured bullets. In the construction of those bullets, would it be better to just copy a sprite that has already been textured or set a texture to the sprite on each shot? Or is there no difference whatsoever?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: "Cost" of setting textures
« Reply #1 on: July 16, 2013, 02:11:54 pm »
There's no difference at all. The heavy operations all occur in the draw function, actually. Until you call it, nothing much happens except assignments and lightweight stuff.
Laurent Gomila - SFML developer