2009
05.01

More frames for 1.5 samples

I made a significant change in the way the console stores colors. Instead of having an array of cells, each cell containing the ascii code, foreground and background colors, colors are now stored in 2 TCODImages.
The obvious advantage for the user is that every TCODImage feature is now enabled on console background or foreground color.
Another advantage is that the opengl renderer can now directly access colors from the console without conversion. This results in a slightly improved framerate…


Remember that the framerate with 1.4.1 is around 140 on the same computer…

There are still remaining bugs with the opengl renderer, though. Doing pixel-perfect 2D blitting is a pain with opengl. Another issue is that most linux distribs come with poor drivers which results either in poor performances or even in a completely broken display. Apparently, there’s no way I can detect if the driver is good from the library so I’ll have to make it possible for the player to disable the opengl renderer, maybe in a libtcod.cfg config file…

4 comments so far

Add Your Comment
  1. Very nice. Will this improve performance on non-OpenGL rendering too?

  2. No, no impact on non-opengl renderers. The next step is to allow colored tiles in the font bitmap. This may change the renderers a lot. We’ll see how performances evolve when it’s done…

  3. If you’re going to make the OpenGL renderer togglable, can it at least be done with a command as well? I can see a function in an options menu so you can turn it on or off within game (given that most games have this). Or does it function so slowly on a “broken” (or software) renderer so as to make that impossible?

    I can think of at least four versions of OpenGL I’ve had installed on Windows, the default Win version, the SGI “accelerated” version, and the nVidia and ATi versions. All of which “do” OpenGL in a way resembling “working” (software was slow, but worked, “accelerated” was quicker, but not as quick as native).

    I’m going to need to get you some extra digits for FPS rendering as well, or I’m going to be showing “0 ms” and “1200fps” or more!!! (if I get the same performance increase).

  4. Yeah it will be possible to disable opengl programmatically.

    Concerning the samples fps, indeed, I intend to make the sample more “visually demanding” to get back to some sensible frame rate 🙂