I'm using SDL to load a greyscale bitmap. I know SDL_surface->pixels is an offset to the pixel data. So I did this in an attempt to get the individual values:
Could someone let me know if this is right or now?Code:char* position = (char*) myMap->pixels; position += (y * myMap->pitch); position += (x * myMap->format->BytesPerPixel);
Also another problem Is that I don't really understand what the values are (their type). I want to use them for height mapping.
Thanks in advance!



LinkBack URL
About LinkBacks



