diff --git a/libs/gfx/include/psemek/gfx/buffer.hpp b/libs/gfx/include/psemek/gfx/buffer.hpp index 3cb3d273..eb25949e 100644 --- a/libs/gfx/include/psemek/gfx/buffer.hpp +++ b/libs/gfx/include/psemek/gfx/buffer.hpp @@ -21,6 +21,8 @@ namespace psemek::gfx GLuint id() const { return id_; } + explicit operator bool() const { return id() != 0; } + void bind() const; void reset(); diff --git a/libs/gfx/include/psemek/gfx/framebuffer.hpp b/libs/gfx/include/psemek/gfx/framebuffer.hpp index e291a6a3..e5797ffe 100644 --- a/libs/gfx/include/psemek/gfx/framebuffer.hpp +++ b/libs/gfx/include/psemek/gfx/framebuffer.hpp @@ -21,6 +21,8 @@ namespace psemek::gfx GLuint id() const { return id_; } + explicit operator bool() const { return id() != 0; } + void bind() const; void reset(); diff --git a/libs/gfx/include/psemek/gfx/renderbuffer.hpp b/libs/gfx/include/psemek/gfx/renderbuffer.hpp index ccef0dbf..0d11c192 100644 --- a/libs/gfx/include/psemek/gfx/renderbuffer.hpp +++ b/libs/gfx/include/psemek/gfx/renderbuffer.hpp @@ -21,6 +21,8 @@ namespace psemek::gfx GLuint id() const { return id_; } + explicit operator bool() const { return id() != 0; } + void bind() const; void reset(); diff --git a/libs/gfx/include/psemek/gfx/texture.hpp b/libs/gfx/include/psemek/gfx/texture.hpp index 9681a713..f32e3586 100644 --- a/libs/gfx/include/psemek/gfx/texture.hpp +++ b/libs/gfx/include/psemek/gfx/texture.hpp @@ -27,12 +27,12 @@ namespace psemek::gfx GLuint id() const { return id_; } + explicit operator bool() const { return id() != 0; } + void reset(); void bind() const; - explicit operator bool() const { return id() != 0; } - geom::vector size() const { return size_; } std::size_t width() const;