1
General / SFML program only works on my PC
« on: January 25, 2010, 08:29:09 pm »
Woops, figured it out. My program was trying to open a window bigger than their screen resolution.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
In SFML, if you draw a child Drawable while drawing a parent one (ie. in its Render function), the child automatically inherits its transformations (and color in SFML 2).
class Sprites : public sf::Drawable
{
void Draw(sf::RenderWindow& targetScreen)
{
for(iterator = sprites.begin(); iterator != sprites.end(); iterator++)
targetScreen.Draw(*iterator);
}
std::vector<sf::Sprite> sprites;
};
Sprites someSprites;
someSprites.SetRotation(75.f);
someSprites.Draw(someWindow);