diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-02-19 18:02:34 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-02-19 18:02:34 +0100 |
| commit | 241d6bf6f4414cb5238d0193014b653a50e0fe64 (patch) | |
| tree | e21f6b1683e58dfcb78f2432c6dfb4fb121ebb29 | |
| parent | 932ee8367c7e5641b7bdcd495e7f92429c516021 (diff) | |
flush
| -rw-r--r-- | atlas.cpp | 2 | ||||
| -rw-r--r-- | main.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -13,7 +13,7 @@ atlas_texture::atlas_texture(const Trade::ImageData2D& image, Vector2i dims) : CORRADE_INTERNAL_ASSERT(tile_size_ * dims_ == size_); CORRADE_INTERNAL_ASSERT(size_ % dims_ == Vector2i{}); tex_.setWrapping(GL::SamplerWrapping::ClampToEdge) - .setMagnificationFilter(GL::SamplerFilter::Nearest) + .setMagnificationFilter(GL::SamplerFilter::Linear) .setMinificationFilter(GL::SamplerFilter::Linear) .setStorage(1, GL::textureFormat(image.format()), image.size()) .setSubImage(0, {}, image); @@ -56,7 +56,7 @@ application::application(const Arguments& arguments): }; std::vector<QuadVertex> vertices; vertices.reserve(64*64*4); - std::vector<Short> indices; indices.reserve(64*64*4); + std::vector<UnsignedShort> indices; indices.reserve(256); int k = 0; for (int j = -2; j <= 2; j++) @@ -64,13 +64,13 @@ application::application(const Arguments& arguments): { constexpr int sz = 48; auto positions = atlas.floor_quad({(float)(sz*i), (float)(sz*j), 0}, {sz, sz}); - auto texcoords = atlas.texcoords_for_id(k % atlas.size()); + auto texcoords = atlas.texcoords_for_id(((k+5)*101) % atlas.size()); auto indices_ = atlas.indices(k); for (unsigned x = 0; x < 4; x++) vertices.push_back({ positions[x], texcoords[x] }); for (auto x : indices_) - indices.push_back((Short)x); + indices.push_back(x); k++; } |
