Update JGL

This commit is contained in:
2024-07-07 20:24:56 -04:00
parent 8ee3cec460
commit e550dea76e
4 changed files with 16 additions and 20 deletions

View File

@@ -49,7 +49,7 @@ CPMAddPackage(
CPMAddPackage(
NAME JGL
URL https://git.redacted.cc/josh/JGL/archive/Prerelease-17.zip
URL https://git.redacted.cc/josh/JGL/archive/Prerelease-18.zip
)
CPMAddPackage(

View File

@@ -10,7 +10,7 @@ int main()
engine->window = new ReWindow::RWindow("Re3D Test Application", 1152, 864, RenderingAPI::OPENGL);
engine->world = new(World);
Engine::init();
JGL::InitTextEngine();
JGL::Update(engine->window->getSize());
Fonts::initFonts();
engine->window->setVsyncEnabled(false);
engine->window->setResizable(false);

View File

@@ -40,24 +40,18 @@ void FreeCam::pre_render() {
}
void FreeCam::jglRenderPass() {
//JGL::J3D::DrawString3D(JGL::Colors::White, "Entity Count: " + std::to_string(engine->world->getEntityCount()), {2.5,0,0}, -0.005125, 48, Fonts::ModeSeven);
//JGL::J3D::DrawString3D(JGL::Colors::White, "Cam Pos: X: " + std::to_string(position.x) + " Y: " + std::to_string(position.y) + " Z: " + std::to_string(position.z), {4.75, 0.25,0}, -0.005125, 32, Fonts::ModeSeven);
//JGL::J3D::DrawString3D(JGL::Colors::White, "Framecount: " + std::to_string(engine->frameCount), {0,0.25,0}, -0.005125, 48, Fonts::ModeSeven);
//JGL::J3D::DrawString3D(JGL::Colors::White, "Frame dT: " + std::to_string(engine->frameDelta), {0,0.5,0}, -0.005125, 48, Fonts::ModeSeven);
using namespace JGL;
J3D::Begin();
J3D::DrawString(JGL::Colors::Red, "3D Sample Text.", {0, 0, 0}, 0.0225, 32, Fonts::Jupiteroid);
J3D::End();
// HOLY SHYT!!!!
JGL::J2D::DrawString2D(JGL::Colors::White, "FPS: " + std::to_string((int) engine->framerate()), 200, 50, 1, 16, Fonts::ModeSeven);
JGL::J2D::DrawString2D(JGL::Colors::White, "Framecount: " + std::to_string(engine->frameCount), 200, 75, 1,16, Fonts::Jupiteroid);
JGL::J2D::FillRect2D({255,0,0}, {25.f, 25.f}, {50, 50});
//glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
J2D::Begin();
J2D::FillRect(JGL::Colors::Blue, {32, 32}, {100.5, 100.5});
J2D::FillTriangle(JGL::Colors::Yellow, {{140, 200},{135, 100},{105, 100}});
J2D::DrawString(JGL::Colors::White, "Framerate: " + std::to_string((int) engine->framerate()), 0, -16, 1, 16, Fonts::Jupiteroid);
J2D::DrawString(JGL::Colors::White, "Framecount: " + std::to_string(engine->frameCount), 0, -33, 1,16, Fonts::Jupiteroid);
J2D::DrawString(JGL::Colors::White, "Position: " + std::to_string(position.x) + " " + std::to_string(position.y) + " " + std::to_string(position.z), 0, -50, 1,16, Fonts::Jupiteroid);
J2D::DrawString(JGL::Colors::White, "ViewAngle: " + std::to_string(getAngle().x) + " " + std::to_string(getAngle().y) + " " + std::to_string(getAngle().z), 0, -67, 1,16, Fonts::Jupiteroid);
J2D::End();
}

View File

@@ -1,5 +1,6 @@
#include <sstream>
#include <thread>
#include <JGL/JGL.h>
#include <Redacted3D/engine/engine.h>
#include <Redacted3D/types/entity/camera.h>
@@ -114,6 +115,7 @@ void Engine::render() {
}
void Engine::jglRenderPass() {
JGL::Update(engine->window->getSize());
glDisable(GL_LIGHTING);
///If elements are attached to a camera that's not the active one then they shouldn't be drawn.
if(world->getActiveCamera() != nullptr)