Can anyone explain to me in simple words what is the difference between texture and surface? I saw it used in SDL2 as SDL_Surface and SDL_Texture. SDL_Textureis created from SDL_Surface which in turn is created from image/bitmap. Both are collection of pixels. But I do not see the main difference between them (has to do something with GPU?)
I tried to google it but all explanations I found were too complex to understand them without digging deeper into computer graphics stuff.
SDL_TextureandSDL_Surfaceas well asSDL_Renderer. In general,SDL_Textureis what is used for rendering, but when you load texture information usingSDL_ImageorSDL_ttf, you'll get the data as anSDL_Surface- olevegardSDL_Surfaceis just a collection of pixels whileSDL_Textureisan efficient, driver-specific representation of pixel datameaning it can be used by the GPU wiki.libsdl.org/SDL_Texture. Did that answer your question? You really should dig deeper into computer graphics to understand more - olevegard