35 else if (w == (h / 4) * 3)
39 else if (h == (w / 4) * 3)
101 void texture_cube::resized()
107 m_mip_count = 1 +
static_cast<std::uint16_t
>(std::log2(m_face_size));
texture_cube(std::uint16_t width, std::uint16_t height, gl::pixel_type type=gl::pixel_type::uint_8, gl::pixel_format format=gl::pixel_format::rgba, gl::transfer_function transfer_function=gl::transfer_function::linear, const std::byte *data=nullptr)
Constructs a cube texture.
virtual void set_wrapping(gl::texture_wrapping wrap_s, texture_wrapping wrap_t, texture_wrapping wrap_r)
Sets the texture wrapping modes.
static cube_map_layout infer_cube_map_layout(std::uint16_t w, std::uint16_t h) noexcept
Infers the layout of a cube map from its aspect ratio.
void resize(std::uint16_t width, std::uint16_t height, gl::pixel_type type, gl::pixel_format format, gl::transfer_function transfer_function, const std::byte *data) override
Resizes the texture.
static std::uint16_t infer_cube_map_face_size(cube_map_layout layout, std::uint16_t w, std::uint16_t h) noexcept
Infers the edge length of a cube map face from its layout and resolution.
Abstract base class for 1D, 2D, 3D, and cube textures which can be uploaded to shaders via shader inp...
virtual void resize(std::uint16_t width, std::uint16_t height, std::uint16_t depth, gl::pixel_type type, gl::pixel_format format, gl::transfer_function transfer_function, const std::byte *data)
Resizes the texture.
std::uint16_t get_height() const noexcept
Returns the height of the texture, in pixels.
virtual void set_wrapping(gl::texture_wrapping wrap_s, gl::texture_wrapping wrap_t, gl::texture_wrapping wrap_r)
Sets the texture wrapping modes.
transfer_function get_transfer_function() const noexcept
Returns the transfer function.
std::uint16_t m_mip_count
std::uint16_t get_width() const noexcept
Returns the width of the texture, in pixels.
pixel_format get_pixel_format() const noexcept
Returns the pixel format enumeration.
pixel_type get_pixel_type() const noexcept
Returns the pixel type enumeration.
Graphics library interface.
transfer_function
Texture sampling transfer function.
cube_map_layout
Cube map layout types.
@ column
Faces are stored consecutively in a vertical column.
@ spherical
Faces are stored in a spherical projection.
@ horizontal_cross
Faces are stored in a horizontal cross.
@ equirectangular
Faces are stored in an equirectangular projection.
@ vertical_cross
Faces are stored in a vertical cross.
@ row
Faces are stored consecutively in a horizontal row.