SDL coversion problem

Started by
1 comment, last by Calamari 19 years, 5 months ago
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
Advertisement
http://www.libsdl.org/cgi/docwiki.cgi/Introduction_20to_20SDL_20Video#getpixel
Ad: Ancamnia
thanx, that wasn't it, but i figured it out

This topic is closed to new replies.

Advertisement