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

Author Topic: sf::RenderTexture issue?  (Read 2810 times)

0 Members and 1 Guest are viewing this topic.

Krofna

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • Email
sf::RenderTexture issue?
« on: January 01, 2012, 10:48:59 am »
It appears that sf::RenderTexture only work on modern graphic cards (It failed to render texture on ATI Mobility Radeon X1600).
Since I'm making tile-based game, I need more portable and efficient way to do this.

It is to my understanding that drawing tile by tile(between 24*32 and 24*32*2 tiles, depending on number of world objects) on each frame is very slow, so I'm now out of ideas.

How should I fix this problem?

EDIT: This is code

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
sf::RenderTexture issue?
« Reply #1 on: January 01, 2012, 11:14:39 am »
sf::RenderTexture will be fixed in SFML 2.1, it should work on all hardware.

But download a recent revision of SFML 2, and use the new sf::VertexArray class. It allows to gather many primitives (ie. your entire tiled background) in a single entity, without the need to pre-render it. And it avoids the maximum texture size limitation that sf::RenderTexture has.
Laurent Gomila - SFML developer

Krofna

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • Email
sf::RenderTexture issue?
« Reply #2 on: January 01, 2012, 11:32:46 am »
Quote from: "Laurent"
sf::RenderTexture will be fixed in SFML 2.1, it should work on all hardware.

But download a recent revision of SFML 2, and use the new sf::VertexArray class. It allows to gather many primitives (ie. your entire tiled background) in a single entity, without the need to pre-render it. And it avoids the maximum texture size limitation that sf::RenderTexture has.


I failed to find a way to load tiles from file into VertexArray. But it doesn't matter for now.
When will SFML 2.1 be avaliable?  I need it to work on all hardware in  6-7 weeks  8)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
sf::RenderTexture issue?
« Reply #3 on: January 01, 2012, 11:36:28 am »
Quote
I failed to find a way to load tiles from file into VertexArray.

Hum, you should look at examples and read the doc to understand how it works ;)

Quote
When will SFML 2.1 be avaliable? I need it to work on all hardware in 6-7 weeks

SFML 2.0 is not even released yet, and I have no idea whether the RenderTexture bugs will be easy to fix or not. So don't rely on it being ready in 6-7 weeks. You'd better learn how to use vertex arrays, I've added them especially for this kind of use case.
Laurent Gomila - SFML developer

Foaly

  • Sr. Member
  • ****
  • Posts: 453
    • View Profile
Re: sf::RenderTexture issue?
« Reply #4 on: June 10, 2012, 11:34:05 pm »
I have the same issue on my laptop, which has a ATI MOBILITY RADEON X300. It's from the same series so I think it might be related. I would really like this to work too, because I use my laptop a lot to show stuff to people. And i have a couple programs that rely on RenderTextures :)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: sf::RenderTexture issue?
« Reply #5 on: June 11, 2012, 12:01:49 am »
So don't rely on it being ready in 6-7 weeks.
Just tell him the truth: It won't be fixed in 6-7 weeks!

At least if you look at how reeeeeeeeeeeeeeeeeeeealy slowly SFML 2 is getting to it's release point (if at all). :P

Quote from: Krofna
I failed to find a way to load tiles from file into VertexArray.
There are also multiple forum posts about how to use VertexArray with various (good) examples.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Foaly

  • Sr. Member
  • ****
  • Posts: 453
    • View Profile
Re: sf::RenderTexture issue?
« Reply #6 on: June 11, 2012, 09:31:15 am »
Haha this post is from January so I know it wasn't released in those 6-7 weeks (hopefully in the next though :D )
I just wanted to add some information about this issue, because it seems to be related to ati graphic cards (I'm on windows 7 with the 2.0 rc by the way) on my other machine with a GeForce gtx 560 the RenderTextures work fine.