Where can I get correct pitch parameter for SDL RenderReadPixels function in SDL2? I have a texture created with SDL TEXTUREACCESS TARGET access and I want to get all its pixels with SDL RenderReadPixels() function. One of the function parameters is pitch and I don't really know where can I can get it. Texture is created with dimensions of a previously created surface, but function call with surface gt pitch as pitch parameter generates EXC BAD ACCESS. Texture and surface dimensions are 800x600, and surface gt pitch returns 3200, which is strange for me, because I thought that pitch is the width of the texture in memory and expected surface gt pitch to be something like 1024.