Created
September 21, 2012 04:14
-
-
Save jrenner/3759689 to your computer and use it in GitHub Desktop.
Can't convert unsafe.Pointer to int
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func getPixel(surface *sdl.Surface, x, y int) uint32 { | |
var bpp uint8 = surface.Format.BytesPerPixel | |
/* Here p is the address to the pixel we want to retrieve */ | |
var p *uint32 = *uint32(int(surface.Pixels) + y*int(surface.Pitch) + x*bpp) | |
return *p | |
return 1 /* shouldn't happen, but avoids warnings */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment