SFML community forums

Help => Graphics => Topic started by: acrin1 on September 25, 2011, 02:54:09 pm

Title: Combining image components into single image
Post by: acrin1 on September 25, 2011, 02:54:09 pm
Hi,

I'm writing a RPG style game that has an on screen list of statistics in rows and columns and an onscreen auto-map. I'm building both of these screen components from an image file using the subRect command - one image contains a bitmap font, the other small map symbols to build a map. I'm rebuilding both of these display elements every frame along with a 3D view created using OpenGL. I've noticed this is starting to slow down the 3D view a bit.

My question is whether I can combine these small image elements into another image before displaying it on the screen as a sprite. As currently  I'm rebuilding the stats and map displays every frame when I know the information won't be changing that frequently. Apologies if I'm missing something obvious.

Thanks.
Title: Combining image components into single image
Post by: acrin1 on September 25, 2011, 03:18:40 pm
Meant to say I'm using SFML 1.6.
Title: Combining image components into single image
Post by: Nexus on September 25, 2011, 04:42:20 pm
I don't know for SFML 1.6, but in SFML 2, you can take a look at sf::RenderTexture.
Title: Combining image components into single image
Post by: acrin1 on September 25, 2011, 07:27:03 pm
Quote from: "Nexus"
I don't know for SFML 1.6, but in SFML 2, you can take a look at sf::RenderTexture.


Nexus, thanks for that. Based on the 2.0 documentation at:

http://www.sfml-dev.org/documentation/2.0/classsf_1_1RenderTexture.php

that looks to be exactly what I'm looking for. I'll see if I can get 2.0 working for me.