mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphicscommand: Add assertion (the screen cannot be a render source)
This commit is contained in:
parent
5afcc65387
commit
e6c0c73b9e
@ -136,6 +136,7 @@ func (q *commandQueue) EnqueueDrawImageCommand(dst, src *Image, vertices []float
|
||||
q.nextIndex += len(vertices) / graphics.VertexFloatNum
|
||||
q.tmpNumIndices += len(indices)
|
||||
|
||||
// TODO: If dst is the screen, reorder the command to be the last.
|
||||
q.doEnqueueDrawImageCommand(dst, src, len(vertices), len(indices), color, mode, filter, address, split)
|
||||
}
|
||||
|
||||
@ -143,6 +144,7 @@ func (q *commandQueue) EnqueueDrawImageCommand(dst, src *Image, vertices []float
|
||||
//
|
||||
// For a draw-image command, use EnqueueDrawImageCommand.
|
||||
func (q *commandQueue) Enqueue(command command) {
|
||||
// TODO: If dst is the screen, reorder the command to be the last.
|
||||
q.commands = append(q.commands, command)
|
||||
}
|
||||
|
||||
|
@ -83,6 +83,10 @@ func (i *Image) Size() (int, int) {
|
||||
}
|
||||
|
||||
func (i *Image) DrawImage(src *Image, vertices []float32, indices []uint16, clr *affine.ColorM, mode graphics.CompositeMode, filter graphics.Filter, address graphics.Address) {
|
||||
if src.screen {
|
||||
panic("graphicscommand: the screen image cannot be the rendering source")
|
||||
}
|
||||
|
||||
if i.lastCommand == lastCommandNone {
|
||||
if !i.screen && mode != graphics.CompositeModeClear {
|
||||
panic("graphicscommand: the image must be cleared first")
|
||||
|
Loading…
Reference in New Issue
Block a user