Hi Peter,
A little brain teaser:
I assum the surface.pixels is a pixel array base pointer, and you are mapping pixels to it.
Function GetPixel(int x, y) as sys Export
dword *pixel
&pixel = screen.pixels '&screen is already defined
Return pixel[y*screen.w+x]
End Function
Function GetPixel(int x, y) as sys Export
SDL_surface *surface
&surface= ... 'need to obtain a surface handle from SDL
dword *pixel
&pixel = surface.pixels
Return pixel[y*surface.w+x]
End Function