-
Notifications
You must be signed in to change notification settings - Fork 22
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
Conversation
There was a problem hiding this 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!
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()); | ||
} |
There was a problem hiding this comment.
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:
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 😅
There was a problem hiding this comment.
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 👍
Awesome, will be part of the next release, thanks! |
Implement skybox texture
Example: