SDL2 port when ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shirish
    Rookie
    • Aug 2018
    • 23

    SDL2 port when ?

    Can anybody comment on when can we expect an SDL 2 port , not SDL 1.2 but SDL2 port.
  • Derakon
    Prophet
    • Dec 2009
    • 9022

    #2
    As soon as someone with the necessary time, willingness, and expertise makes one. So far as I'm aware, nobody has expressed any interest in doing that yet. You'd be more than welcome to take a stab at it yourself though.

    Comment

    • t4nk
      Swordsman
      • May 2016
      • 336

      #3
      Hahaha... oh wow

      Originally posted by Derakon
      As soon as someone with the necessary time, willingness, and expertise makes one
      Nope

      So far as I'm aware, nobody has expressed any interest in doing that yet.
      Hey Derakon... what if I told you that someone has already written an SDL2 frontend for Angband years ago? I'm not talking about textui2, but an honest-to-god frontend for Ben Harrison's z-term.c...

      You'd be more than welcome to take a stab at it yourself though.
      Whatever for?

      Comment

      • Derakon
        Prophet
        • Dec 2009
        • 9022

        #4
        Originally posted by t4nk
        Hey Derakon... what if I told you that someone has already written an SDL2 frontend for Angband years ago? I'm not talking about textui2, but an honest-to-god frontend for Ben Harrison's z-term.c...
        Sounds like I need to eat some crow then. I sincerely apologize!

        Comment

        • t4nk
          Swordsman
          • May 2016
          • 336

          #5
          Originally posted by Derakon
          Sounds like I need to eat some crow then. I sincerely apologize!
          No problem. I think everyone just forgot about it after this story with rewriting the UI... I also forgot (hence my "oh wow" ). So now that I remembered, I wonder what happened with this code? I don't have it, I only have textui2, cloned from Takkaria's repo (which also doesn't seem to have it)... Maybe it's lost forever. Meh, whatever...

          Comment

          • t4nk
            Swordsman
            • May 2016
            • 336

            #6
            Hey, I found it!


            Well, OP, now that you have it, what are you going to do with it?

            Comment

            • shirish
              Rookie
              • Aug 2018
              • 23

              #7
              Originally posted by t4nk
              Hey, I found it!


              Well, OP, now that you have it, what are you going to do with it?
              I tried it actually :-

              Code:
              ~/games/takkaria-angband$ git-info
              
              ## Remote URLs:
              
              origin	https://github.com/takkaria/angband.git (fetch)
              origin	https://github.com/takkaria/angband.git (push)
              
              ## Remote Branches:
              
                origin/HEAD -> origin/master
                origin/avg-dmg
                origin/los-searching
                origin/master
                origin/pr-auto-books
                origin/pr-heal-other
                origin/pr-slot-sizes
                origin/text-out-cleanup
                origin/wip-textui2
              
              ## Local Branches:
              
              * master
              
              ## Most Recent Commit:
              
              commit 6a5df0b662caca9fff9d332c1ec6b21e7b36e595
              Author: Nick McConnell <nckmccnnll@gmail.com>
              
                  Remove trap, door and stair detection
              
              Type 'git log' for more commits, or 'git show <commit id>' for full commit details.
              
              ## Configuration (.git/config):
              
              user.name=shirish agarwal
              user.email=xxxxxxxxxxxx
              core.repositoryformatversion=0
              core.filemode=true
              core.bare=false
              core.logallrefupdates=true
              remote.origin.url=https://github.com/takkaria/angband.git
              remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
              branch.master.remote=origin
              branch.master.merge=refs/heads/master



              The compilation fails as it looks for libsdl1.2 config

              The relevant bits -

              Code:
              checking for sdl-config... no
              checking for SDL - version >= 1.2.10... no
              *** The sdl-config script installed by SDL could not be found
              *** If SDL was installed in PREFIX, make sure PREFIX/bin is in
              *** your path, or set the SDL_CONFIG environment variable to the
              *** full path to sdl-config.
              checking for Mix_OpenAudio in -lSDL_mixer... no
              where it should be looking for libsdl2-config :-
              Code:
              $ sdl2-config --version
              2.0.8
              FWIW, there are two libsdl2 audio libraries that upstream could look at -





              The first one is an all encompassing one, the second one is supposedly more narrower in scope.

              I am no developer but can help with compiling and telling what seems to come up short.

              Comment

              • t4nk
                Swordsman
                • May 2016
                • 336

                #8
                Originally posted by shirish
                I tried it actually :-



                The compilation fails as it looks for libsdl1.2 config
                Indeed, since it was never incorporated into Angband. I recall you need to run autoconf with "--disable-sdl" actually (which disables SDL1), and then manually hack the Makefile.std (that's what I did back then)...

                I am no developer but can help with compiling and telling what seems to come up short.
                You can try to go back futher in this branch and look for something like Makefile.sdl2... although it probably shouldn't be there. If not, I can write the Makefile, but not right now, maybe in several days (also, I still don't know how autoconf works )

                Comment

                • shirish
                  Rookie
                  • Aug 2018
                  • 23

                  #9
                  Originally posted by t4nk
                  Indeed, since it was never incorporated into Angband. I recall you need to run autoconf with "--disable-sdl" actually (which disables SDL1), and then manually hack the Makefile.std (that's what I did back then)...


                  You can try to go back futher in this branch and look for something like Makefile.sdl2... although it probably shouldn't be there. If not, I can write the Makefile, but not right now, maybe in several days (also, I still don't know how autoconf works )
                  Hi,

                  It actually uses autogen.sh .

                  When I run ./autogen.sh the following takes place -

                  Code:
                  ~/games/takkaria-angband$ ./autogen.sh
                  *info* running aclocal (-I m4)
                  *info* running autoheader
                  *info* running autoconf
                  which forms the .configure script

                  The Makefile is generated when the .configure script is taken care of . Once it is complete, you get a makefile.

                  If I just do -

                  Code:
                  ~/games/takkaria-angband$ ./configure --with-no-install
                  then a makefile will be generated which has the sdl frontline disabled.

                  There is a Makefile though but that's in -

                  Code:
                  ~/games/takkaria-angband/src$ cat Makefile.src | grep sdl
                  SDLMAINFILES = main-sdl.o
                  SNDSDLFILES = snd-sdl.o
                  There is this Q&A on stackoverflow I saw but dunno if its just what is needed

                  I'm currently doing some C programming and I actually want to use the SDL library. I want to build a Small 2D game in C on Linux to sharp my skills a bit. My issue is I'm not a super Makefile user...


                  Reading it few times it seems it needs the following info. -
                  Code:
                  /usr/bin/sdl2-config
                  /usr/include/SDL2/SDL.h
                  /usr/lib/x86_64-linux-gnu/libSDL2.so
                  for libsdl2 and -

                  Code:
                  /usr/include/SDL2/SDL_mixer
                  /usr/lib/x86_64-linux-gnu/libSDL2_mixer.so
                  Edit - I found what needs to be fixed -

                  from https://wiki.libsdl.org/FAQLinux#How..._my_project.3F

                  it seems acinclude.m4 is what needs to be fixed -

                  it needs https://hg.libsdl.org/SDL/file/default/sdl2.m4

                  I did try to do a copy and replace but didn't get far.

                  This is what I did with acinclude.m4



                  I get the following errors when I try to ./autogen.sh it -

                  Code:
                  ~/games/takkaria-angband$ ./autogen.sh
                  *info* running aclocal (-I m4)
                  acinclude.m4:157: warning: the serial number must appear before any macro definition
                  configure.ac:269: warning: macro 'AM_PATH_SDL' not found in library
                  *info* running autoheader
                  *info* running autoconf
                  configure.ac:269: error: possibly undefined macro: AM_PATH_SDL
                        If this token and others are legitimate, please use m4_pattern_allow.
                        See the Autoconf documentation.
                  *error* autoconf failed. (exit code = 1)
                  Last edited by shirish; September 20, 2018, 14:50.

                  Comment

                  • t4nk
                    Swordsman
                    • May 2016
                    • 336

                    #10
                    Originally posted by shirish
                    Hi,

                    It actually uses autogen.sh .

                    When I run ./autogen.sh the following takes place -

                    Code:
                    ~/games/takkaria-angband$ ./autogen.sh
                    *info* running aclocal (-I m4)
                    *info* running autoheader
                    *info* running autoconf
                    which forms the .configure script

                    The Makefile is generated when the .configure script is taken care of . Once it is complete, you get a makefile.
                    Yeah, in principle, it should be simple enough. Replace main-sdl.c (SDL1 version) with main-sdl2.c, replace all references to main-sdl.c with references to main-sdl2.c in autogen stuff, link with SDL2 instead of SDL1, and then it should work. I just don't know how to do it
                    Code:
                    /usr/lib/x86_64-linux-gnu/libSDL2.so
                    /usr/lib/x86_64-linux-gnu/libSDL2_mixer.so
                    You'll also need libSDL2_ttf.so (for loading fonts) and libSDL2_image.so (for loading tiles).

                    I get the following errors when I try to ./autogen.sh it -

                    Code:
                    ~/games/takkaria-angband$ ./autogen.sh
                    *info* running aclocal (-I m4)
                    acinclude.m4:157: warning: the serial number must appear before any macro definition
                    configure.ac:269: warning: macro 'AM_PATH_SDL' not found in library
                    *info* running autoheader
                    *info* running autoconf
                    configure.ac:269: error: possibly undefined macro: AM_PATH_SDL
                          If this token and others are legitimate, please use m4_pattern_allow.
                          See the Autoconf documentation.
                    *error* autoconf failed. (exit code = 1)
                    Well, if you're serious about it, I'll write the Makefile. It'll be simpler than trying to figure out autoconf The only problem with that is I now have a new hobby , which is writing a roguelike, loosely inspired by (among other things) Angband. And I'm not using C or Make for that, so it'll cause me some moral suffering to go back to those, and I need to muster my strength first

                    Comment

                    • shirish
                      Rookie
                      • Aug 2018
                      • 23

                      #11
                      Originally posted by t4nk
                      Yeah, in principle, it should be simple enough. Replace main-sdl.c (SDL1 version) with main-sdl2.c, replace all references to main-sdl.c with references to main-sdl2.c in autogen stuff, link with SDL2 instead of SDL1, and then it should work. I just don't know how to do it
                      Code:
                      /usr/lib/x86_64-linux-gnu/libSDL2.so
                      /usr/lib/x86_64-linux-gnu/libSDL2_mixer.so
                      You'll also need libSDL2_ttf.so (for loading fonts) and libSDL2_image.so (for loading tiles).
                      All of these I have -

                      Code:
                      /usr/lib/x86_64-linux-gnu/libSDL2_ttf.so 
                      /usr/lib/x86_64-linux-gnu/libSDL2_image.so
                      As far main-sdl.c I didn't find any changes to do apart from the comments -

                      Code:
                      ~/games/takkaria-angband/src$ cat main-sdl.c | grep endif
                      #endif
                      #endif
                      #endif /* USE_SDL2 */
                      Code:
                      games/takkaria-angband/src$ cat main-sdl.c | grep ifdef
                      #ifdef USE_SDL2
                      Originally posted by t4nk
                      Well, if you're serious about it, I'll write the Makefile. It'll be simpler than trying to figure out autoconf The only problem with that is I now have a new hobby , which is writing a roguelike, loosely inspired by (among other things) Angband. And I'm not using C or Make for that, so it'll cause me some moral suffering to go back to those, and I need to muster my strength first
                      There might be other things which might be contributing to the complexity -

                      My tooling -

                      Code:
                      $ libtool --version
                      libtool (GNU libtool) 2.4.6
                      Written by Gordon Matzigkeit, 1996
                      
                      Copyright (C) 2014 Free Software Foundation, Inc.
                      This is free software; see the source for copying conditions.  There is NO
                      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
                      Code:
                      $ autoconf --version
                      autoconf (GNU Autoconf) 2.69
                      Copyright (C) 2012 Free Software Foundation, Inc.
                      License GPLv3+/Autoconf: GNU GPL version 3 or later
                      <http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      
                      Written by David J. MacKenzie and Akim Demaille.
                      Code:
                      $ automake --version
                      automake (GNU automake) 1.16.1
                      Copyright (C) 2018 Free Software Foundation, Inc.
                      License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl-2.0.html>
                      This is free software: you are free to change and redistribute it.
                      There is NO WARRANTY, to the extent permitted by law.
                      
                      Written by Tom Tromey <tromey@redhat.com>
                             and Alexandre Duret-Lutz <adl@gnu.org>.
                      Code:
                      $ gcc --version
                      gcc (Debian 8.2.0-6) 8.2.0
                      Copyright (C) 2018 Free Software Foundation, Inc.
                      This is free software; see the source for copying conditions.  There is NO
                      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
                      so it's possible there might be bug-fixes, regressions etc. that I do not know about . As shared before I'm not a developer so don't know anything about C.

                      I personally like cmake for compiling as things are lot smoother and it's easier to debug, give feedback to developers etc. but it is what it is

                      Comment

                      • t4nk
                        Swordsman
                        • May 2016
                        • 336

                        #12
                        OK, shirish, tell you what. When I'll have some free time and gather some strength (hopefully in the next several days) I'll fork Angband's repo on github, add SDL2 frontend to it, and post compilation instructions here (in this forum). Who knows, maybe I'll even make pull request to the upstream again... SDL1 is really getting obsolete... but then, so is Angband

                        Comment

                        • t4nk
                          Swordsman
                          • May 2016
                          • 336

                          #13
                          Originally posted by t4nk
                          You can try to go back futher in this branch and look for something like Makefile.sdl2... although it probably shouldn't be there.
                          Interestingly, it's actually there: https://github.com/takkaria/angband/.../Makefile.sdl2
                          So I guess the only thing to do is to add the module to the list in main.c...
                          Now the problem is remembering how Github works. And that also reminds me that Github was bought by the oligarchs from Microsoft. Argh! Well, life is cruel and unfair... I'll see what I can do In a couple of days, maybe?

                          Comment

                          • shirish
                            Rookie
                            • Aug 2018
                            • 23

                            #14
                            Originally posted by t4nk
                            Interestingly, it's actually there: https://github.com/takkaria/angband/.../Makefile.sdl2
                            So I guess the only thing to do is to add the module to the list in main.c...
                            Now the problem is remembering how Github works. And that also reminds me that Github was bought by the oligarchs from Microsoft. Argh! Well, life is cruel and unfair... I'll see what I can do In a couple of days, maybe?
                            Sure, take your time, although reading the makefile.sdl2 from whatever I could understand it is/was for the windows port and not *ix so it probably will need quite a bit of change

                            If you can't stand github.com I could put the takkaria's port on salsa.debian.org . I have access there. It's a gitlab instance. We could also use gitlab's own instance as well.

                            From planning to production, bring teams together in one application. Ship secure code more efficiently to deliver value faster.

                            Comment

                            • t4nk
                              Swordsman
                              • May 2016
                              • 336

                              #15
                              Originally posted by shirish
                              Sure, take your time, although reading the makefile.sdl2 from whatever I could understand it is/was for the windows port and not *ix so it probably will need quite a bit of change
                              It's definitely for Unix, even specifically for Debian Wheezy I know it because I made it out of Angband's Makefile.std (which didn't work and probably still doesn't). Perhaps you're thinking about another Makefile in this directory? (Makefile.ms.ui2, which is an entirely different thing).

                              If you can't stand github.com I could put the takkaria's port on salsa.debian.org . I have access there. It's a gitlab instance. We could also use gitlab's own instance as well.

                              https://about.gitlab.com/
                              Thanks for the offer... the funny thing is, this port is actually written by me in the summer of 2016. And then everyone, including myself, forgot about it. Which is why I was shocked when you posted It's a long story... hmm... actually, it's a reasonably short story. It goes like this:

                              After writing the SDL2 port I decided that Angband's entire UI is outdated and has too many hacks (accumulated over decades) and needs to be rewritten. So I did rewrite the UI and it turned out pretty good (opinion ). However, Angband's UI is large (about 1/3 of the whole program) and it was never pulled into the official repo. Currently, Angband's devteam seems to consist of one person who has limited time to work on it and there are just no resources for such a massive disruption. Meanwhile, everyone's forgotten that there is, in fact, a complete and working SDL2 frontend...

                              So... question to the maintainer:
                              NIck, let's be realistic here, textui2 will never make it into Angband. However, main-sdl2.c is a plausible addition to the game. It's just another frontend, after all. SDL1 is an obsolete library, and SDL2 port, as you know, has more and better functionality. I can register on Github again and send a pull request. What do you say?
                              If not, I'd rather go with shirish's suggestion and use Gitlab.
                              Last edited by t4nk; September 21, 2018, 14:17.

                              Comment

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