Menu

Things currently in the works...

There are a few major things working their way into my branch of the code right now: Color palettes, 256 color support, and unit testing.

After looking into the ncurses integration, especially after learning (the hard way, remember kids, RTFM) about only being able to have 64 total color pair combinations (effectively only 64 foreground/background combinations) at any given time, I decided that AnsiGL could benefit from having color palettes in similar fashion...but less restrictive and easier to use (as was the whole motivation with this project...ncurses limitations of this nature).

The color palette system that ncurses utilizes is a rather simple idea that allows for efficient handling of colors on screen. Even with its obvious limitations (for high-color applications), it's handling was vastly superior than the method used in the AnsiGL 0.0 release (where the data was duplicated for every "Pixel" on-screen) in probably every way except total color count... Not to mention, anyone who has ever done palette-based game programming can tell you, there are some neat "tricks" involved with palette manipulation that are probably too good to pass up for a graphics library like AnsiGL; even without the few (very important) optimizations it would provides.

Since the whole color system had to be reworked to accommodate a palette, I made the decision to also introduce 256 color mode. It just seemed like I had to take the opportunity since the core of that very part of project was going to be reworked anyway. The bigger trick here will be to still be able to utilize ncurses when someone wants to use more of that palette at once (like a large gradient background, for example...).

In the midst of all of this, I also decided that unit tests will be too helpful to pass up. For anyone not familiar with the concept, a unit test is a simple program that tests a single 'unit' of the code for completion with a series of tests. In AnsiGL, all classes will have a test bundled into a single function that will constitute a class "unit test" that can be called from the unit test application.

Thanks to a minor bug, that could be in one of a million places, rather than take the time to hunt it down the traditional way, I'm going to use this time to conduct a minor code review and unit test creation period. Unit tests are being created for each existing class, and will be created for all future classes. These tests will be included with the AnsiGL source starting from the next downloadable release.

All of this will start to appear in Git soon...

Posted by NicroHobak 2012-01-18 Labels: programming 256 color palette ncurses unit testing color

Log in to post a comment.