Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Plot( int x, int y, Pixel color, Surface* surf )
- {
- // get a pointer to the screen pixels
- Pixel* buffer = surf->GetBuffer();
- // plot the pixel
- int pixelnr = x + y * surf->GetWidth();
- buffer[pixelnr] = color;
- }
- // get a pixel at a location
- Pixel Get( int x, int y, Surface* surf )
- {
- // get a pointer to the screen pixels
- Pixel* buffer = surf->GetBuffer();
- // get the pixel
- int pixelnr = x + y * surf->GetWidth();
- return buffer[pixelnr];
- }
Add Comment
Please, Sign In to add comment