mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
parent
3a0dbd3977
commit
5ec2f66524
@ -39,6 +39,13 @@ var (
|
||||
maxSize = 0
|
||||
)
|
||||
|
||||
func min(a, b int) int {
|
||||
if a < b {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func init() {
|
||||
var once sync.Once
|
||||
hooks.AppendHookOnBeforeUpdate(func() error {
|
||||
@ -52,10 +59,7 @@ func init() {
|
||||
minSize = 1024
|
||||
// Use 4096 as a maximum size whatever size the graphics driver accepts. There are
|
||||
// not enough evidences that bigger textures works correctly.
|
||||
maxSize = 4096
|
||||
if m := graphicsDriver.MaxImageSize(); maxSize < m {
|
||||
maxSize = m
|
||||
}
|
||||
maxSize = min(4096, graphicsDriver.MaxImageSize())
|
||||
} else {
|
||||
minSize = 512
|
||||
maxSize = 512
|
||||
|
Loading…
Reference in New Issue
Block a user