const int w = 10; const int h = 10; const int d = 8; uint8_t* pixels = new uint8_t[w * h] SDL_Surface* src = SDL_CreateRGBSurfaceFrom(pixels, w, h, d, w, 0, 0, 0, 0); SDL_Surface* dst = SDL_ConvertSurface(src, src->format, 0); // src->pitch == 10; // dst->pitch == 12; //std:: cout << src->pitch == dst->pitch << std::endl;
My expected result is that the two pitches must match.
In this case I have the "weird" 12 pitch value for the
dst image create from the
- Is that due to memory alignment optimization?
- Is there any reasonable explanation about it?
- Are those padding bytes used somehow or just wasted?