Oh, right, I see now that we have been talking past each other..
When I said "view" I meant "sf::View", which cannot rotate. Yet... :wink:
If I move the position of the center of the sf::View, the center of the MyScene object, and thus the center of rotation, will stay the same, and the rotating camera effect will break.
If I just set the center of the MyScene object to the center of the sf::View, everything I render in the MyScene will move with the camera, and thus will not appear to move at all.
So I guess I could do something like:
class MyScene : public sf::Drawable
{
virtual void Render(const sf::RenderWindow& Window) const
{
// Draw your scene here with calls to Window.Draw(...)
}
}
// In your main...
MyScene Scene;
sf::View Camera;
// Move the camera
float newX = 100.f;
float newY = -100.f;
Camera.setPosition( newX, newY );
Scene.setCenter( newX, newY );
Scene.setPosition( -newX, -newY );
...
Scene.Rotate(45); // Rotate the entire scene
App.Draw(Scene); // Draw the entire scene
But isn't there a prettier way?
I suppose I could incorporate the camera into the MyScene class.. How would you do it?