"VRam List" wrapped for VBO (useful later)
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 6m25s
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 6m25s
This commit is contained in:
33
main.cpp
33
main.cpp
@@ -119,14 +119,11 @@ public:
|
||||
float fov = 90;
|
||||
float sprite_radians = 0;
|
||||
bool fov_increasing = true;
|
||||
unsigned long long frames = 0;
|
||||
bool framerate_measurement = false;
|
||||
std::chrono::high_resolution_clock::time_point start;
|
||||
float elapsed = 0.0f;
|
||||
float fps = 0.0f;
|
||||
|
||||
void display() {
|
||||
if (framerate_measurement)
|
||||
start = std::chrono::high_resolution_clock::now();
|
||||
start = std::chrono::high_resolution_clock::now();
|
||||
|
||||
JGL::Update(getSize());
|
||||
if (fov_increasing)
|
||||
@@ -157,8 +154,9 @@ public:
|
||||
J3D::End();
|
||||
|
||||
|
||||
J2D::Begin(j2d_render_target, true);
|
||||
J2D::Begin();
|
||||
J2D::FillRect(Colors::Blue, {0,52}, {100,100});
|
||||
J2D::DrawSprite(*image, {300, 300}, 0, {0,0}, {1, 1}, Colors::White, Direction::Vertical | Direction::Horizontal);
|
||||
J2D::DrawMirrorSprite(*image, {400, 300}, Direction::Horizontal | Direction::Vertical, sprite_radians, {0.5,0.5}, {1, 1}, Colors::White);
|
||||
J2D::DrawPartialSprite(*image, {225, 300}, image->GetDimensions() * 0.25, image->GetDimensions() * 0.75, sprite_radians, {0.5, 0.5});
|
||||
J2D::FillRect(Colors::Pinks::HotPink, {68, 120}, {32, 32});
|
||||
@@ -178,6 +176,7 @@ public:
|
||||
J2D::DrawString(Colors::Green, "Jupteroid Font", 0.f, 0, 1.f, 16, Jupiteroid);
|
||||
J2D::DrawString(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(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::DrawString(Colors::White, "Framerate: " + std::to_string((int) fps), 0, 48, 1, 16, Jupiteroid);
|
||||
J2D::OutlinePolygon(Colors::White, {{200, 400}, {220, 420}, {220, 430}, {230, 410}, {200, 400}});
|
||||
//J2D::FillPolygon(Colors::White, {{200, 400}, {220, 420}, {220, 430}, {230, 410}, {200, 400}});
|
||||
J2D::DrawCubicBezierCurve(Colors::Blues::CornflowerBlue,
|
||||
@@ -194,25 +193,15 @@ public:
|
||||
J2D::End();
|
||||
|
||||
//Draw the Render Target that we just drew all that stuff onto.
|
||||
/*
|
||||
J2D::Begin();
|
||||
J2D::DrawRenderTargetAsSprite(*j2d_render_target, {0, 0}, sprite_radians * 0.25, {0.5, 0.5}, {1,1}, Colors::White);
|
||||
J2D::DrawRenderTargetAsSprite(*j2d_render_target, {0, 0}, 0, {0.5, 0.5}, {1,1}, Colors::White);
|
||||
J2D::End();
|
||||
*/
|
||||
|
||||
if (framerate_measurement) {
|
||||
frames++;
|
||||
std::chrono::high_resolution_clock::time_point stop = std::chrono::high_resolution_clock::now();
|
||||
std::chrono::duration<float> frame_time = stop - start;
|
||||
elapsed += frame_time.count();
|
||||
if (elapsed >= 1)
|
||||
std::cout << "Framerate: " << frames << std::endl,
|
||||
frames = 0,
|
||||
elapsed = 0,
|
||||
framerate_measurement = false,
|
||||
setVsyncEnabled(true);
|
||||
} else if (isKeyDown(Keys::One))
|
||||
framerate_measurement = true,
|
||||
frames = 0,
|
||||
setVsyncEnabled(false);
|
||||
std::chrono::high_resolution_clock::time_point stop = std::chrono::high_resolution_clock::now();
|
||||
std::chrono::duration<float> frame_time = stop - start;
|
||||
fps = 1.0f / frame_time.count();
|
||||
}
|
||||
|
||||
void OnRefresh(float elapsed) override {
|
||||
|
Reference in New Issue
Block a user