mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
internal/graphicsdriver/directx: fix moveToNextFrame for Xbox
Updates #2084
This commit is contained in:
parent
f8e9dcf035
commit
969e87fb89
@ -685,8 +685,11 @@ func (g *Graphics) moveToNextFrame() error {
|
||||
}
|
||||
|
||||
// Update the frame index.
|
||||
// TODO: The calculation might be different in Xbox.
|
||||
g.frameIndex = int(g.swapChain.GetCurrentBackBufferIndex())
|
||||
if microsoftgdk.IsXbox() {
|
||||
g.frameIndex = (g.frameIndex + 1) % frameCount
|
||||
} else {
|
||||
g.frameIndex = int(g.swapChain.GetCurrentBackBufferIndex())
|
||||
}
|
||||
|
||||
if g.fence.GetCompletedValue() < g.fenceValues[g.frameIndex] {
|
||||
if err := g.fence.SetEventOnCompletion(fv, g.fenceWaitEvent); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user