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_Tex
There is more information about that in:
https://thenumbat.github.io/cpp-course/sdl2/05/05.html
As mentioned in the last lesson, textures are the GPU rendering equivalent of surfaces. Hence, textures are almost always created from surfaces, using the function SDL_CreateTextureFromSurface(). This function more or less does what you'd expect—the parameters are the rendering context and a surface to create the texture from. As with other creation functions, it will return NULL on failure.
I hope it helps you!