Initialize gfx objects id to 0 in class instead of constructor

This commit is contained in:
Nikita Lisitsa 2022-11-30 17:27:39 +03:00
parent 03976206ce
commit 52bb516d5c
9 changed files with 7 additions and 13 deletions

View file

@ -28,7 +28,7 @@ namespace psemek::gfx
void reset(); void reset();
private: private:
GLuint id_; GLuint id_ = 0;
explicit array(std::nullptr_t); explicit array(std::nullptr_t);
}; };

View file

@ -122,11 +122,10 @@ namespace psemek::gfx
} }
private: private:
GLuint id_; GLuint id_ = 0;
std::weak_ptr<void> mapped_; std::weak_ptr<void> mapped_;
explicit basic_buffer(std::nullptr_t) explicit basic_buffer(std::nullptr_t)
: id_{0}
{} {}
}; };

View file

@ -71,7 +71,7 @@ namespace psemek::gfx
} }
private: private:
GLuint id_; GLuint id_ = 0;
explicit framebuffer(std::nullptr_t); explicit framebuffer(std::nullptr_t);
}; };

View file

@ -120,12 +120,11 @@ namespace psemek::gfx
void uniform_block_binding(GLuint index, GLuint binding) const; void uniform_block_binding(GLuint index, GLuint binding) const;
private: private:
GLuint program_; GLuint program_ = 0;
mutable boost::container::flat_map<std::string, GLint, std::less<>> uniforms_; mutable boost::container::flat_map<std::string, GLint, std::less<>> uniforms_;
mutable boost::container::flat_map<std::string, GLuint, std::less<>> uniform_blocks_; mutable boost::container::flat_map<std::string, GLuint, std::less<>> uniform_blocks_;
program(std::nullptr_t) program(std::nullptr_t)
: program_{0}
{} {}
}; };

View file

@ -45,7 +45,7 @@ namespace psemek::gfx
} }
private: private:
GLuint id_; GLuint id_ = 0;
geom::vector<std::size_t, 2> size_ = {0, 0}; geom::vector<std::size_t, 2> size_ = {0, 0};
explicit renderbuffer(std::nullptr_t); explicit renderbuffer(std::nullptr_t);

View file

@ -81,8 +81,8 @@ namespace psemek::gfx
void clamp(); void clamp();
protected: protected:
GLuint id_; GLuint id_ = 0;
geom::vector<std::size_t, D> size_; geom::vector<std::size_t, D> size_ = geom::vector<std::size_t, D>::zero();
explicit basic_texture(std::nullptr_t); explicit basic_texture(std::nullptr_t);
}; };
@ -465,7 +465,6 @@ namespace psemek::gfx
template <std::size_t D, GLenum Target> template <std::size_t D, GLenum Target>
basic_texture<D, Target>::basic_texture(std::nullptr_t) basic_texture<D, Target>::basic_texture(std::nullptr_t)
: id_{0}
{} {}
inline buffer_texture::buffer_texture() inline buffer_texture::buffer_texture()

View file

@ -48,7 +48,6 @@ namespace psemek::gfx
} }
array::array(std::nullptr_t) array::array(std::nullptr_t)
: id_{0}
{} {}
} }

View file

@ -187,7 +187,6 @@ namespace psemek::gfx
} }
framebuffer::framebuffer(std::nullptr_t) framebuffer::framebuffer(std::nullptr_t)
: id_{0}
{} {}
} }

View file

@ -55,7 +55,6 @@ namespace psemek::gfx
} }
renderbuffer::renderbuffer(std::nullptr_t) renderbuffer::renderbuffer(std::nullptr_t)
: id_{0}
{} {}
} }