9 static bool const result = epoxy_gl_version() >= 42 || epoxy_has_gl_extension(
"GL_ARB_texture_storage");
15 static bool const result = epoxy_gl_version() >= 43 || epoxy_has_gl_extension(
"ARB_invalidate_subdata");
22 glGenTextures(1, &
_id);
23 glBindTexture(GL_TEXTURE_2D,
_id);
26 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
27 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
28 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
29 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
32 glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8,
size.
x(),
size.
y());
35 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
36 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
37 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8,
size.
x(),
size.
y(), 0, GL_BGRA, GL_UNSIGNED_BYTE,
nullptr);
44 glInvalidateTexImage(
_id, 0);
Two-dimensional point with integer coordinates.
constexpr IntCoord x() const noexcept
constexpr IntCoord y() const noexcept
Geom::IntPoint const & size() const