colour: remove redundant rgba member variables

This commit is contained in:
Danny Robson 2015-01-15 14:03:44 +11:00
parent 7ef4cbcc1a
commit 75156cedc3
3 changed files with 17 additions and 5 deletions

View File

@ -32,11 +32,6 @@ namespace util {
struct colour : public detail::coord<4, T> {
using detail::coord<4,T>::coord;
T r;
T g;
T b;
T a;
static const colour WHITE;
static const colour BLACK;
static const colour RED;

View File

@ -5,6 +5,7 @@ TEST_BIN = \
backtrace \
bitwise \
checksum \
colour \
float \
hton \
ip \

16
test/colour.cpp Normal file
View File

@ -0,0 +1,16 @@
#include "colour.hpp"
#include "debug.hpp"
int
main (int, char**)
{
CHECK_EQ (&util::colour4f::WHITE.x,
&util::colour4f::WHITE.r);
CHECK_EQ (util::colour4f::WHITE.x, 1.f);
CHECK_EQ (util::colour4f::WHITE.r, 1.f);
CHECK_EQ (util::colour4f::WHITE.g, 1.f);
CHECK_EQ (util::colour4f::WHITE.b, 1.f);
CHECK_EQ (util::colour4f::WHITE.a, 1.f);
}