diff --git a/drawer.go b/drawer.go index 4ee50c8..25d61aa 100644 --- a/drawer.go +++ b/drawer.go @@ -15,6 +15,11 @@ package pixel // // Whenever you change the Triangles, call Dirty to notify Drawer that Triangles changed. You don't // need to notify Drawer about a change of the Picture. +// +// Note, that Drawer caches the results of MakePicture from Targets it's drawn to for each Picture +// it's set to. What it means is that using a Drawer with an unbounded number of Pictures leads to a +// memory leak, since Drawer caches them and never forgets. In such a situation, create a new Drawer +// for each Picture. type Drawer struct { Triangles Triangles Picture Picture diff --git a/sprite.go b/sprite.go index 9b08e51..6ac9aeb 100644 --- a/sprite.go +++ b/sprite.go @@ -11,6 +11,11 @@ import "image/color" // // To achieve different anchoring, transformations and color masking, use SetMatrix and SetColorMask // methods. +// +// Note, that Sprite caches the results of MakePicture from Targets it's drawn to for each Picture +// it's set to. What it means is that using a Sprite with an unbounded number of Pictures leads to a +// memory leak, since Sprite caches them and never forgets. In such a situation, create a new Sprite +// for each Picture. type Sprite struct { tri *TrianglesData frame Rect