summaryrefslogtreecommitdiffhomepage
path: root/atlas.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-02-21 14:29:22 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-02-21 14:29:22 +0100
commit5eb4ae08d5cd81f7315998394054aa50e52b6870 (patch)
tree1174490ccb5cbcb4167d715a30d385e796beb25d /atlas.cpp
parentb8aa39d289c605b13bb550b786cba3f646fa5b48 (diff)
buffer flush
Diffstat (limited to 'atlas.cpp')
-rw-r--r--atlas.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/atlas.cpp b/atlas.cpp
index 4e384540..1463c26a 100644
--- a/atlas.cpp
+++ b/atlas.cpp
@@ -1,4 +1,5 @@
#include "atlas.hpp"
+#include "defs.hpp"
#include <Magnum/ImageView.h>
#include <Magnum/GL/TextureFormat.h>
@@ -12,10 +13,11 @@ atlas_texture::atlas_texture(const Trade::ImageData2D& image, Vector2i dims) :
CORRADE_INTERNAL_ASSERT(dims_[0] > 0 && dims_[1] > 0);
CORRADE_INTERNAL_ASSERT(tile_size_ * dims_ == size_);
CORRADE_INTERNAL_ASSERT(size_ % dims_ == Vector2i{});
+ CORRADE_INTERNAL_ASSERT(dims.product() < 256);
tex_.setWrapping(GL::SamplerWrapping::ClampToEdge)
.setMagnificationFilter(GL::SamplerFilter::Linear)
.setMinificationFilter(GL::SamplerFilter::Linear)
- .setStorage(1, GL::textureFormat(image.format()), image.size())
+ .setStorage(MIPMAP_LEVEL, GL::textureFormat(image.format()), image.size())
.setSubImage(0, {}, image);
}