Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

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.


Topics - Umbre

Pages: [1]
1
Graphics / Draw pixels in real-time
« on: March 15, 2024, 02:33:46 pm »
Hello,
I'm looking to draw pixels in real-time with SFML, and I'm hesitating between sf::Image and sf::RenderTexture. What happens internally with these classes? What's the best practice between this,
sf::Image image;
image.create(1920, 1080);

image.setPixel(100, 200, sf::Color::Red);

sf::Texture texture;
texture.loadFromImage(image);
sf::Sprite sprite(texture);
window.clear();
window.draw(sprite);
window.display();
 
and that ?
sf::RenderTexture renderTexture;
renderTexture.create(1920, 1080);

renderTexture.clear();
sf::Vertex vertices[] = {sf::Vertex(sf::Vector2f(100, 200), sf::Color::Red)};
renderTexture.draw(vertices, 1, sf::Points);
renderTexture.display();

sf::Sprite sprite(renderTexture.getTexture());
window.clear();
window.draw(sprite);
window.display();
 


2
Window / full screen
« on: February 24, 2024, 05:55:15 pm »
Hello,
I cannot open a full screen window on MacBook M2 Pro. getFullscreenModes() returns nothing. What can I do?

Pages: [1]
anything