Dacobi wrote: ↑Tue May 30, 2023 7:25 am
Scale2x is actually literally one of those fancy upscaling algorithms
I also tried upscaling the offscreen rotation texture by 8x before rotating and then scale back down, but it didn't seem to have any beneficial effect. Probably because the SDL renderer doesn't use any texture filtering and of course doesn't have any algorithm for upscaling.
Right, you would need to specifically run the pixel art through a special upscaling filter if you were going to do the upscale/rotate/downscale method; using the native bicubic interpolation is just going to give you a bunch of blurry pixels, which may not be what you'd want for rotation.
Also, to deal with DPI scaling on Windows with the manifest file, here's what you do:
yourProgramName.exe.manifest
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<!-- <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2,PerMonitor</dpiAwareness> -->
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
I think I grabbed this code from
here originally. "dpiAware" is the one that's compatible with older versions of Windows, and "dpiAwareness" is the newer W10+ one with extra capabilities. In my project, the older "dpiAware" one was good enough for me so that's why the other one is commented out.
yourProgramName.rc
Code: Select all
1 24 "yourProgramName.exe.manifest"
Use
windres (part of your compiler toolchain) to compile your
.rc file into a
.res file, then include the
.res file along with all of the
.o files when you link the main binary. This is what embeds the manifest into the EXE so you don't need any registry tweaks or supplementary files.