SDL Surfaces and Colors

Explore SDL surfaces, the canvases for drawing, understand pixel formats, colors, and set your window's background.

Ryan McCombe
Published
Hello! I'm here to help you with any questions about this lesson. Feel free to ask me anything - whether it's about specific concepts, examples, or how to apply what you've learned!

Questions & Answers

Answers are generated by AI models and may not have been reviewed. Be mindful when running any code on your device.

Difference Between SDL_Window and SDL_Surface in SDL2
What's the difference between an SDL_Window and an SDL_Surface?
Details Contained within an SDL_PixelFormat Struct
What information does an SDL_PixelFormat contain?
Understanding Rmask, Gmask, Bmask, Amask in SDL_PixelFormat
What are the Rmask, Gmask, Bmask, Amask members in SDL_PixelFormat?
Filling Only Part of an SDL_Surface with SDL_FillRect()
What if I only want to fill part of the window surface using SDL_FillRect()?
Understanding SDL_Surface Coordinate System (0,0)
Where does the (0,0) coordinate of the surface correspond to on the window?
Creating an SDL_Surface Independently of a Window
Can I create my own SDL_Surface independent of a window? How?
Difference Between SDL_Surface and SDL_Texture in SDL2
What is the difference between an SDL_Surface and an SDL_Texture in SDL?