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

Author Topic: Is there a resolution limit in SFML?  (Read 1492 times)

0 Members and 1 Guest are viewing this topic.

Me-Myself-And-I

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Is there a resolution limit in SFML?
« on: November 03, 2022, 11:50:13 pm »
Is there a resolution limit and if so then what is it?So I loaded a 5760x1080 background into a texture for a scrolling background and I got this error.
"Failed to create texture, its internal size is too high (8192x2048, maximum is 2048x2048)"
Could someone please tell me what causes this error?
The window size is set to 1920x1080.
« Last Edit: November 03, 2022, 11:51:46 pm by Me-Myself-And-I »

kojack

  • Sr. Member
  • ****
  • Posts: 343
  • C++/C# game dev teacher.
    • View Profile
Re: Is there a resolution limit in SFML?
« Reply #1 on: November 04, 2022, 04:10:20 am »
That error is given based on what OpenGL reports as the maximum supported by your system.
What GPU do you have? Older cards used to have a 2048x2048 limit. My RTX2080TI can do 32768x32768.
(I just loaded an 8192x4096 in SFML and rendered it correctly)

Me-Myself-And-I

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Re: Is there a resolution limit in SFML?
« Reply #2 on: November 04, 2022, 09:10:12 pm »
So the error is based on whatever is the limit of the system its run on?So do I just need to make something that scales it down?I thought it was the window resolution that was limited.Otherwise how would a scrolling background be possible if its larger than the window size?

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Is there a resolution limit in SFML?
« Reply #3 on: November 07, 2022, 05:44:43 pm »
It's the graphic card's texture size that has a limit. It's not linked to the size of the window; that's a separate thing. To have scrolling larger than the largest texture, you can simply draw two (or more) textures next to each other (i.e. break a big one into multiple small ones).
Thor has a solution to this.

Anyway, the first thing you could be doing is check the maximum size of the texture allowed by OpenGL on the system (as it could be any system, right?) and act appropriately. I think it's generally accepted that 2048x2048 is an acceptable minimum that you can take for granted.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything