Jump to content

  • Log In with Google      Sign In   
  • Create Account

Aldacron

Member Since 16 Oct 1999
Offline Last Active Yesterday, 08:56 PM

Posts I've Made

In Topic: Decent vector library for C?

24 August 2016 - 08:40 AM

Both DirectXMath and eigen are C++ libraries. Since you specifically asked for something in C, you might try Kazmath.


In Topic: Virtual Machines

31 July 2016 - 05:33 AM

Are you sure your card only supports OGL 2.1? Did you actually tell SDL to create a modern context?


In Topic: [C++] Changing Fore And Back Color Of Text

20 July 2016 - 12:53 AM

Thanks for the replies, in the meantime I've also been searching some more on the internet and it seems that newer version of dwarf fortress which can be run on linux seem to use SDL, so I'll look into SDL, which also would give me a system to handle input more easily, because I was planning to use getch, but it is a bit annoying when it comes to arrow keys and things like that.

 

Even if you were to use OpenGL directly, you would still want SDL (or something similar, like GLFW) to handle window creation and input in a cross-platform manner. I still recommend libtcod. It uses SDL for input and such. More importantly, it has several features that, if you start from scratch, you would need to implement yourself when you need them, such as a 'console' to draw your ASCII characters to, loading of ASCII fonts and tile sheets, pathfinding & line of sight, and more. You can choose between renderers based on SDL and OpenGL, and can implement any custom rendering you need on top.

Of course, if you want to do it all from scratch, that's fine, but libtcod will save you a good bit of time. I'm not a fan of its API myself, but it's the most complete solution I know that's usable in multiple languages.


In Topic: [C++] Changing Fore And Back Color Of Text

19 July 2016 - 01:08 AM

The OpenGL renderer in DF was implemented quite some time ago. You can see several old bug reports for it in their issue tracker.

And for clarity, I wasn't recommending the OP to use OpenGL, but rather libtcod. My intent was to express that most such games take that approach these days and libtcod is an easy way to get going with it. It can use either SDL or OpenGL under the hood.


In Topic: [C++] Changing Fore And Back Color Of Text

18 July 2016 - 11:56 PM

@OP: Dwarf Fortress is not using the system terminal/console for graphics. It has its own rendering system. Two actually, one using SDL and one using OpenGL. While some 'old skool' ASCII games do have support for the system terminal, most of them still have custom renderers. libtcod is pretty widely used for this sort of thing. See CogMind for a relatively popular recent example using it.

 

 

If you aim in the direction of Dwarf Fortress you might be better served by something like pdcurses. There is also libtcod but there are some design decisions in there that never sat well with me and it's not in active development. Different libraries may have sprung up since the last time I investigated the DF-related ecosystem though.

FYI, libtcod is still active under a different maintainer over at bitbucket.


PARTNERS