Oxygen Basic
Programming => Problems & Solutions => Topic started by: Peter on April 03, 2013, 05:24:23 AM
-
Deleted
-
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
-
Hi Peter ,
first of all you have to make check of your screen color format , E.g does it ARGB or RBG or BGRA ,etc.....
so Oxygen has no help here , i had have this problem when i was working with my libraries .
and you have correct the color format by yourself.