template<class AllocationPolicy>
texture_atlas_entry_t class
helper class representing an entry of a texture_
texture_
Public types
- using key_t = typename AllocationPolicy::key_t
- key type of the assiciated texture_
atlas_ t
Constructors, destructors, conversion operators
-
texture_atlas_entry_t(texture_
atlas_ entry_ t&& mov) defaulted - move constructor
-
texture_atlas_entry_t(const texture_
atlas_ entry_ t& cpy) defaulted - copy constructor
Public functions
-
auto fetch(const std::
string_view name, const std:: string_view uv) const -> std:: string - return string to fetch a texel inside shader code
-
auto fetch(const std::
string_view name, const glm::vec2 uv) const -> std:: string - return string to fetch a texel inside shader code
-
auto key() const -> key_
t - return key owned by texture_
atlas_ entry_ t -
auto operator=(texture_
atlas_ entry_ t&& mov) -> texture_ atlas_ entry_ t& deleted - move assignment operator
-
auto operator=(const texture_
atlas_ entry_ t& cpy) -> texture_ atlas_ entry_ t& deleted - copy assignment operator
-
template<class PixelFormat>void update(const image_
t<PixelFormat>& image) - update pixel data of a texture entry
- auto valid() const -> bool
- check if texture_entry_t object is still contained in the texture_
atlas_ t object
Function documentation
template<class AllocationPolicy>
glpp:: core:: object:: texture_atlas_entry_t<AllocationPolicy>:: texture_atlas_entry_t(texture_ atlas_ entry_ t&& mov) defaulted
move constructor
texture_
template<class AllocationPolicy>
glpp:: core:: object:: texture_atlas_entry_t<AllocationPolicy>:: texture_atlas_entry_t(const texture_ atlas_ entry_ t& cpy) defaulted
copy constructor
texture_
template<class AllocationPolicy>
std:: string glpp:: core:: object:: texture_atlas_entry_t<AllocationPolicy>:: fetch(const std:: string_view name,
const std:: string_view uv) const
return string to fetch a texel inside shader code
Parameters | |
---|---|
name | [in] name of the texture_ |
uv | [in] either name of a shader variable of type vec2 or a vec2 value |
Returns | std:: |
This function will generate shader code, that can be used to fetch pixel values from a texture atlas.
template<class AllocationPolicy>
std:: string glpp:: core:: object:: texture_atlas_entry_t<AllocationPolicy>:: fetch(const std:: string_view name,
const glm::vec2 uv) const
return string to fetch a texel inside shader code
Parameters | |
---|---|
name | [in] name of the texture_ |
uv | [in] value for the uv coordinates that shall be fetched in the shader |
Returns | std:: |
This function will generate shader code, that can be used to fetch pixel values from a texture atlas.
template<class AllocationPolicy>
key_ t glpp:: core:: object:: texture_atlas_entry_t<AllocationPolicy>:: key() const
return key owned by texture_
Texture entries in texture_
template<class AllocationPolicy>
texture_ atlas_ entry_ t& glpp:: core:: object:: texture_atlas_entry_t<AllocationPolicy>:: operator=(texture_ atlas_ entry_ t&& mov) deleted
move assignment operator
texture_
template<class AllocationPolicy>
texture_ atlas_ entry_ t& glpp:: core:: object:: texture_atlas_entry_t<AllocationPolicy>:: operator=(const texture_ atlas_ entry_ t& cpy) deleted
copy assignment operator
texture_
template<class AllocationPolicy>
template<class PixelFormat>
void glpp:: core:: object:: texture_atlas_entry_t<AllocationPolicy>:: update(const image_ t<PixelFormat>& image)
template<class PixelFormat>
update pixel data of a texture entry
Parameters | |
---|---|
image | [in] new pixel data |
This function will overwrite the pixel data of the texture entry with the pixel data of the image parameter. Resizing on update might not be possible with every AllocationPolicy policy.
template<class AllocationPolicy>
bool glpp:: core:: object:: texture_atlas_entry_t<AllocationPolicy>:: valid() const
check if texture_entry_t object is still contained in the texture_
A texture entry might be erased from the texture_