SFML community forums
Help => Graphics => Topic started by: Ashenwraith on April 11, 2010, 09:16:28 pm
-
How do you copy an image (NOT RESIZE) to a larger one?
I tried copying pixels onto a larger image and it overwrites it or errors out.
-
sf::Image::Copy ?
-
sf::Image::Copy ?
Oh wow, thanks--Sorry about that, I don't know how I missed that.
I was just thinking 'shouldn't this have a rect'.
Btw, can you give me a bit of help with the Rect constructor, I have:
sf::Rect<int> rct=sf::Rect(1,1,1,1); //doesn't work
NVM, i just got the template code to work...
sf::Rect<int> rct=sf::Rect<int>(1,1,1,1);
looks different than the doc:
sf::Rect< T >::Rect ( T LeftCoord,
T TopCoord,
T RightCoord,
T BottomCoord
)
-
looks different than the doc:
sf::Rect< T >::Rect ( T LeftCoord,
T TopCoord,
T RightCoord,
T BottomCoord
)
Yup, this is how the constructor of a template class is defined. But when you want to construct an instance you have to use the identifier of the class, sf::Rect<T>.
By the way, this is better:
sf::Rect<int> rct(1,1,1,1);
And this is even better;
sf::IntRect rct(1,1,1,1);
-
Thanks again.
The syntax is quite a bit different than the C++ of 10 years ago.
I keep getting warnings <iostream.h> is deprecated and I guess I'm not supposed to use cout << anymore, but std::cerr (or something like that)?
-
Wow, you really haven't practiced C++ for 12 years, this is amazing :D
The header is <iostream> and you must use std::cout (but you can use std::cerr as well if you want).
-
Wow, you really haven't practiced C++ for 12 years, this is amazing :D
The header is <iostream> and you must use std::cout (but you can use std::cerr as well if you want).
Yeah, I got tired of dll/lib hell so I stopped, but now I'm back because I want my tools/apps fast.
SFML is a lot nicer than the GLUT/DirectX bastard projects I used to make.