Hello:
For the images, they need to be set to the file itself, not the link:
This:
http://www.freeimagehosting.net/newuploads/0f786.pngNot:
http://www.freeimagehosting.net/0f786TL;DR - Solution: For now, use RenderWindow's Create function to change the resolution and Views to change the "zoom" of the screen.I have been able to replicate this SetSize problem. I created a 1 x 1 render window, set up a sprite, and then before calling the main loop I re-sized the window to 1280 x 1024. The image was proportionally offset by the window border and title bar's sizes. On my Windows XP, the left of the sprite was 11 pixels away from the border, which is 4 pixels wide, and the top of the sprite was 376 pixels away from the bottom of the title bar, which is 30 pixels tall. The greater the
proportional difference between the original window and the re-sized window, the greater the offset will be (as far as I can tell, this only occurs when going from a smaller size to larger). Not only that, the window's contents will be similarly stretched out. Consider the following code:
#include <SFML/Graphics.hpp>
int main()
{
// Create the main window
sf::RenderWindow App(sf::VideoMode(500, 500, 32), "SFML Events");
sf::Shape Rect = sf::Shape::Rectangle(1, 1, 20, 20, sf::Color::Green);
App.SetSize (800, 800);
// Start main loop
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close();
// Escape key : exit
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close();
}
// Get elapsed time
float ElapsedTime = App.GetFrameTime();
// Move the shape
if (App.GetInput().IsKeyDown(sf::Key::Left)) Rect.Move(-80 * ElapsedTime, 0);
if (App.GetInput().IsKeyDown(sf::Key::Right)) Rect.Move( 80 * ElapsedTime, 0);
if (App.GetInput().IsKeyDown(sf::Key::Up)) Rect.Move(0, -80 * ElapsedTime);
if (App.GetInput().IsKeyDown(sf::Key::Down)) Rect.Move(0, 80 * ElapsedTime);
// Clear the screen (fill it with white color)
App.Clear(sf::Color(255, 255, 255));
// Draw shape
App.Draw(Rect);
// Display window on screen
App.Display();
}
return EXIT_SUCCESS;
}
Which produces a small square that you can move around. But only change the initial width and height of the RenderWindow to 50, 50 and the square will then be stretched out along the y axis.
Since I've only been using SFML for about a week, and I don't have much programming experience since it's only a hobby for me, I don't know what the culprit is, or of any other solution than to use RenderWindow's Create function to change the resolution, and setting a View to change the "zoom" of the Window content. Sorry I couldn't be of more help!