add texture border to atlas residents, actually make use of mipmapping

This commit is contained in:
veclavtalica
2025-02-23 17:14:05 +03:00
parent a88392b9e9
commit d66eda1894
5 changed files with 79 additions and 12 deletions

View File

@ -340,7 +340,7 @@ void finish_index_builder(IndexBufferBuilder *builder) {
static void load_cubemap_side(const char *path, GLenum target) {
SDL_Surface *surface = textures_load_surface(path);
SDL_Surface *surface = textures_load_surface(path, false);
/* TODO: sanity check whether all of them have same dimensions? */
glTexImage2D(target,
0,
@ -350,6 +350,7 @@ static void load_cubemap_side(const char *path, GLenum target) {
surface->format->BytesPerPixel == 4 ? GL_RGBA : GL_RGB,
GL_UNSIGNED_BYTE,
surface->pixels);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);