StapleGL
Header-only C++20 OpenGL wrapper
|
Texture abstraction. More...
#include "gl_functions.hpp"
#include "utility.hpp"
#include <cstdint>
#include <span>
#include <concepts>
Go to the source code of this file.
Classes | |
struct | staplegl::texture_color |
OpenGL texture details relating to the color format and data type. More... | |
struct | staplegl::texture_filter |
OpenGL texture details relating to filtering and clamping of the image. More... | |
struct | staplegl::texture_antialias |
OpenGL texture details relating to the number of samples to use for the texture. More... | |
class | staplegl::texture_2d |
2D texture wrapper. More... | |
Namespaces | |
namespace | staplegl |
Functions | |
static constexpr auto | staplegl::to_mipmap (std::int32_t filter_type) -> std::int32_t |
Convert a filter type to its mipmap counterpart. | |
Texture abstraction.
Abstracts away the creation and usage of a 2D texture. Textures are 2D images that can be used to read and write data in the GPU.
staplegl provides a single interface for 2D texture creation whether the texture is to be used as an object's material or as a framebuffer attachment.
For this reason, the texture's constructor takes a number of structs that specify the texture's behavior, such as the color format and data type, the various filtering algorithms to use, and the number of samples to use for the texture.
The constructor has sensible defaults, so that the user can create a simple texture just by passing the data, the resolution and the color format/filters.
Definition in file texture.hpp.