Jump to content
  • Advertisement
Sign in to follow this  
Calamari

SDL coversion problem

This topic is 5093 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm trying to find a per pixel value from an SDL_surface. everytime i run the program, it craps out converting a Uint8 to Uint32. Or does it? This is the code: SDL_LockSurface(Test01); Uint8 *p_8; p_8 = (Uint8*) Test01->pixels + ly * Test01->pitch + lx * 2 ; Uint32 col; col= *(Uint32*)p_8 ; // never gets to the print stage; printf("color: %d ",col); Uint8 lr, lg, lb, la; SDL_GetRGBA(col, Test01->format, &lr, &lg, &lb, &la); printf("la: %d ",la); SDL_UnlockSurface(Test01); Any ideas/suggestions would be incredibly helpful! thanx in advance

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!