Fixing the X11 port?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AnonymousHero
    Veteran
    • Jun 2007
    • 1393

    Fixing the X11 port?

    Hi all,

    It seems that the X11 support in Angband is unbearably slow these days, especially at large window sizes -- it's not "flicker", you can literally watch it redraw the dungeon screen when it's maximized. Rather than any specific thing I think this may simply be a case of the port doing everything synchronously and painting every little thing using individual calls to Xlib rather than just generating a bitmap in-memory and blitting it using a single to XRenderImage (or whatever it's called).

    So, why don't I just use the SDL port? The blocker for me is that it doesn't support multiple windows(*). It also has some behavior which seems odd to me UI-wise, but that's minor compared to the lack of multi-window support.

    It's been annoying me so much that I was seriously considering an attempt at fixing it(**). I see two options: 1) Using something like Cairo in the X11 module and using that to render everything to an in-memory surface and blitting it in a single Xlib/Xrender/whatever call, or 2) Adding a port to a different game library than SDL.

    I was looking around for SDL alternatives and happened upon the Allegro game library. Does anyone have any experience with that? I implemented a little demo and the API seems pretty sensible and easy to use, and crucially, it does support multiple OS-level windows.

    I guess this my question to the current developer cabal: Which of these options do you think would be a) most likely to actually make it into Vanilla, and b) the easiest in terms of code?

    (*) I realize that multi-window support has been promised for the in-development SDL 1.3 (which has later been renamed SDL 2.x) for ages. However none of the Linux distros which I'm aware of ship anything later than 1.2.x, and I have absolutely no idea how close 2.x is to release. Given the length of time we've been waiting already, I'm not holding my breath.

    (**) If this happens, it's at least a few months out -- too busy and worn-out to do any serious hacking at the moment.
    Last edited by AnonymousHero; October 6, 2012, 11:37.
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9637

    #2
    There is one big reason to keep the x11 port - running the borg in xscreensaver.

    That said, I'm sure if there were a functional Allegro port, it would be happily adopted. Ease of coding? I know nothing.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • Magnate
      Angband Devteam member
      • May 2007
      • 5110

      #3
      Originally posted by AnonymousHero
      Hi all,

      It seems that the X11 support in Angband is unbearably slow these days, especially at large window sizes -- it's not "flicker", you can literally watch it redraw the dungeon screen when it's maximized. Rather than any specific thing I think this may simply be a case of the port doing everything synchronously and painting every little thing using individual calls to Xlib rather than just generating a bitmap in-memory and blitting it using a single to XRenderImage (or whatever it's called).

      So, why don't I just use the SDL port? The blocker for me is that it doesn't support multiple windows(*). It also has some behavior which seems odd to me UI-wise, but that's minor compared to the lack of multi-window support.

      It's been annoying me so much that I was seriously considering an attempt at fixing it(**). I see two options: 1) Using something like Cairo in the X11 module and using that to render everything to an in-memory surface and blitting it in a single Xlib/Xrender/whatever call, or 2) Adding a port to a different game library than SDL.

      I was looking around for SDL alternatives and happened upon the Allegro game library. Does anyone have any experience with that? I implemented a little demo and the API seems pretty sensible and easy to use, and crucially, it does support multiple OS-level windows.

      I guess this my question to the current developer cabal: Which of these options do you think would be a) most likely to actually make it into Vanilla, and b) the easiest in terms of code?
      TINC, of course.

      a) is easy: anything submitted as a pull request on github that actually works will be included in 3.5 - improved X11, or Allegro, or both.

      b) is harder: the X11 port is ancient but also relatively simple: it might not be too hard to 'fix' it. But writing a frontend from scratch is also not supposed to be hard in Angband, as there are many to learn from. (Disclaimer: I don't do UI stuff.)

      SDL 1.3 is the Duke Nukem Forever of libraries. When it finally arrives it will be ludicrously out of date.
      "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

      Comment

      • fph
        Veteran
        • Apr 2009
        • 1030

        #4
        Originally posted by Nick
        There is one big reason to keep the x11 port - running the borg in xscreensaver.
        If that's the only reason, wouldn't it be easier to adapt the screensaver borg to use SDL, rather than maintaining an additional port just for it?
        --
        Dive fast, die young, leave a high-CHA corpse.

        Comment

        • Magnate
          Angband Devteam member
          • May 2007
          • 5110

          #5
          Originally posted by fph
          If that's the only reason, wouldn't it be easier to adapt the screensaver borg to use SDL, rather than maintaining an additional port just for it?
          The other good reason is that almost every unix installation in the world has the X libs and should be able to run the X11 port out of the box. Not all will have libs for SDL, Allegro, GTK or even ncursesw.
          "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

          Comment

          Working...
          😀
          😂
          🥰
          😘
          🤢
          😎
          😞
          😡
          👍
          👎