Merge branch 'master' of https://git.redacted.cc/Josh/JGL
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m29s
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m29s
This commit is contained in:
8
main.cpp
8
main.cpp
@@ -123,12 +123,10 @@ public:
|
||||
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, 0, 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, 16, 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, 33, 1,16, Jupiteroid);
|
||||
J2D::End();
|
||||
}
|
||||
|
||||
|
@@ -27,6 +27,9 @@ namespace JGL {
|
||||
void J2D::DrawString(const Color4& color, const std::string& text, float x, float y, float scale, u32 size, const Font& font) {
|
||||
glUseProgram(0); // Fixed-function pipeline.
|
||||
|
||||
// Offset by height to render at "correct" location.
|
||||
y += size;
|
||||
|
||||
CachedFont* cachedFont = fontCache.getFont(size, font.index);
|
||||
|
||||
//Set up the regular font.
|
||||
|
Reference in New Issue
Block a user