Hi, I'm using a 64 by 32 pixels window, and this happens :
64 by 32:
The magenta is the "window.clear" color, red is an sf::image with the same width and height as the window, so it should cover the whole window, but it doesn't. I though I was doing something wrong, until I decided to see what happens if I increase the window and image sizes, and it works then as intended - they are still equal - :
640 by 320:
The problem occurs when the width is 115 or less, not sure if it is an sfml bug, or if I'm missing something. Here's the code:
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
int main()
{
const int h = 32;
const int w = 64;
sf::RenderWindow window(sf::VideoMode(w, h), "Chip_8");
sf::Image image;
image.create(w, h, sf::Color::Red);
sf::Texture timage;
timage.loadFromImage(image);
sf::Sprite simage(timage);
window.setSize( sf::Vector2u(600, 300));
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear(sf::Color::Magenta);
timage.update(image);
window.draw(simage);
window.display();
}
return 0;
}