Writing JGL library interface

This commit is contained in:
scientiist
2024-01-20 12:14:41 -06:00
parent eec161769c
commit d49084e99e
3 changed files with 20 additions and 3 deletions

View File

@@ -26,7 +26,18 @@ namespace JGL {
int b;
};
namespace Colors {
static const Color3 BrightRed {255, 0, 0};
static const Color3 BrightGreen { 0, 255, 0};
static const Color3 BrightBlue { 0, 0, 255};
static const Color3 White {255, 255, 255};
static const Color3 Black { 0, 0, 0};
static const Color3 Gray {128, 128, 128};
static const Color3 DarkGray {192, 192, 192};
static const Color3 LightGray { 64, 64, 64};
static const Color3 Maroon {};
static const Color3 Fuchsia {};
static const Color3 Lime {};
static const Color3 Olive {};
}
struct HSV {
float hue;
@@ -37,6 +48,12 @@ namespace JGL {
Vector2 ScreenToViewport(const Vector2& v)
{
// TODO: Implement matrix transformation
float x = v.x / 600.f;
float y = v.y / 600.f;
return {
x - .5f, y - .5f
};
}
Vector2 ViewportToScreen(const Vector2& v)
{