Refactor & Fix inverted text & More
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m37s

This commit is contained in:
2024-07-07 17:10:51 -04:00
parent c62b58aa16
commit 0914b496e7
4 changed files with 484 additions and 453 deletions

View File

@@ -49,48 +49,52 @@ namespace JGL {
Vector3 C;
};
bool Update(const Vector2& window_size);
bool InitTextEngine();
inline FontCache fontCache;
int LoadFont(const std::string& font_path);
void UnloadFont(int font_index);
// TODO: implement correct coloring
namespace J2D {
void DrawPixel2D(const Color3 &color, const Vector2 &coordinates);
void DrawPixel2D(const Color3 &color, float x, float y);
void DrawLine2D(const Color3 &color, const Vector2 &A, const Vector2 &B, float thickness = 1);
void DrawLine2D(const Color3 &color, float x, float y, float w, float h, float thickness = 1);
void DrawCubicBezierCurve2D();
void OutlineCircle2D(const Color3 &color, const Vector2 &center, float radius, int subdivisions,
float thickness = 1);
void FillCircle2D(const Color3 &color, const Vector2 &center, float radius, int subdivisions);
void OutlineTriangle2D(const Color3 &color, const Triangle2D &tri);
void FillTriangle2D(const Color3 &color, const Triangle2D &tri);
void FillTexturedTriangle2D();
void FillTexturedPolygon2D();
void DrawSprite2D();
void DrawPartialSprite2D();
void DrawString2D(const Color3& color, std::string text, float x, float y, float scale, u32 size, unsigned int font_index);
void FillRect2D(const Color3 &color, const Vector2 &pos, const Vector2 &size);
void OutlineRect2D ( const Color3& color, const Vector2& pos, const Vector2& size, float thickness = 1);
void FillRoundedRect2D (const Color3& color, const Vector2& pos, const Vector2& size, float radius);
void OutlineRoundedRect2D(const Color3& color, const Vector2& pos, const Vector2& size, float radius, float thickness = 1);
void OutlinePolygon2D (const Color3& color, std::vector<Vector2> points);
void FillPolygon2D (const Color3& color, std::vector<Vector2> points, float thickness = 1);
void GradientFillRect2D ();
void Begin();
void End();
void DrawPixel(const Color3 &color, const Vector2 &coordinates);
void DrawPixel(const Color3 &color, float x, float y);
void DrawLine(const Color3 &color, const Vector2 &A, const Vector2 &B, float thickness = 1);
void DrawLine(const Color3 &color, float x, float y, float w, float h, float thickness = 1);
void DrawCubicBezierCurve();
void OutlineCircle(const Color3 &color, const Vector2 &center, float radius, int subdivisions, float thickness = 1);
void FillCircle(const Color3 &color, const Vector2 &center, float radius, int subdivisions);
void OutlineTriangle(const Color3 &color, const Triangle2D &tri);
void FillTriangle(const Color3 &color, const Triangle2D &tri);
void FillTexturedTriangle();
void FillTexturedPolygon();
void DrawSprite();
void DrawPartialSprite();
void DrawString(const Color3& color, std::string text, float x, float y, float scale, u32 size, unsigned int font_index);
void FillRect(const Color3 &color, const Vector2 &pos, const Vector2 &size);
void OutlineRect ( const Color3& color, const Vector2& pos, const Vector2& size, float thickness = 1);
void FillRoundedRect (const Color3& color, const Vector2& pos, const Vector2& size, float radius);
void OutlineRoundedRect(const Color3& color, const Vector2& pos, const Vector2& size, float radius, float thickness = 1);
void OutlinePolygon (const Color3& color, std::vector<Vector2> points);
void FillPolygon (const Color3& color, std::vector<Vector2> points, float thickness = 1);
void GradientFillRect ();
}
namespace J3D {
void DrawLine3D(const Color3& color, const Vector3 &A, const Vector3 &B, float thickness = 1);
void FillSphere3D(const Color3& color, const Sphere& sphere);
void WireframeSphere3D(const Color3& color, const Sphere& sphere, float thickness = 1);
void FillOBB3D(const Color3& color, const OBB& obb);
void WireframeOBB3D(const Color3& color, const OBB& obb, float thickness = 1);
void FillCapsule3D(const Color3& color, const Capsule& capsule);
void WireframeCapsule3D(const Color3& color, const Capsule& cap, float thickness = 1);
void FillTriangleMesh3D(const Color3& color, const TriangleMesh& mesh);
void WireframeTriangleMesh3D(const Color3& color, const TriangleMesh& mesh, float thickness = 1);
void DrawString3D(const Color3& color, const std::string& text, const Vector3& pos, float scale, u32 size, unsigned int font_index);
void Begin();
void End();
void SetMatrix(const std::vector<GLfloat>& matrix, const Vector2& window_size);
void DrawLine(const Color3& color, const Vector3 &A, const Vector3 &B, float thickness = 1);
void FillSphere(const Color3& color, const Sphere& sphere);
void WireframeSphere(const Color3& color, const Sphere& sphere, float thickness = 1);
void FillOBB(const Color3& color, const OBB& obb);
void WireframeOBB(const Color3& color, const OBB& obb, float thickness = 1);
void FillCapsule(const Color3& color, const Capsule& capsule);
void WireframeCapsule(const Color3& color, const Capsule& cap, float thickness = 1);
void FillTriangleMesh(const Color3& color, const TriangleMesh& mesh);
void WireframeTriangleMesh(const Color3& color, const TriangleMesh& mesh, float thickness = 1);
void DrawString(const Color3& color, const std::string& text, const Vector3& pos, float scale, u32 size, unsigned int font_index);
void DrawMatrixGizmo (const Matrix3x3&, const Vector3&);
void DrawMatrixGizmo (const Matrix4x4&);