Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
Smaller images from a larger image
Print
Pages: [
1
]
Author
Topic: Smaller images from a larger image (Read 2864 times)
0 Members and 1 Guest are viewing this topic.
tntexplosivesltd
Full Member
Posts: 163
Smaller images from a larger image
«
on:
February 13, 2011, 09:40:10 am »
Hi.
I am wondering how to load an image of ASCII characters and create many smaller images (one for each letter) from that large image.
Thank you in advance,
tntexplosivesltd.
Logged
devlin
Full Member
Posts: 128
Smaller images from a larger image
«
Reply #1 on:
February 13, 2011, 09:50:12 am »
http://www.sfml-dev.org/documentation/2.0/classsf_1_1Image.htm
http://www.sfml-dev.org/documentation/2.0/classsf_1_1Image.htm
(in particular SetSubRect)
It's all in the documentation
Logged
tntexplosivesltd
Full Member
Posts: 163
Smaller images from a larger image
«
Reply #2 on:
February 13, 2011, 10:00:31 am »
I want to use the images to draw text in openGL. SetSubRect looks to be going the wrong way about it. Found a link myself anyway:
http://www.sfml-dev.org/forum/viewtopic.php?t=2790
Logged
tntexplosivesltd
Full Member
Posts: 163
Smaller images from a larger image
«
Reply #3 on:
February 13, 2011, 10:14:52 am »
Hmm... this shows image --> C++ STL vector --> image.
Can I just do image --> image?
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Smaller images from a larger image
«
Reply #4 on:
February 13, 2011, 10:34:42 am »
You can use Image::Copy.
But why do you want to break your big image into individual smaller images? Rendering them will be much more efficient if they are all in the same texture.
Logged
Laurent Gomila - SFML developer
tntexplosivesltd
Full Member
Posts: 163
Smaller images from a larger image
«
Reply #5 on:
February 13, 2011, 10:36:37 am »
So how can I pass the letters to OpenGL individually?
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Smaller images from a larger image
«
Reply #6 on:
February 13, 2011, 10:47:33 am »
With texture coordinates (Image::GetTexCoords).
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
Smaller images from a larger image