1
Graphics / Saving vertex Array as image
« on: August 31, 2020, 07:44:55 am »
So, i have successfully used vertex array to draw graphics on the screen faster. Now is the time to save the contents of the window as an image. I tried to do the following but it results in either black image, blurry image, contents of the wrong frame etc.
sf::Vector2u windowSize = window.getSize();
sf::Texture texture;
texture.create(windowSize.x, windowSize.y);
texture.update(window);
sf::Image screenshot = texture.copyToImage();
screenshot.saveToFile("maze_generator.png");
window.close();
What options do i have while saving the vertex array as image
sf::Vector2u windowSize = window.getSize();
sf::Texture texture;
texture.create(windowSize.x, windowSize.y);
texture.update(window);
sf::Image screenshot = texture.copyToImage();
screenshot.saveToFile("maze_generator.png");
window.close();
What options do i have while saving the vertex array as image