Difference between revisions of "Output libraries"

From RogueBasin
Jump to navigation Jump to search
m (Moved the more useful library (curses) up to the top and changed the tone of the text to be a little more objective.)
Line 1: Line 1:
It can be difficult to decide which output library to use when creating a Roguelike. There are many different ones available. Libraries differ in portability, ease of use, speed, and other factors. This article compares different options.
It can be difficult to decide which output library to use when creating a Roguelike. There are many different ones available. Libraries differ in portability, ease of use, speed, and other factors. This article compares different options.
== conio.h ==
'''Do not use conio.h.''' It is unportable. It only works on DOS and Windows. If you use conio.h, then unless you design your code extremely well, when you try to port your game to other platforms, you are going to have problems.
Advantages:
* Easy to use
Disadvantages:
* Unportable


== Curses ==
== Curses ==
[http://en.wikipedia.org/wiki/Curses_(programming_library) Curses] is a library for I/O to a terminal. It's quite portable, and applications will often compile on different operating systems with little or no change. It is probably your best choice if you don't need more than 8 or 16 colors.
[[Curses library|Curses]] is a library for I/O to a terminal. It's quite portable, and applications will often compile on different operating systems with little or no change. It is probably your best choice if you don't need more than 8 or 16 colors.


Advantages:
Advantages:
Line 19: Line 10:
Disadvantages:
Disadvantages:
Only allows up to 8 foreground colors and 8 background colors. (It's possible to get 8 more foreground colors by using the bold attribute.)
Only allows up to 8 foreground colors and 8 background colors. (It's possible to get 8 more foreground colors by using the bold attribute.)
== Windows API Calls ==
It's possible to call the Windows API functions directly. This is usually a bad idea, because they are obviously unportable. It's almost always better to use someone else's library instead.
Advantages:
* Fast
Disadvantages:
* Very hard to use
* Completely unportable


== libtcod ==
== libtcod ==
Line 43: Line 24:


== RLLib ==
== RLLib ==
RLLib is being developed by [[Nathan Stoddard]]. It isn't available for download yet. Unfortunately, it won't be available in time for this year's 7DRL competition. Before I release it, it will need a better name, because "RLLib" is too generic, and too similar to "Roguelikelib" which is completely different.
RLLib is being developed by [[Nathan Stoddard]]. It isn't available for download yet. It is planned to have a new name before being released ("RLLib" being too generic, and too similar to the completely different [[Roguelikelib]]).


Advantages:
Advantages:
Line 59: Line 40:
Disadvantages:
Disadvantages:
* Not released yet
* Not released yet
== conio.h ==
This only works with [[DOS]] and [[Windows]] and hence '''should not be used''' for any game required to be portable. 
Advantages:
* Easy to use
Disadvantages:
* Unportable
== Windows API Calls ==
It's possible to call the Windows API functions directly. As you can tell from the name this only works with Windows and is '''not portable to other platforms'''.
Advantages:
* Fast
Disadvantages:
* Very hard to use
* Completely unportable
[[Category:Articles]]
[[Category:Articles]]

Revision as of 19:10, 18 May 2009

It can be difficult to decide which output library to use when creating a Roguelike. There are many different ones available. Libraries differ in portability, ease of use, speed, and other factors. This article compares different options.

Curses

Curses is a library for I/O to a terminal. It's quite portable, and applications will often compile on different operating systems with little or no change. It is probably your best choice if you don't need more than 8 or 16 colors.

Advantages:

  • Portable
  • Relatively easy to use

Disadvantages: Only allows up to 8 foreground colors and 8 background colors. (It's possible to get 8 more foreground colors by using the bold attribute.)

libtcod

Libtcod allows 16 million colors, and larger consoles than available otherwise. It's portable, but unfortunately it takes some time to get used to. (Can someone add more to this? I'm not really familiar with libtcod.)

Advantages:

  • Portable
  • 16 million colors
  • Many capabilities besides a command-line interface, like mouse support and a configuration file parser, and advanced features such as perlin noise

Disadvantages:

  • A little hard to learn
  • The default font is hard to read, especially on large screens

RLLib

RLLib is being developed by Nathan Stoddard. It isn't available for download yet. It is planned to have a new name before being released ("RLLib" being too generic, and too similar to the completely different Roguelikelib).

Advantages:

  • Portable
  • 16 million colors
  • Mouse support, an RNG, config file support
  • Doesn't rely on any additional libraries
  • Allows access to individual pixels, and drawing characters at any position on the screen
  • A simple message printing system
  • Multiplayer support
  • Relatively easy to use
  • Hexagon support
  • Simple graphics support

Disadvantages:

  • Not released yet

conio.h

This only works with DOS and Windows and hence should not be used for any game required to be portable.

Advantages:

  • Easy to use

Disadvantages:

  • Unportable

Windows API Calls

It's possible to call the Windows API functions directly. As you can tell from the name this only works with Windows and is not portable to other platforms.

Advantages:

  • Fast

Disadvantages:

  • Very hard to use
  • Completely unportable