summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-02-19 18:02:34 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-02-19 18:02:34 +0100
commit241d6bf6f4414cb5238d0193014b653a50e0fe64 (patch)
treee21f6b1683e58dfcb78f2432c6dfb4fb121ebb29
parent932ee8367c7e5641b7bdcd495e7f92429c516021 (diff)
flush
-rw-r--r--atlas.cpp2
-rw-r--r--main.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/atlas.cpp b/atlas.cpp
index 932e8c32..4e384540 100644
--- a/atlas.cpp
+++ b/atlas.cpp
@@ -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);
diff --git a/main.cpp b/main.cpp
index 556f057a..964f3fc0 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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++;
}