start using C based classes

This commit is contained in:
Greg Wells
2025-05-20 12:02:44 -04:00
parent daef5e4858
commit 74689a86ef
10 changed files with 213 additions and 113 deletions

View File

@@ -1,3 +1,29 @@
#include "../math/gryphn_vec4.h"
typedef struct gnColor {
union {
struct {
int r, g, b;
float a;
};
typedef gnMultiType4<int, int, int, float> gnColor;
struct {
int red, green, blue;
float alpha;
};
};
#ifdef GN_UTILS_CPP
gnColor(int red, int green, int blue, float alpha = 1.0) {
this->red = red;
this->green = green;
this->blue = blue;
this->alpha = alpha;
}
gnColor(int color = 0, float alpha = 1.0) {
this->red = color;
this->green = color;
this->blue = color;
this->alpha = alpha;
}
#endif
} gnColor;