mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphics: Make NewVolatileImage unexported
This commit is contained in:
parent
87e0948449
commit
ebe7f10af1
@ -43,7 +43,7 @@ func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale flo
|
||||
if c.offscreen != nil {
|
||||
c.offscreen.Dispose()
|
||||
}
|
||||
offscreen, err := NewVolatileImage(screenWidth, screenHeight, FilterNearest)
|
||||
offscreen, err := newVolatileImage(screenWidth, screenHeight, FilterNearest)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -51,7 +51,7 @@ func (c *graphicsContext) SetSize(screenWidth, screenHeight int, screenScale flo
|
||||
intScreenScale := int(math.Ceil(screenScale))
|
||||
w := screenWidth * intScreenScale
|
||||
h := screenHeight * intScreenScale
|
||||
offscreen2, err := NewVolatileImage(w, h, FilterLinear)
|
||||
offscreen2, err := newVolatileImage(w, h, FilterLinear)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
4
image.go
4
image.go
@ -217,7 +217,7 @@ func NewImage(width, height int, filter Filter) (*Image, error) {
|
||||
return eimg, nil
|
||||
}
|
||||
|
||||
// NewVolatileImage returns an empty 'volatile' image.
|
||||
// newVolatileImage returns an empty 'volatile' image.
|
||||
// A volatile image is always cleared at the start of a frame.
|
||||
//
|
||||
// This is suitable for offscreen images that pixels are changed often.
|
||||
@ -228,7 +228,7 @@ func NewImage(width, height int, filter Filter) (*Image, error) {
|
||||
// Saving pixels is an expensive operation, and it is desirable to avoid it if possible.
|
||||
//
|
||||
// This function is concurrent-safe.
|
||||
func NewVolatileImage(width, height int, filter Filter) (*Image, error) {
|
||||
func newVolatileImage(width, height int, filter Filter) (*Image, error) {
|
||||
img, err := newImageImpl(width, height, filter, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user