mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphics: Stop unnecessary copy of elements (projection matrix)
This commit is contained in:
parent
40b1948baa
commit
30e48d5c3c
@ -261,7 +261,9 @@ func (s *openGLState) useProgram(proj []float32, texture opengl.Texture, sourceW
|
|||||||
if s.lastProjectionMatrix == nil {
|
if s.lastProjectionMatrix == nil {
|
||||||
s.lastProjectionMatrix = make([]float32, 16)
|
s.lastProjectionMatrix = make([]float32, 16)
|
||||||
}
|
}
|
||||||
copy(s.lastProjectionMatrix, proj)
|
// (*framebuffer).projectionMatrix is always same for the same framebuffer.
|
||||||
|
// It's OK to hold the reference without copying.
|
||||||
|
s.lastProjectionMatrix = proj
|
||||||
}
|
}
|
||||||
|
|
||||||
esBody, esTranslate := colorM.UnsafeElements()
|
esBody, esTranslate := colorM.UnsafeElements()
|
||||||
|
Loading…
Reference in New Issue
Block a user