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

Author Topic: Loading (Big/Non-Power 2) Images Error  (Read 3560 times)

0 Members and 2 Guests are viewing this topic.

Gatts

  • Newbie
  • *
  • Posts: 3
    • View Profile
Loading (Big/Non-Power 2) Images Error
« on: September 16, 2010, 10:56:51 pm »
Hi there,

For my project i'm using large sprite sheets which i have no control over the size. (It's user defined)

The problem is, using a large non-power of the 2 (The dimensions are uniform either) when i create the image (without even trying to render or create a sprite for it) this big large white block shows on the screen.



I've tried loading it directly into a memory stream and many other methods but i get no results.

Any help would be greatly appreciated. Thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Loading (Big/Non-Power 2) Images Error
« Reply #1 on: September 16, 2010, 11:05:53 pm »
This usually happens when the image is bigger than the maximum supported texture size (this depends on your graphics card), but it's not supposed to happen for non power of two image dimensions.
Laurent Gomila - SFML developer

Gatts

  • Newbie
  • *
  • Posts: 3
    • View Profile
Loading (Big/Non-Power 2) Images Error
« Reply #2 on: September 16, 2010, 11:11:09 pm »
Quote from: "Laurent"
This usually happens when the image is bigger than the maximum supported texture size (this depends on your graphics card), but it's not supposed to happen for non power of two image dimensions.


Thanks for the swift reply, well, i've looked further into it and it seems it's not to do with the non-power of two images anymore.

The problem is because the sprite sheets can sometimes be very large like 256x8704. I know it's an absurd size, but this is the absolute peak and i got the biggest sheet i could find. I might have to somehow split the image into several manageable chunks maybe.

The problem is, i've had this working with different engines like SDL, ClanLib, XNA and SlimDX and it loaded fine  :?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Loading (Big/Non-Power 2) Images Error
« Reply #3 on: September 16, 2010, 11:19:41 pm »
Quote
The problem is, i've had this working with different engines like SDL, ClanLib, XNA and SlimDX and it loaded fine

Yes, because:
- SDL doesn't use hardware acceleration at all, so image size doesn't matter
- ClanLib and XNA are not as low-level as SFML and can handle this kind of stuff (ie. they can split the image automatically and handle it internally)
- if SlimDx is a pure Direct3D wrapper, it must have the same limitation; I don't know much about it though
Laurent Gomila - SFML developer

Gatts

  • Newbie
  • *
  • Posts: 3
    • View Profile
Loading (Big/Non-Power 2) Images Error
« Reply #4 on: September 16, 2010, 11:25:44 pm »
Quote from: "Laurent"
Quote
The problem is, i've had this working with different engines like SDL, ClanLib, XNA and SlimDX and it loaded fine

Yes, because:
- SDL doesn't use hardware acceleration at all, so image size doesn't matter
- ClanLib and XNA are not as low-level as SFML and can handle this kind of stuff (ie. they can split the image automatically and handle it internally)
- if SlimDx is a pure Direct3D wrapper, it must have the same limitation; I don't know much about it though


Thanks for the input, i'm now working on expanding my class to split images up in to manageable chunks. It'll work out better anyway.

I love SFML so far, i'm using it in conjuction with WPF and so far everything is working out fantastic. :)

 

anything