[Solved] Texture Limitations and Shadow errors

Hello all,
I’ve been experimenting with a game called LBreakoutHD on all of my machines that I own.

However, I have some very old machines that uses OpenGL 1.4 graphics. In this case, and only this case, it appears an issue like this:

Loading theme /usr/share/lbreakouthd/themes/Standard
ERROR: sdl.cpp:124: load(): Texture dimensions are limited to 2048x2048
ERROR: sdl.cpp:85: create(): Texture dimensions can't be 0
ERROR: sdl.cpp:273: createShadow(): Parameter 'dst_pitch' is invalid

I’ve tested it on other machines with OpenGL 2.1, OpenGL 3.1 and it cannot be reproduced there.

I’ve sent the bug report to the original developer (see it for more info, images and more logs available there, LGames / Bugs / #87 [LBreakoutHD] Bonuses and Maluses are not shown (Debian 11 Bullseye)), but he does not have this type of hardware so it will be hard to fix.

However, using LIBGL_ALWAYS_SOFTWARE=1 configuration option workarounds the issue (probably because it uses OpenGL 3.1 software rendering).

The only and last option that I have is to post it here in the forums. Do you have any idea of what could be done to solve this issue?
Thanks in advance.

P.S.: I’m not very familiar with SDL internals, so any help or guidance will be very appreciated!

I don’t see what this has to do with SDL. It’s clear from the error message that the game is creating a texture with dimensions bigger than 2048 pixels, which the underlying hardware doesn’t support.

The other errors look like cascade errors: the texture can’t be created because it’s too big, so the other functions that need that texture fail.

(It’s also possible the texture creation fails if the game is trying to create textures with non-power-of-two dimensions on old hardware that only supports textures with power-of-two dimensions, ie 64, 128, 256, etc)

Also, if the game is using SDL_Renderer: does SDL_Renderer even have an OpenGL 1.x backend?

The other errors look like cascade errors: the texture can’t be created because it’s too big, so the other functions that need that texture fail.

I see. I haven’t considered those were cascade errors, thank you! This might be it.

(It’s also possible the texture creation fails if the game is trying to create textures with non-power-of-two dimensions on old hardware that only supports textures with power-of-two dimensions, ie 64, 128, 256, etc)

Thank you very much for the info!


I don’t see what this has to do with SDL. It’s clear from the error message that the game is creating a texture with dimensions bigger than 2048 pixels, which the underlying hardware doesn’t support.

I can confirm, I’ve tested another different SDL2 game (also with textures and shadows) and seems that the issue is gone, so you have a point, it’s from the game itself :wink:
P.S.: Looking at the sources, seems that the game uses high-quality resolution images. Maybe lowering them a little bit can solve render problems.

aat596@LY910:~/lbreakouthd-1.0.8/src$ grep -nr "SDL_Renderer"
sprite.cpp:22:extern SDL_Renderer *mrc;
selectdlg.cpp:23:extern SDL_Renderer *mrc;
view.cpp:25:extern SDL_Renderer *mrc;
sdl.cpp:24:SDL_Renderer *mrc = NULL; /* main window render context, got only one */
theme.cpp:21:extern SDL_Renderer *mrc;
menu.cpp:22:extern SDL_Renderer *mrc;
sdl.h:28:	SDL_Renderer* mr;

As far as I know, this game is made purely in SDL2. So yes, it has an OpenGL 1.x backend and it renders quite well actually :slight_smile: or at least for simple games with basic shadows.