Skip to main content
gamedev.net
🔒 Locked

SDL coversion problem

Started by Calamari Nov 8, 2004 at 9:51 AM 1 replies 600+ views
Original Post
Calamari
Calamari
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, ≶, &lb, &la); printf("la: %d ",la); SDL_UnlockSurface(Test01); Any ideas/suggestions would be incredibly helpful! thanx in advance
Calamari
Calamari
thanx, that wasn't it, but i figured it out

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.