//Draw the ballon in the pixels

Draw the ballon in the pixels
// Draw the ballon in the pixels
func (txt *Texture) Draw(pixels Pixels) Pixels{
	for y := 0; y < txt.H; y++ {
		for x := 0; x < txt.W; x++{
			screenY := y + int(txt.Y)
			screenX := x + int(txt.X)
			if(screenX >= 0 && screenX < winWidth && screenY >= 0 && screenY < winHeigth) {
				txtIndex := y * txt.Pitch + x * 4
				screenIndex := screenY * winWidth * 4 + screenX * 4 
				pixels.screen[screenIndex] = txt.TexturePixels[txtIndex]
				pixels.screen[screenIndex+1] = txt.TexturePixels[txtIndex+1]
				pixels.screen[screenIndex+2] = txt.TexturePixels[txtIndex+2]
				pixels.screen[screenIndex+3] = txt.TexturePixels[txtIndex+3]
			}
		}
	}
	return pixels
}
func ( txt * Texture ) Draw ( pixels Pixels ) Pixels { for y := 0 ; y < txt . H ; y ++ { for x := 0 ; x < txt . W ; x ++ { screenY := y + int ( txt . Y ) screenX := x + int ( txt . X ) if ( screenX >= 0 && screenX < winWidth && screenY >= 0 && screenY < winHeigth ) { txtIndex := y * txt . Pitch + x * 4 screenIndex := screenY * winWidth * 4 + screenX * 4 pixels . screen [ screenIndex ] = txt . TexturePixels [ txtIndex ] pixels . screen [ screenIndex + 1 ] = txt . TexturePixels [ txtIndex + 1 ] pixels . screen [ screenIndex + 2 ] = txt . TexturePixels [ txtIndex + 2 ] pixels . screen [ screenIndex + 3 ] = txt . TexturePixels [ txtIndex + 3 ] } } } return pixels }
Draw the ballon in the pixels
Draw the ballon in the pixels