Skip to content

Commit

Permalink
fix clearColor
Browse files Browse the repository at this point in the history
  • Loading branch information
markaren committed Feb 27, 2024
1 parent 680df91 commit d5fc5bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/threepp/scenes/Scene.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace threepp {

[[nodiscard]] std::shared_ptr<Texture> texture() const;

operator bool() const;
[[nodiscard]] bool empty() const;

private:
bool hasValue_{false};
Expand Down
2 changes: 1 addition & 1 deletion src/threepp/renderers/gl/GLBackground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void GLBackground::render(GLRenderList& renderList, Object3D* scene) {
cubemaps.get(background->texture().get());
}

if (!background) {
if (!background || (background && background->empty()) ) {

setClear(clearColor, clearAlpha);

Expand Down
4 changes: 2 additions & 2 deletions src/threepp/scenes/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ std::shared_ptr<Texture> Background::texture() const {
return texture_;
}

Background::operator bool() const {
bool Background::empty() const{

return hasValue_;
return !hasValue_;
}

0 comments on commit d5fc5bb

Please sign in to comment.