SFML community forums
Help => Graphics => Topic started by: hexvector on July 19, 2010, 11:28:28 pm
-
If I have the following code:
sf::Image bgImage;
if (!bgImage.LoadFromFile("background.jpg")) {
return EXIT_FAILURE;
}
sf::Sprite Background(bgImage);
[... more code ...]
App.Draw(Background);
What is the maximum image size (or is it limited by file/memory size?)
for sf::Image and sf::Sprite?
I know 1900x1200 works but 8000x5000 does not work (app closes).
Thanks.
-
The limit is set by the graphics driver, and depends of course on what graphics card is behind.
Old cards may be limited to 512x512, and the most recent ones can probably reach 8192x8192. Yours is most likely limited to 2048x2048 or 4096x4096.
-
Isn't there a way to query the drivers and get the max texture size that way?
-
SFML 2 has a function for that.
The corresponding OpenGL call is the following:
GLint size;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size);