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

Author Topic: Combining image components into single image  (Read 5172 times)

0 Members and 2 Guests are viewing this topic.

acrin1

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://www.crpgdev.com
Combining image components into single image
« 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.

acrin1

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://www.crpgdev.com
Combining image components into single image
« Reply #1 on: September 25, 2011, 03:18:40 pm »
Meant to say I'm using SFML 1.6.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Combining image components into single image
« Reply #2 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

acrin1

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://www.crpgdev.com
Combining image components into single image
« Reply #3 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.

 

anything