graphicsdriver: Rename MaxTextureSize -> MaxImageSize

This commit is contained in:
Hajime Hoshi 2018-11-11 01:26:37 +09:00
parent 7e363a6f3b
commit 61ca48225c
3 changed files with 9 additions and 10 deletions

View File

@ -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.

View File

@ -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

View File

@ -83,6 +83,6 @@ func (d *Driver) Flush() {
theContext.flush()
}
func (d *Driver) MaxTextureSize() int {
func (d *Driver) MaxImageSize() int {
return theContext.getMaxTextureSize()
}