mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphicsdriver: Rename MaxTextureSize -> MaxImageSize
This commit is contained in:
parent
7e363a6f3b
commit
61ca48225c
@ -21,22 +21,21 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// maxTextureSize is the maximum texture size
|
||||
// maxImageSize is the maximum texture size
|
||||
//
|
||||
// maxTextureSize also represents the default size (width or height) of viewport.
|
||||
maxTextureSize = 0
|
||||
// maxImageSize also represents the default size (width or height) of viewport.
|
||||
maxImageSize = 0
|
||||
)
|
||||
|
||||
// MaxImageSize returns the maximum of width/height of an image.
|
||||
func MaxImageSize() int {
|
||||
if maxTextureSize == 0 {
|
||||
maxTextureSize = driver().MaxTextureSize()
|
||||
if maxTextureSize == 0 {
|
||||
if maxImageSize == 0 {
|
||||
maxImageSize = driver().MaxImageSize()
|
||||
if maxImageSize == 0 {
|
||||
panic("graphics: failed to get the max texture size")
|
||||
}
|
||||
}
|
||||
s := maxTextureSize
|
||||
return s
|
||||
return maxImageSize
|
||||
}
|
||||
|
||||
// Image represents an image that is implemented with OpenGL.
|
||||
|
@ -23,7 +23,7 @@ type GraphicsDriver interface {
|
||||
BufferSubData(vertices []float32, indices []uint16)
|
||||
DrawElements(len int, offsetInBytes int)
|
||||
Flush()
|
||||
MaxTextureSize() int
|
||||
MaxImageSize() int
|
||||
NewImage(width, height int) (Image, error)
|
||||
NewScreenFramebufferImage(width, height int) Image
|
||||
Reset() error
|
||||
|
@ -83,6 +83,6 @@ func (d *Driver) Flush() {
|
||||
theContext.flush()
|
||||
}
|
||||
|
||||
func (d *Driver) MaxTextureSize() int {
|
||||
func (d *Driver) MaxImageSize() int {
|
||||
return theContext.getMaxTextureSize()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user