SDL_BlitSurface() const correctness

I have a two part question.

  1. Is there a good reason that the SDL_Surface* in SDL_BlitSurface() is not “const”?

  2. Where can I put in a request to make it constant?

I wouldn’t think blitting a surface involves changing the source surface. Not having the “const” keyword destroys const correctness in many use cases, requiring undesired const_casts. Adding const also shouldn’t break any code developed with SDL, only other functions within SDL would need to be updated.

Additionally the destination rect “dstrect” should be const as well, unless its really modified for some reason.

I was wondering this very thing the other day when I had to cast away const to pass the surface to SDL.

The drect, on the other hand, does need to be non-const as it is updated with the final clipped rect as per the documentation (unless something changed).

Ah, I did not see that info about dstrect in the documentation. Thanks for pointing it out.

I’m glad I’m not the only one wondering about src not being const though.