A cube texture which can be uploaded to shaders via shader inputs.
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.
std::uint16_t get_face_size() const noexcept
Returns the edge length of the cube texture faces, in pixels.
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.
constexpr texture_type get_texture_type() const noexcept override
Returns the texture type.
Abstract base class for 1D, 2D, 3D, and cube textures which can be uploaded to shaders via shader inp...