Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old September 19, 2018, 22:27   #1
shirish
Rookie
 
Join Date: Aug 2018
Posts: 22
shirish is on a distinguished road
SDL2 port when ?

Can anybody comment on when can we expect an SDL 2 port , not SDL 1.2 but SDL2 port.
shirish is offline   Reply With Quote
Old September 20, 2018, 00:59   #2
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,503
Derakon is on a distinguished road
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.
Derakon is offline   Reply With Quote
Old September 20, 2018, 01:25   #3
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
Hahaha... oh wow

Quote:
Originally Posted by Derakon View Post
As soon as someone with the necessary time, willingness, and expertise makes one
Nope

Quote:
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...

Quote:
You'd be more than welcome to take a stab at it yourself though.
Whatever for?
t4nk is offline   Reply With Quote
Old September 20, 2018, 01:27   #4
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,503
Derakon is on a distinguished road
Quote:
Originally Posted by t4nk View Post
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!
Derakon is offline   Reply With Quote
Old September 20, 2018, 01:44   #5
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
Quote:
Originally Posted by Derakon View Post
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...
t4nk is offline   Reply With Quote
Old September 20, 2018, 02:14   #6
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
Hey, I found it!
https://github.com/takkaria/angband/...rc/main-sdl2.c

Well, OP, now that you have it, what are you going to do with it?
t4nk is offline   Reply With Quote
Old September 20, 2018, 09:47   #7
shirish
Rookie
 
Join Date: Aug 2018
Posts: 22
shirish is on a distinguished road
Quote:
Originally Posted by t4nk View Post
Hey, I found it!
https://github.com/takkaria/angband/...rc/main-sdl2.c

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

https://paste.debian.net/1043405/

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 -

http://www.libsdl.org/projects/SDL_mixer/

https://github.com/katajakasa/SDL_kitchensink

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.
shirish is offline   Reply With Quote
Old September 20, 2018, 14:34   #8
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
Quote:
Originally Posted by shirish View Post
I tried it actually :-

https://paste.debian.net/1043405/

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)...

Quote:
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 )
t4nk is offline   Reply With Quote
Old September 20, 2018, 14:55   #9
shirish
Rookie
 
Join Date: Aug 2018
Posts: 22
shirish is on a distinguished road
Quote:
Originally Posted by t4nk View Post
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

https://stackoverflow.com/questions/...n-linux-ubuntu

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

https://paste.debian.net/1043458/

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 at 15:50.
shirish is offline   Reply With Quote
Old September 20, 2018, 16:00   #10
t4nk
Swordsman
 
Join Date: May 2016
Posts: 306
t4nk is on a distinguished road
Quote:
Originally Posted by shirish View Post
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).

Quote:
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
t4nk is offline   Reply With Quote
Reply

Tags
libsdl2


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Android-port not work Angrist Vanilla 1 October 14, 2014 04:24
Web Port wilbur07 Vanilla 6 February 27, 2014 14:39
OpenGL port BreathesFire Development 2 November 3, 2011 08:22
[FA] NDS port Donald Jonker Variants 54 October 6, 2011 16:49
[V] Gtk port Magnate Development 1 February 24, 2009 10:48


All times are GMT +1. The time now is 22:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.