mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/ui: refactoring: remove unused code
This commit is contained in:
parent
c658a25171
commit
1ebfa8b911
@ -73,21 +73,6 @@ func (c *context) updateFrame(graphicsDriver graphicsdriver.Graphics, outsideWid
|
||||
return c.updateFrameImpl(graphicsDriver, clock.UpdateFrame(), outsideWidth, outsideHeight, deviceScaleFactor, ui, false)
|
||||
}
|
||||
|
||||
func (c *context) forceUpdateFrame(graphicsDriver graphicsdriver.Graphics, outsideWidth, outsideHeight float64, deviceScaleFactor float64, ui *UserInterface) error {
|
||||
n := 1
|
||||
if ui.GraphicsLibrary() == GraphicsLibraryDirectX {
|
||||
// On DirectX, both framebuffers in the swap chain should be updated.
|
||||
// Or, the rendering result becomes unexpected when the window is resized.
|
||||
n = 2
|
||||
}
|
||||
for i := 0; i < n; i++ {
|
||||
if err := c.updateFrameImpl(graphicsDriver, 1, outsideWidth, outsideHeight, deviceScaleFactor, ui, true); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *context) updateFrameImpl(graphicsDriver graphicsdriver.Graphics, updateCount int, outsideWidth, outsideHeight float64, deviceScaleFactor float64, ui *UserInterface, forceDraw bool) (err error) {
|
||||
// The given outside size can be 0 e.g. just after restoring from the fullscreen mode on Windows (#1589)
|
||||
// Just ignore such cases. Otherwise, creating a zero-sized framebuffer causes a panic.
|
||||
@ -308,7 +293,6 @@ func (c *context) runInFrame(f func()) {
|
||||
f()
|
||||
}
|
||||
<-ch
|
||||
return
|
||||
}
|
||||
|
||||
func (c *context) processFuncsInFrame(ui *UserInterface) error {
|
||||
|
@ -98,7 +98,7 @@ func (i *Image) DrawTriangles(srcs [graphics.ShaderImageCount]*Image, vertices [
|
||||
i.bigOffscreenBuffer = i.ui.newBigOffscreenImage(i, imageType)
|
||||
}
|
||||
|
||||
i.bigOffscreenBuffer.drawTriangles(srcs, vertices, indices, blend, dstRegion, srcRegions, shader, uniforms, fillRule, canSkipMipmap, false)
|
||||
i.bigOffscreenBuffer.drawTriangles(srcs, vertices, indices, blend, dstRegion, srcRegions, shader, uniforms, fillRule, canSkipMipmap)
|
||||
return
|
||||
}
|
||||
|
||||
@ -217,7 +217,7 @@ func (i *bigOffscreenImage) deallocate() {
|
||||
i.dirty = false
|
||||
}
|
||||
|
||||
func (i *bigOffscreenImage) drawTriangles(srcs [graphics.ShaderImageCount]*Image, vertices []float32, indices []uint32, blend graphicsdriver.Blend, dstRegion image.Rectangle, srcRegions [graphics.ShaderImageCount]image.Rectangle, shader *Shader, uniforms []uint32, fillRule graphicsdriver.FillRule, canSkipMipmap bool, antialias bool) {
|
||||
func (i *bigOffscreenImage) drawTriangles(srcs [graphics.ShaderImageCount]*Image, vertices []float32, indices []uint32, blend graphicsdriver.Blend, dstRegion image.Rectangle, srcRegions [graphics.ShaderImageCount]image.Rectangle, shader *Shader, uniforms []uint32, fillRule graphicsdriver.FillRule, canSkipMipmap bool) {
|
||||
if i.blend != blend {
|
||||
i.flush()
|
||||
}
|
||||
|
@ -97,13 +97,6 @@ func (m *monitors) primaryMonitor() *Monitor {
|
||||
return m.monitors[0]
|
||||
}
|
||||
|
||||
func (m *monitors) monitorFromID(id int) *Monitor {
|
||||
m.m.Lock()
|
||||
defer m.m.Unlock()
|
||||
|
||||
return m.monitors[id]
|
||||
}
|
||||
|
||||
// monitorFromPosition returns a monitor for the given position (x, y),
|
||||
// or returns nil if monitor is not found.
|
||||
// The position is in GLFW pixels.
|
||||
|
@ -242,7 +242,6 @@ var (
|
||||
sel_setOrigResizable = objc.RegisterName("setOrigResizable:")
|
||||
sel_toggleFullScreen = objc.RegisterName("toggleFullScreen:")
|
||||
sel_windowDidBecomeKey = objc.RegisterName("windowDidBecomeKey:")
|
||||
sel_windowDidDeminiaturize = objc.RegisterName("windowDidDeminiaturize:")
|
||||
sel_windowDidEnterFullScreen = objc.RegisterName("windowDidEnterFullScreen:")
|
||||
sel_windowDidExitFullScreen = objc.RegisterName("windowDidExitFullScreen:")
|
||||
sel_windowDidMiniaturize = objc.RegisterName("windowDidMiniaturize:")
|
||||
|
Loading…
Reference in New Issue
Block a user