[SDL] Accesing pixels directly in an image

Alfonso Palma ponchete at yahoo.com
Tue Sep 12 22:25:20 PDT 2006

Hi everyone i'm new at SDL and i would like to ask for
a solution for this problem

I have just done something like this:

SDL_Surface *image;
image = SDL_LoadBMP("whatever.bmp");

// Then i need to access the pixels of this bmp
// so i would call:

math_operation = image->pixels[index];

// and whatever use i want, right?

But pixels is a *void pointer and when i try to
compile this i get the error

error C2036: 'void *' : unknown size

and any arithmetical operation done with this pixels
is invalid

so, any sugestions on trying to access this pixels as
float numbers?

Any help is really apreciated

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the SDL mailing list