mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-27 04:08:53 +01:00
graphics: Fix comments
This commit is contained in:
parent
17daf99c3c
commit
b962d58097
5
image.go
5
image.go
@ -68,6 +68,7 @@ func (m *mipmap) level(r image.Rectangle, level int) *shareable.Image {
|
|||||||
}
|
}
|
||||||
var s *shareable.Image
|
var s *shareable.Image
|
||||||
if m.orig.IsVolatile() {
|
if m.orig.IsVolatile() {
|
||||||
|
// TODO: As s is cleared every frame, is there any reason to keep it?
|
||||||
s = shareable.NewVolatileImage(w2, h2)
|
s = shareable.NewVolatileImage(w2, h2)
|
||||||
} else {
|
} else {
|
||||||
s = shareable.NewImage(w2, h2)
|
s = shareable.NewImage(w2, h2)
|
||||||
@ -736,12 +737,10 @@ func NewImage(width, height int, filter Filter) (*Image, error) {
|
|||||||
// This is suitable for offscreen images that pixels are changed often.
|
// This is suitable for offscreen images that pixels are changed often.
|
||||||
//
|
//
|
||||||
// Pixels in regular non-volatile images are saved at each end of a frame if the image
|
// Pixels in regular non-volatile images are saved at each end of a frame if the image
|
||||||
// is changed, and restored automatically from the saved pixels on GL context lost.
|
// is changed, and restored automatically from the saved pixels on context lost.
|
||||||
// On the other hand, pixels in volatile images are not saved.
|
// On the other hand, pixels in volatile images are not saved.
|
||||||
// Saving pixels is an expensive operation, and it is desirable to avoid it if possible.
|
// Saving pixels is an expensive operation, and it is desirable to avoid it if possible.
|
||||||
//
|
//
|
||||||
// Note that volatile images are internal only and will never be source of drawing.
|
|
||||||
//
|
|
||||||
// If width or height is less than 1 or more than device-dependent maximum size, newVolatileImage panics.
|
// If width or height is less than 1 or more than device-dependent maximum size, newVolatileImage panics.
|
||||||
func newVolatileImage(width, height int) *Image {
|
func newVolatileImage(width, height int) *Image {
|
||||||
i := &Image{
|
i := &Image{
|
||||||
|
Loading…
Reference in New Issue
Block a user