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

Author Topic: Failed Loading Texture - Reason Out of Memory  (Read 1373 times)

0 Members and 1 Guest are viewing this topic.

Sparcsky

  • Newbie
  • *
  • Posts: 9
    • View Profile
Failed Loading Texture - Reason Out of Memory
« on: June 06, 2017, 04:30:03 pm »
I'm trying to load a Texture with a size of 32,768 x 4096 but it failed to do so. What does it mean of this error? how can I solve it? also, what is the maximum size SFML can load textures?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10827
    • View Profile
    • development blog
    • Email
Re: Failed Loading Texture - Reason Out of Memory
« Reply #1 on: June 06, 2017, 05:11:11 pm »
First one means that it someone couldn't be opened, e.g. no permission or doesn't exist in the said location.
The second seems to come from stb_image and sounds like you don't have enough RAM to load that image into.

32768x4096 = 512MB and maybe even more when it has to decompress it.

What's that image anyways?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Sparcsky

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Failed Loading Texture - Reason Out of Memory
« Reply #2 on: June 06, 2017, 05:20:51 pm »
I have 8GB ram and only 4GB is in use.

The image is a texture atlas which contains all the game objects that I can use in my game. I put it all into one image to minimise instantiating multiple textures.

Ionut

  • Jr. Member
  • **
  • Posts: 59
  • Guess Who's Back ?
    • View Profile
    • Email
Re: Failed Loading Texture - Reason Out of Memory
« Reply #3 on: June 06, 2017, 06:28:47 pm »
Hmm...that's a BIG image,don't you think?However you could divide the image into multiple spritesheets to use it.But I'm curious what game do you want to make?(Because that spritesheet contains more sprites that I know to count)
Guess Who's Back ?

 

anything