1
Graphics / Clearing only Selected parts of a render texture.
« on: August 23, 2013, 03:38:22 pm »
The problem
I'm using the .net implementation of SFML, and I can't see any way of clearing only a selected region of the RenderTexture
I was hoping for renderTexture.Clear(intRect);
Some background on why I need this.
I plan to have a way of having multiple layers of (often) semi-transparent tiles, that frequently change,
render to the screen with much better performance on older computers:
The problem is that I can't clear selected parts of the texture to become transparent. I need to clear and redraw to the entire render texture![Sad :(](https://www.sfml-dev.org/forums/Smileys/default/sad.gif)
Maybe there's a better way around this. Any ideas?
Thanks in advance.
I'm using the .net implementation of SFML, and I can't see any way of clearing only a selected region of the RenderTexture
I was hoping for renderTexture.Clear(intRect);
Some background on why I need this.
I plan to have a way of having multiple layers of (often) semi-transparent tiles, that frequently change,
render to the screen with much better performance on older computers:
- The world could is divided into chunks each with a render texture comprising 256 tiles (16 w, 16 h)
- As the player moves through the world, each chunk that is seen, is rendered once to a render texture
- When the window renders the world, it only needs to render the render texture of the chunks that are visible
- Each time tiles are terraformed (which in my case is frequent), only a small section of the render texture should be cleared and rerendered
The problem is that I can't clear selected parts of the texture to become transparent. I need to clear and redraw to the entire render texture
![Sad :(](https://www.sfml-dev.org/forums/Smileys/default/sad.gif)
Maybe there's a better way around this. Any ideas?
Thanks in advance.