add imgui stylign window + change how texture filters are applied

This commit is contained in:
2024-01-21 20:20:32 +01:00
parent 93140231c6
commit 2647c85323
4 changed files with 20 additions and 8 deletions

View File

@ -17,16 +17,15 @@ uint64_t SDLRendererTextureUploader::uploadRGBA(const uint8_t* data, uint32_t wi
);
assert(surf); // TODO: add error reporting
// TODO: this touches global state, reset?
if (filter == NEAREST) {
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest");
} else if (filter == LINEAR) {
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
}
SDL_Texture* tex = SDL_CreateTextureFromSurface(renderer, surf);
assert(tex); // TODO: add error reporting
if (filter == NEAREST) {
SDL_SetTextureScaleMode(tex, SDL_SCALEMODE_NEAREST);
} else if (filter == LINEAR) {
SDL_SetTextureScaleMode(tex, SDL_SCALEMODE_LINEAR);
}
SDL_DestroySurface(surf);
return reinterpret_cast<uint64_t>(tex);