Organization
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <JUI/Widgets/Slider.hpp>
|
||||
#include <JUI/Base/TextBase.hpp>
|
||||
#include <ranges>
|
||||
|
||||
namespace TestGame
|
||||
{
|
||||
@@ -100,44 +101,12 @@ namespace TestGame
|
||||
/// This is performed after translating the origin to the center of the screen.
|
||||
void ApplyCameraTransformation();
|
||||
|
||||
void DrawLevel(const Level* level) const
|
||||
{
|
||||
for (const auto* layer : level->layers)
|
||||
{
|
||||
DrawLayer(layer);
|
||||
}
|
||||
}
|
||||
void DrawLevel(const Level* level) const;
|
||||
|
||||
/// Draw objects with the camera projection, as if they are in world-space.
|
||||
void DrawWorldSpace() {
|
||||
/// Draw objects with the camera projection, as if they are in world-space.
|
||||
void DrawWorldSpace();
|
||||
|
||||
if (!data_ready) return; // Don't try to draw the level if not loaded.
|
||||
|
||||
DrawLevel(loaded_level);
|
||||
|
||||
for (auto* entity : entities) {
|
||||
entity->Draw();
|
||||
}
|
||||
}
|
||||
|
||||
void Render() {
|
||||
glClearColor(0, 0, 0, 1);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
J2D::Begin();
|
||||
{
|
||||
glPushMatrix();
|
||||
{
|
||||
ApplyCameraTransformation();
|
||||
DrawWorldSpace();
|
||||
}
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
J2D::End();
|
||||
|
||||
scene->Draw();
|
||||
|
||||
}
|
||||
void Render();
|
||||
|
||||
#pragma region ReWindow Overrides
|
||||
void OnRefresh(float elapsed) override
|
||||
|
Reference in New Issue
Block a user