I wouldn't say that, I think it will produce this kind of issue only with high scales.
No. It happens with any scale larger than 1.0.
Anyway, I don't think we can avoid this when using scale or zoom
:cry:
While trying that again out I even stumbled about the next problem (sooorry), this time related to image smoothing.
Original image - 32x32 pixel, drawn 4 times around center of screen, image smoothing is enabled:

Scale factor 1.0 - please note those nasty "circles", where do those come from?!?
Might they come from the "high contrast" checkerboard plus some fancy Moire patterns?
But at a scale factor of 1.0 everything should be copied exactly, shouldn't it?
(sidenote: image is reduced to 256 colors, but even in full color mode those circles are clearly visible)

Scale factor 1.1 - please note the "circles" and please even note the "half size border pixel":

Scale factor 1.5 - including "half size border pixel":

Scale factor 2.0 - including "circles" (even while not that visible) and "half size border pixel":

Scale factor 0.9 - "circles":

Scale factor 0.5 - total bogus?!

SFML revision 449. Help.
// --- includes ---
// windows
#include <windows.h>
// SFML
#include "SFML/Graphics.hpp"
// STL
#include <iostream>
// --- defines ---
#define IMAGE_FILE "checkerboard_1x1.bmp"
// #define IMAGE_FILE "image_1x1.bmp"
const int SCREEN_WIDTH = 200;
const int SCREEN_HEIGHT = 200;
const float SCALE_FACTOR = 1.0f;
const bool IMAGE_SMOOTHING = true;
// --- signal handler ---
BOOL WINAPI MyHandlerRoutine(DWORD dwCtrlType)
{
std::cout << "exiting the hard way" << std::endl;
exit(0);
return TRUE;
}
// --- run ---
bool runSFML()
{
// variables
bool Looping(true);
sf::Event MyEvent;
// render window
sf::RenderWindow MyRenderWindow(sf::VideoMode(SCREEN_WIDTH, SCREEN_HEIGHT), "SFML", sf::Style::Close);
MyRenderWindow.OptimizeForNonOpenGL(true);
MyRenderWindow.SetBackgroundColor(sf::Color(255, 0, 255));
// image
sf::Image MyImage;
if (!MyImage.LoadFromFile(IMAGE_FILE))
{
std::cout << "failed to load image '" << IMAGE_FILE << "'" << std::endl;
return false;
}
MyImage.SetRepeat(true);
MyImage.SetSmooth(IMAGE_SMOOTHING);
// sprite
sf::Sprite MySprite(MyImage);
MySprite.Scale(SCALE_FACTOR, SCALE_FACTOR);
// center of screen
float CenterX = (float) MyRenderWindow.GetWidth() / 2.0f;
float CenterY = (float) MyRenderWindow.GetHeight() / 2.0f;
// big loop
while (Looping)
{
// draw top left sprite
MySprite.SetPosition(CenterX - MySprite.GetWidth(), CenterY - MySprite.GetHeight());
MyRenderWindow.Draw(MySprite);
// draw top right sprite
MySprite.SetPosition(CenterX , CenterY - MySprite.GetHeight());
MyRenderWindow.Draw(MySprite);
// draw bottom left sprite
MySprite.SetPosition(CenterX - MySprite.GetWidth(), CenterY );
MyRenderWindow.Draw(MySprite);
// draw bottom right sprite
MySprite.SetPosition(CenterX , CenterY );
MyRenderWindow.Draw(MySprite);
// display screen
MyRenderWindow.Display();
// poll events
while (MyRenderWindow.GetEvent(MyEvent))
{
// check whether window was closed
if (MyEvent.Type == sf::Event::Closed)
{
Looping = false;
}
// check whether escape was pressed
if ((MyEvent.Type == sf::Event::KeyReleased) && (MyEvent.Key.Code == sf::Key::Escape))
{
Looping = false;
}
}
}
return true;
}
// --- main ---
int main(int argc, char *argv[])
{
// add signal handler routine
if (!SetConsoleCtrlHandler(MyHandlerRoutine, TRUE))
{
std::cout << "failed to add signal handler routine" << std::endl;
exit(1);
}
// start
std::cout << "started" << std::endl;
// run SFML
runSFML();
// stopped
std::cout << "stopped" << std::endl;
return 0;
}