Menu

#75 SDL_CreateTextureFromSurface() failed: Texture dimensions are limited to 2048x2048

v1.0 (example)
open
nobody
None
5
2017-07-11
2016-12-14
No

Hi,
it seems i'm encountering something similar to bug #72, but instead of being limited to 4096x4096, my hardware (a raspberry pi) has a maximum texture size of 2048x2048.

[...]
Setting video mode...
Renderer: opengles2 (max texture size: 2048x2048)
Loading fonts...
Loading graphics and sounds...
Starting sound player...
Starting ADL music player...
Starting main menu...
Now playing DUNE7.ADL!
Initializing game...
Now playing DUNE2.ADL!
SCENA001.INI:53: Invalid or occupied position for 'Soldier': '3985'!
Briefing...
Now playing DUNE7.ADL!
Starting game...
terminate called after throwing an instance of 'std::invalid_argument'
  what():  misc/draw_util.cpp:290: convertSurfaceToTexture(): SDL_CreateTextureFromSurface() failed: Texture dimensions are limited to 2048x2048

Is it possible for you to do something ? or is the hardware just too low ?
Thanks

Discussion

  • RichieQ

    RichieQ - 2016-12-15

    Bug #72 resulted in some changes to not exceed a texture size of 2048x2048 (commit b3cd9b on 4.9.2016). Which version of Dune Legacy are you using?

     
  • Sébastien Noel

    Sébastien Noel - 2016-12-15

    i used a GIT snapshot (master branch), same day as the bug report was submitted. c68e20ad

     
  • RichieQ

    RichieQ - 2016-12-15

    This was indeed a problem. I just commited a change for this. Would be interesting to know if there are further such problems on the raspberry pi.

     
  • Sébastien Noel

    Sébastien Noel - 2016-12-15

    Thanks alot for the quick update :)
    With b81954d1 it doesn't crash anymore, the game start correctly, but it's still not playable on the rpi :(
    everything is OK in the menu and in the "intro", but in the game the screen is flickering/flashing (sorry for the lack of a better word) like if the screen goes to black between each refresh. if you're not seeing this in X11 backend on x86, chances are that this is a bug in the rpi-specific backend of SDL2 :/

     
  • RichieQ

    RichieQ - 2016-12-15

    This seems to be a more serious problem with the raspberry pi graphics driver. Maybe you can try with a more up-to-date distribution for the raspberry. Are other SDL2 games are working?

     
  • Sébastien Noel

    Sébastien Noel - 2016-12-15

    Plenty of other SDL2 games are working: i tried lots of scummvm games (monkey island, myst, sam&max, ...), quake3, gemrb games (baldur's gates, icewind dale), corsix-th (theme hospital), ...

     
  • Sébastien Noel

    Sébastien Noel - 2016-12-16

    in the main game loop (Game.cpp - line ~1150), multiple calls to SDL_RenderPresent() seems the cause for the flickering.
    http://stackoverflow.com/questions/39236672/flickering-while-drawing-multiple-sdl-texture-using-sdl2
    i did remove the first one and the flickering is gone

    --- a/src/Game.cpp
    +++ b/src/Game.cpp
    @@ -1154,7 +1154,7 @@ void Game::runMainLoop() {
    
             drawScreen();
    
    -        SDL_RenderPresent(renderer);
    +        //SDL_RenderPresent(renderer);
    
             SDL_SetRenderTarget(renderer, nullptr);
             SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
    

    but unfortunately, even if the game is rendered correctly now, everything is slow (mouse movements, units movements, ...) , too slow to enjoy the game :(

     
  • RichieQ

    RichieQ - 2016-12-17

    I guess most games you listed do not use SDL_Textures (the hardware-accelerated drawing provided by SDL2 but either use the non-accelerated drawing with SDL_Surfaces or OpenGL directly).

    The bug you descibed sounds like this SDL bug: https://bugzilla.libsdl.org/show_bug.cgi?id=3455 . Maybe you can try to set the display resolution to 800x600 or even below; this might also improve performance.

    BTW: The change you made has probably disabled sandworm shimmering and sonic waves.

     
  • ah

    ah - 2017-07-11

    The flickering is a Dune Legacy bug, as far as I can tell. You're calling SDL_RenderPresent in such a way that you're presenting the contents of an old framebuffer on screen.
    The pattern where you call SDL_RenderPresent twice in quick succession with little drawing in between is incorrect. I have heavy flickering on Linux + NVIDIA, where every other frame shown is the mentat screen. This makes it disappear:

    diff --git a/src/Game.cpp b/src/Game.cpp
    index 98279c7..e11eafb 100644
    --- a/src/Game.cpp
    +++ b/src/Game.cpp
    @@ -1155,7 +1155,7 @@ void Game::runMainLoop() {

         drawScreen();
    
    • SDL_RenderPresent(renderer);
      +// SDL_RenderPresent(renderer);

       SDL_SetRenderTarget(renderer, nullptr);
       SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
      
     

Log in to post a comment.