Author Topic: rlutil - simple utility collection for C++ and C  (Read 19343 times)

Tapio

  • Newcomer
  • Posts: 46
  • Karma: +2/-1
    • View Profile
    • Email
rlutil - simple utility collection for C++ and C
« on: March 05, 2010, 01:37:22 PM »
rlutil
Tiny C++ and C utility collection for cross-platform console roguelike development.

Just in time for the 2010 7DRL Challenge!

rlutil consists of mainly I/O functions that can be used to create pure console mode roguelikes (or other apps) that work on both Windows and Linux. I am aware of that there are libraries like curses that does this, but since I have seen many people using e.g. simple kbhit() / getch() combo for input, I think this has use for at least making those games easily cross-platform while using familiar functions. I also had many of these functions already coded and I like building stuff from the ground-up.

Main functionalities include colored output, keyboard input that doesn't require Return-keypresses and cursor manipulation. It also behaves nicely whether you use C++ or C - meaning that e.g. it automagically uses std::strings, streams and namespaces with C++.

WinAPI or ANSI escape codes are used depending on platform. I would like to have Mac OSX compatibility, but I have no way of testing/developing on that platform so contributions are welcomed.

Webpage: http://tapio.github.com/rlutil/
Documentation: http://tapio.github.com/rlutil/docs/HTML/index.html
Browse sources: http://github.com/tapio/rlutil
Download zip: http://github.com/tapio/rlutil/zipball/master
Clone url:
Code: [Select]
$ git clone git://github.com/tapio/rlutil.git
« Last Edit: March 05, 2010, 01:47:05 PM by aave »

Engram

  • Newcomer
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: rlutil - simple utility collection for C++ and C
« Reply #1 on: March 05, 2010, 09:46:34 PM »
Thank you for sharing.  Very cool and very useful.
- Engram -
Puzzle Maker

Tapio

  • Newcomer
  • Posts: 46
  • Karma: +2/-1
    • View Profile
    • Email
Re: rlutil - simple utility collection for C++ and C
« Reply #2 on: March 06, 2010, 10:05:08 AM »
Thank you for sharing.  Very cool and very useful.
Well thank you! Glad you like it.

Btw, I forgot to mention that there is also a small test program (test.cpp) you folks can use to see what the library can currently do. Also, if your eyes start to hurt when you see a lot of #ifdef's, I'd recommend not to look at the actual rlutil header file... :P

stu

  • Rogueliker
  • ***
  • Posts: 138
  • Karma: +0/-0
  • Moop!
    • View Profile
    • Stu's Rusty Bucket
Re: rlutil - simple utility collection for C++ and C
« Reply #3 on: March 06, 2010, 04:03:01 PM »
if people are too lazy to use curses which is cross platform, why would they use your cross platform library?
--/\-[ Stu ]-/\--

Tapio

  • Newcomer
  • Posts: 46
  • Karma: +2/-1
    • View Profile
    • Email
Re: rlutil - simple utility collection for C++ and C
« Reply #4 on: March 06, 2010, 04:11:53 PM »
if people are too lazy to use curses which is cross platform, why would they use your cross platform library?
Curses needs initialization (and cleanup). Granted, it is not very hard, but with this you can just swap conio.h to rlutil.h and kbhit() / getch() / gotoxy() based game is now playable on Linux too (or at least very easy to port if other Windows specific stuff is used.)

I would still recommend using curses (or more specifically, ncurses / PDcurses), but this library has its uses for easy porting of existing projects and rapid prototyping.