   How to query width height and bits from SDL?
  I have read SDL-Image Documentations. But it said only How to load but no query the state of the images. Anyideas  to query width , height and bits from SDL-Image ?   
Quote:Original post by As-12I have read SDL-Image Documentations. But it said only How to load but no query the state of the images. Anyideas  to query width , height and bits from SDL-Image ?I've never used SDL but it appears that all of the Loading functions return a pointer to an SDL_Surface, which appears to be a struct that holds the information you want.   ;  The documentation is your friend.   ;SDL_Surface *surf = SDL_LoadBMP("mmmhmmm.bmp");int width = surf->w; //Get the widthint height = surf ->h;  //Get the heightunsigned char *data = (unsigned char)surf->pixels; //Get the image dataAlso you can cheak what format the data in pixels is using the format member of SDL_Surface.   ;Quote:Original post by TaymoSDL_Surface *surf = SDL_LoadBMP("mmmhmmm.bmp");int width = surf->w; //Get the widthint height = surf ->h;  //Get the heightunsigned char *data = (unsigned char)surf->pixels; //Get the image dataAlso you can cheak what format the data in pixels is using the format member of SDL_Surface.Just make sure that if you are accessing the pixel data, you lock the surface if it needs to be locked (AKA, if it's a hardware surface instead of a software surface).   