Hey all,
I’m working with c++ and SDL2 on a very basic game. Because i use very small images (max. 64x64) it is important for me to be pixel accurate. But when I try to rotate an e.g. 10x10 image by multiples of 90?? they get shifted as shown in the following:
[Image: http://i.stack.imgur.com/QWGfC.jpg ]
I guess that’s happening because the center is picked as pixel (5,5), which is not the center but actually a little off to the right bottom. The actual center point should be the line between (4,4)and (5,5), but SDL doesn’t allow float values when rendering. Even though the 10x10 image is perfectly rotatable (works in e.g. Gimp) SDL doesn’t seem to take the even dimensions of the texture into account.
So is there a way to correctly rotate images in SDL or do i have to check the angle by hand and if it is a multiple of 90?? shift it back myself after rotation? For angles that are not multiples of 90?? i don’t care as much, because the image will be quite destorted when looking at the individual pixels and you wouldn’t recognise a shift by 1 pixel as easy.
Thanks and best regards,
Stefan