Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement skybox texture #250

Merged
merged 2 commits into from
Jul 25, 2024
Merged

Conversation

dziamidchyk
Copy link
Contributor

Implement skybox texture

Example:

Copy link
Member

@hannojg hannojg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for the PR!

Just one little change needed, then we are good to go!

Comment on lines 65 to 71
Skybox* skybox = builder.build(*_engine);
_skybox = References<Skybox>::adoptEngineRef(_engine, skybox, [](std::shared_ptr<Engine> engine, Skybox* skybox) {
Logger::log(TAG, "Destroying Skybox...");
engine->destroy(skybox);
});
_scene->setSkybox(_skybox.get());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually also need to destroy / deallocate the texture:

Suggested change
Skybox* skybox = builder.build(*_engine);
_skybox = References<Skybox>::adoptEngineRef(_engine, skybox, [](std::shared_ptr<Engine> engine, Skybox* skybox) {
Logger::log(TAG, "Destroying Skybox...");
engine->destroy(skybox);
});
_scene->setSkybox(_skybox.get());
}
Skybox* skybox = builder.build(*_engine);
_skybox = References<Skybox>::adoptEngineRef(_engine, skybox, [cubemap](std::shared_ptr<Engine> engine, Skybox* skybox) {
Logger::log(TAG, "Destroying Skybox...");
engine->destroy(skybox);
engine->destroy(cubemap);
});
_scene->setSkybox(_skybox.get());
}

Note: I think we have some other places in the code base where we miss to do that 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah makes sense, updated the PR 👍

@hannojg hannojg merged commit f76b9d9 into margelo:main Jul 25, 2024
1 check passed
@hannojg
Copy link
Member

hannojg commented Jul 25, 2024

Awesome, will be part of the next release, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants