Fix Dereference
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m24s

This commit is contained in:
2024-07-17 16:11:36 -04:00
parent 289157ab8a
commit 162732e4b7
2 changed files with 9 additions and 12 deletions

View File

@@ -59,8 +59,8 @@ struct point {
GLfloat t;
};
JGL::Font* FreeSans;
JGL::Font* Jupiteroid;
JGL::Font FreeSans;
JGL::Font Jupiteroid;
class JGLDemoWindow : public ReWindow::RWindow
{
@@ -72,8 +72,8 @@ public:
gladLoadGL();
JGL::Update(getSize());
FreeSans = new JGL::Font("assets/fonts/FreeSans.ttf");
Jupiteroid = new JGL::Font("assets/fonts/Jupiteroid.ttf");
FreeSans = JGL::Font("assets/fonts/FreeSans.ttf");
Jupiteroid = JGL::Font("assets/fonts/Jupiteroid.ttf");
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glMatrixMode(GL_PROJECTION);
@@ -102,7 +102,7 @@ public:
J3D::Begin();
J3D::DrawLine(JGL::Colors::Red, {-0.33,-0.125,1}, {-1,-0.125,1});
J3D::DrawLine(JGL::Colors::Red, {-0.33,-0.125,1}, {-0.33,0.25,1});
J3D::DrawString(JGL::Colors::Red, "JGL Sample Text", {-0.33, -0.1, 1.0f},textAngle, 1.f, 32, *FreeSans);
J3D::DrawString(JGL::Colors::Red, "JGL Sample Text", {-0.33, -0.1, 1.0f},textAngle, 1.f, 32, FreeSans);
J3D::End();
@@ -120,15 +120,15 @@ public:
J2D::OutlineTriangle(Colors::Blue, {{100, 275}, {0, 275}, {100, 375}});
J2D::DrawGradientLine(JGL::Colors::Red, JGL::Colors::Blue, {105, 375}, {200, 275}, 2);
auto result = Jupiteroid->MeasureString("Jupiteroid Font", 16);
auto result = Jupiteroid.MeasureString("Jupiteroid Font", 16);
DEBUG(std::format("Result: {},{}", result.x, result.y ));
// TODO: Note the discrepancy in Y between the FillRect and DrawString call here.
J2D::FillRect(JGL::Colors::Gray, {0, 0}, result);
// TODO: Does text render from the middle-point of the glyphs?
J2D::DrawString(JGL::Colors::Green, "Jupteroid Font", 0.f, 16, 1.f, 16, *Jupiteroid);
J2D::DrawString(JGL::Colors::White, "Position: " + std::to_string(camera->position.x) + " " + std::to_string(camera->position.y) + " " + std::to_string(camera->position.z), 0, 33, 1,16, *Jupiteroid);
J2D::DrawString(JGL::Colors::White, "ViewAngle: " + std::to_string(camera->angle.x) + " " + std::to_string(camera->angle.y) + " " + std::to_string(camera->angle.z), 0, 50, 1,16, *Jupiteroid);
J2D::DrawString(JGL::Colors::Green, "Jupteroid Font", 0.f, 16, 1.f, 16, Jupiteroid);
J2D::DrawString(JGL::Colors::White, "Position: " + std::to_string(camera->position.x) + " " + std::to_string(camera->position.y) + " " + std::to_string(camera->position.z), 0, 33, 1,16, Jupiteroid);
J2D::DrawString(JGL::Colors::White, "ViewAngle: " + std::to_string(camera->angle.x) + " " + std::to_string(camera->angle.y) + " " + std::to_string(camera->angle.z), 0, 50, 1,16, Jupiteroid);
J2D::End();
}

View File

@@ -19,9 +19,6 @@ bool wasBlendEnabled = false;
bool wasColorArrayEnabled = false;
GLint activeTextureUnit = 0;
namespace JGL {
using namespace J3ML;
Vector2 wS;