Integrate CMake Package Manager

This commit is contained in:
2024-01-19 14:23:02 -05:00
parent c4d926dd3e
commit 4626f5a37f
4 changed files with 54 additions and 16 deletions

View File

@@ -3,8 +3,16 @@
//
#pragma once
#include <J3ML/LinearAlgebra.h>
#include <J3ML/LinearAlgebra/Vector2.h>
// OpenGL Wrapper for rendering 2D graphics primitives in both a 2D and 3D context
namespace JGL {
// All functions accept coordinates in pixel-screen space [0, 600]
// and are internally transformed to OpenGL clip space [-1, +1]
using namespace LinearAlgebra;
namespace J2D {
}
@@ -29,14 +37,12 @@ namespace JGL {
Vector2 ScreenToViewport(const Vector2& v);
Vector2 ViewportToScreen(const Vector2& v);
Color3 GetColor();
void SetColor(const Color3 &color);
void DrawPixel2D(const Color3 &, int x, int y);
void DrawPixel2D(const Vector2 &coordinates);
void DrawLine2D(const Vector2 &A, const Vector2 &B);
void DrawLine3D(const Vector3 &A, const Vector3 &B);
void DrawPixel2D(const Color3& color, const Vector2 &coordinates);
void DrawLine2D(const Color3& color, const Vector2 &A, const Vector2 &B);
void DrawLine3D(const Color3& color, const Vector3 &A, const Vector3 &B);
void DrawCubicBezierCurve2D();
void OutlineCircle2D(const Vector2 center, float radius, int subdivisions, Color3 color);
void OutlineCircle2D(const Color3& color, const Vector2& center, float radius, int subdivisions);
void FillSphere3D();
void WireframeSphere3D();
void FillCircle2D();
@@ -49,14 +55,14 @@ namespace JGL {
void DrawString();
void FillRect2D(const Vector2 &pos, const Vector2 &size, const Color3 &color)
{
pos = ScreenToViewport(pos);
size = ScreenToViewport(size);
auto vp_pos = ScreenToViewport(pos);
auto vp_size = ScreenToViewport(size);
glBegin(GL_QUADS);
glColor3f(color.r, color.g, color.b);
glVertex2f(pos.x, pos.y);
glVertex2f(pos.x, pos.y + size.y);
glVertex2f(pos.x + size.x, pos.y + size.y);
glVertex2f(pos.x + size.x, pos.y);
glVertex2f(vp_pos.x, vp_pos.y);
glVertex2f(vp_pos.x, vp_pos.y + vp_size.y);
glVertex2f(vp_pos.x + vp_size.x, vp_pos.y + vp_size.y);
glVertex2f(vp_pos.x + vp_size.x, vp_pos.y);
glEnd();
}
void OutlineRect2D (const Vector2& pos, const Vector2& size, const Color3& color, float thickness = 1);