Skip to content

Commit

Permalink
fix lighting scene to new renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
hotstreams committed Aug 27, 2024
1 parent 1a92f13 commit be79922
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions samples/lighting/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace LimitlessMaterials {

Limitless::Context context;
Limitless::Camera camera;
Limitless::Renderer render;
std::unique_ptr<Limitless::Renderer> render;
Assets assets;
Scene scene;

Expand Down Expand Up @@ -43,11 +43,14 @@ namespace LimitlessMaterials {
.build()
}
, camera {window_size}
, render {context}
, assets {context, render, ENGINE_ASSETS_DIR}
, render {Limitless::Renderer::builder()
.resolution(window_size)
.deferred()
.build()}
, assets {context, *render, ENGINE_ASSETS_DIR}
, scene {context, assets} {
camera.setPosition({-3.0f, 2.0f, 3.0f});
assets.recompileAssets(context, render.getSettings());
assets.recompileAssets(context, render->getSettings());
}

void onMouseMove(glm::dvec2 pos) {
Expand Down Expand Up @@ -112,7 +115,7 @@ namespace LimitlessMaterials {
last_time = current_time;

scene.update(context, camera);
render.draw(context, assets, scene.getScene(), camera);
render->render(context, assets, scene.getScene(), camera);

context.swapBuffers();
context.pollEvents();
Expand Down
2 changes: 1 addition & 1 deletion samples/lighting/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ bool LimitlessMaterials::Scene::isInsideFloor(const glm::vec3& position) {
}

void LimitlessMaterials::Scene::update(Limitless::Context& context, const Limitless::Camera& camera) {
scene.update(context, camera);
scene.update(camera);

using namespace std::chrono;
auto current_time = steady_clock::now();
Expand Down

0 comments on commit be79922

Please sign in to comment.