SDL_Surface get/set pixel code

How confident can I be that the code to get & set
pixels in the example code (under “Drawing directly
to the display”) will be correct in the future?

Is there a reason SDL doesn’t provide “SDL_GetPixel()/
SDL_SetPixel()” calls?

Thanks,

– Joe Knapka

How confident can I be that the code to get & set
pixels in the example code (under “Drawing directly
to the display”) will be correct in the future?

As long as the concept of a framebuffer doesn’t change, you should be fine.

Is there a reason SDL doesn’t provide “SDL_GetPixel()/
SDL_SetPixel()” calls?

Getting and setting a pixel is a slow operation.
My thought that was if you need to do this, you can probably optimize the
surface access better than I can, by knowing more about the type of access
and format of the surface than the library will.

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec