mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
opengl: Refactoring: Remove ResetViewportSize
This commit is contained in:
parent
09fe1886d7
commit
6dceeb343c
@ -146,13 +146,6 @@ func (q *commandQueue) Flush() {
|
||||
return
|
||||
}
|
||||
|
||||
// glViewport must be called at least at every frame on iOS.
|
||||
// This is introduced at https://github.com/hajimehoshi/ebiten/commit/e9de66aca2007a679de4ba11ea14ef061dca2f6e.
|
||||
// At that time viewport sizes were always same so it was needed to force to call
|
||||
// glViewport, but now viewport sizes can change and apps can work without this. This is
|
||||
// needed only when the screen framebuffer size and the first framebuffer size are same,
|
||||
// probably.
|
||||
opengl.GetContext().ResetViewportSize()
|
||||
es := q.indices
|
||||
vs := q.vertices
|
||||
if recordLog() {
|
||||
|
@ -100,8 +100,16 @@ func (c *Context) SetViewport(f Framebuffer, width, height int) {
|
||||
c.bindFramebuffer(f)
|
||||
if c.lastViewportWidth != width || c.lastViewportHeight != height {
|
||||
c.setViewportImpl(width, height)
|
||||
c.lastViewportWidth = width
|
||||
c.lastViewportHeight = height
|
||||
// glViewport must be called at least at every frame on iOS.
|
||||
// As the screen framebuffer is the last render target, next SetViewport should be
|
||||
// the first call at a frame.
|
||||
if f == c.screenFramebuffer {
|
||||
c.lastViewportWidth = 0
|
||||
c.lastViewportHeight = 0
|
||||
} else {
|
||||
c.lastViewportWidth = width
|
||||
c.lastViewportHeight = height
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,11 +117,6 @@ func (c *Context) ScreenFramebuffer() Framebuffer {
|
||||
return c.screenFramebuffer
|
||||
}
|
||||
|
||||
func (c *Context) ResetViewportSize() {
|
||||
c.lastViewportWidth = 0
|
||||
c.lastViewportHeight = 0
|
||||
}
|
||||
|
||||
func (c *Context) MaxTextureSize() int {
|
||||
if c.maxTextureSize == 0 {
|
||||
c.maxTextureSize = c.maxTextureSizeImpl()
|
||||
|
Loading…
Reference in New Issue
Block a user