add imgui stylign window + change how texture filters are applied
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user