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

Author Topic: Maximum size of sf::Image and sf::Sprite  (Read 3921 times)

0 Members and 1 Guest are viewing this topic.

hexvector

  • Newbie
  • *
  • Posts: 3
    • View Profile
Maximum size of sf::Image and sf::Sprite
« on: July 19, 2010, 11:28:28 pm »
If I have the following code:

Code: [Select]
   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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Maximum size of sf::Image and sf::Sprite
« Reply #1 on: July 19, 2010, 11:31:47 pm »
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.
Laurent Gomila - SFML developer

Antidote

  • Newbie
  • *
  • Posts: 35
    • View Profile
Maximum size of sf::Image and sf::Sprite
« Reply #2 on: July 25, 2010, 12:55:47 am »
Isn't there a way to query the drivers and get the max texture size that way?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Maximum size of sf::Image and sf::Sprite
« Reply #3 on: July 25, 2010, 10:21:28 am »
SFML 2 has a function for that.

The corresponding OpenGL call is the following:
Code: [Select]
GLint size;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size);
Laurent Gomila - SFML developer

 

anything