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

Author Topic: [SFML 2.0] How to render tiles to texture?  (Read 1501 times)

0 Members and 1 Guest are viewing this topic.

LucasShadow

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
[SFML 2.0] How to render tiles to texture?
« on: May 19, 2012, 01:31:31 am »
So I am trying to create a simple terrain for my game right now and know through reading many different posts and articles that having a single sprite for each tile is the wrong way to go about it.  I know I need to have a single sprite, which I set the image for, position, and then draw to a texture which is then drawn every game loop.  But how do you actually do that third step? Drawing the tile to the texture? I am still getting used to SFML 2.0, so if you could point me to the correct documentation I would be very appreciative.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: [SFML 2.0] How to render tiles to texture?
« Reply #1 on: May 19, 2012, 07:57:28 am »
You can have a look at sf::RenderTexture.

You can also see sf::VertexArray, which is in my opinion a better way to group things into a single entity.
Laurent Gomila - SFML developer

 

anything