diff --git a/CMakeLists.txt b/CMakeLists.txt index 542c2b6..241f4b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.27) +cmake_minimum_required(VERSION 3.25) project(JGL VERSION 1.0 LANGUAGES CXX diff --git a/include/JGL/JGL.h b/include/JGL/JGL.h index d68a30c..2b8cdcd 100644 --- a/include/JGL/JGL.h +++ b/include/JGL/JGL.h @@ -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) { diff --git a/main.cpp b/main.cpp index 7f8a7fc..53f4379 100644 --- a/main.cpp +++ b/main.cpp @@ -42,7 +42,7 @@ void display() { glVertex2f(-0.9f, -0.3f); glEnd(); - JGL::FillRect2D(); + JGL::FillRect2D({64, 64}, {128, 128}, JGL::Colors::White); glBegin(GL_TRIANGLES); glColor3f(0.0f, 0.0f, 1.f); // Blue