Temple of The Roguelike Forums

Development => Programming => Topic started by: summoner on May 20, 2015, 09:31:48 AM

Title: Any C/C++ library for roguelike without SDL dependency?
Post by: summoner on May 20, 2015, 09:31:48 AM
For my current project,  I already implemented my input and display function.
Are there any C/C++ library for roguelike without any dependencies?

libtcod is a good library but it depends on SDL.

Thank you very much for your help
Title: Re: Any C/C++ library for roguelike without SDL dependency?
Post by: TheCreator on May 20, 2015, 10:45:03 AM
It depends what you call a 'dependency', why you want to avoid it, and what you need the library for. "C/C++ roguelike" is not a very precise term (the very 'roguelike' word is pretty vague these days). At least say if this is going to be ASCII or tiles, and which platform are you targeting.
Title: Re: Any C/C++ library for roguelike without SDL dependency?
Post by: Cfyz on May 20, 2015, 11:28:09 AM
Do you mean non-windowing functionality like FOV and generators? Obviously libtcod does not use SDL for anything besides windowing so I believe you can get rid of it by modifying makefiles to exclude the console subsystem.

As for other utility/mechanics C/C++ libraries, sadly I do not know about any.
Title: Re: Any C/C++ library for roguelike without SDL dependency?
Post by: summoner on May 20, 2015, 11:55:57 AM
I tried to avoid SDL because I implemented another library for input/rendering.
So I actually need the core mechanics like FOV and map generator, which should be independent to target platform.

Do you mean non-windowing functionality like FOV and generators? Obviously libtcod does not use SDL for anything besides windowing so I believe you can get rid of it by modifying makefiles to exclude the console subsystem.
I did try that but gave up.
Errors occurred everywhere after I tried to remove some input/render functions in header files.
Title: Re: Any C/C++ library for roguelike without SDL dependency?
Post by: Cfyz on May 20, 2015, 02:13:44 PM
Quote from: summoner
Errors occurred everywhere after I tried to remove some input/render functions in header files.
It should not be that hard. I removed direct references to SDL from libtcod.h and libtcod_int.h, then edited out SDL and output subsystem implementations from makefile:
libtcod-nosdl.diff (http://pastebin.com/TtTxiZcq)

And now resulting libtcod.so does not have SDL dependency anymore:
Code: [Select]
$ ldd libtcod.so
linux-vdso.so.1 =>  (0x00007fff50946000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5479649000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5479445000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5479227000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5478e67000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5479bc1000)
Title: Re: Any C/C++ library for roguelike without SDL dependency?
Post by: summoner on May 21, 2015, 01:54:06 AM
Quote from: summoner
Errors occurred everywhere after I tried to remove some input/render functions in header files.
It should not be that hard. I removed direct references to SDL from libtcod.h and libtcod_int.h, then edited out SDL and output subsystem implementations from makefile:
libtcod-nosdl.diff (http://pastebin.com/TtTxiZcq)

And now resulting libtcod.so does not have SDL dependency anymore:
Code: [Select]
$ ldd libtcod.so
linux-vdso.so.1 =>  (0x00007fff50946000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5479649000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5479445000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5479227000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5478e67000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5479bc1000)

Thanks for help.
I think you are using version 1.6.0. I will switch from 1.5.1 stable to that version and retry.