PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Bug in 0.70 pocketfrog ?!

I couldn't find the getpixel function in the surface.h and surface.cpp file dated 5-15-2002.

I read that GetPixel() is implemented but it's not.

Any ideas how to get pixel without using GDI which
is what im using now ?
oh btw im using Surface *fs

color = fs->GetPixel(x,y);

it says GetPixel is not a member of surface class?
There is indeed no GetPixel(x,y) on surface,
use the Lock() on a surface to grab the LockInfo object and use the GetPixels() method to receive a pointer to the surface data
GetPixel() is a Rasterizer function.

Do this:
Code:
Rasterizer *rasterizer_name = GetDisplay()->CreateRasterizer(surface_name);
Pixel my_pixel = rasterizer_name->GetPixel(x_coordinate, y_coordinate);

You might want to check out the disintegrate and collision code I posted a couple of weeks ago. It uses GetPixel and SetPixel extensively.

-John