Sign in to follow this  

SDL coversion problem

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this