Hello, and apologies beforehand for the bother. If anyone has the time, please could you clarify these doubts?
- Clipping, in general. While working with a tile map, I started doing the routine for correctly sizing the tile sub rectangle to copy so that it would not over-lap the edges or corners of the target surface, if the tile was not perfectly aligned with said edge or corner. It used to be important, once upon a time, and is not a big deal to create the function. But; then I (re)read this properly, on the SDL_BlitSurface documentation…
This is the public blit function, and it performs rectangle validation and clipping before passing it to SDL_LowerBlit().
I conclude that, therefore, clipping is not necessary if we use SDL_BlitSurface. So, clipping does remain an important consideration under certain circumstances. Which brings me to the following;
Does the same apply when rendering onto target textures? It is not clear in the documentation if the functions for SDL_RenderDrawLine, SDL_RenderDrawRect and SDL_RenderFillRect (and their “cousins”), and indeed SDL_RenderCopy, perform clipping automatically, too.
For safety, I have been making a larger than necessary texture, with a fringe, that can accommodate forays “off the edge”, when working with the renderer. I then grab the rectangle of interest excluding the fringe, for final presentation. However, I also tested extending a draw line right off the target texture, to no apparent ill effects. I assume, therefore, that clipping is done prior to any form of texture drawing or texture copying. But I might be getting myself into some trouble.
Could you please confirm that clipping is done on texture draw functions?
- An issue with SDL_BlitScaled that took two sessions to finally corner, and cost a couple of fistfuls of hair in the process. I have been using 8 bit indexed pixel format, paletted surfaces for the tile source, for a tiled map experiment, which has slew and zoom functions. However, when invoking the zoom, the 8 bit tiles refuse to scale up or down (they just do not blit). SDL_GetError says that the operation is not supported. It does work fine with a 32 bit tile source, however.
Again, there was no mention in the docs, as far as I have read, that 8 bit images are not supported by SDL_BlitScaled. I am assuming it is deliberate, and just not documented, or otherwise, should SDL_BlitScaled support 8 bit rectangle scaling, too?
Apologies again for the nitpicking. Just want to be clear.
All the best, and thanks in advance.