mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
internal/graphicscommand: rename WritePixelsArgs -> PixelsArgs
Updates #2592
This commit is contained in:
parent
b084ccb456
commit
377b0b8502
@ -466,7 +466,7 @@ func mightOverlapDstRegions(vertices1, vertices2 []float32) bool {
|
|||||||
// writePixelsCommand represents a command to replace pixels of an image.
|
// writePixelsCommand represents a command to replace pixels of an image.
|
||||||
type writePixelsCommand struct {
|
type writePixelsCommand struct {
|
||||||
dst *Image
|
dst *Image
|
||||||
args []*graphicsdriver.WritePixelsArgs
|
args []*graphicsdriver.PixelsArgs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *writePixelsCommand) String() string {
|
func (c *writePixelsCommand) String() string {
|
||||||
|
@ -43,7 +43,7 @@ type Image struct {
|
|||||||
// have its graphicsdriver.Image.
|
// have its graphicsdriver.Image.
|
||||||
id int
|
id int
|
||||||
|
|
||||||
bufferedWP []*graphicsdriver.WritePixelsArgs
|
bufferedWP []*graphicsdriver.PixelsArgs
|
||||||
}
|
}
|
||||||
|
|
||||||
var nextID = 1
|
var nextID = 1
|
||||||
@ -178,7 +178,7 @@ func (i *Image) ReadPixels(graphicsDriver graphicsdriver.Graphics, buf []byte, r
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) WritePixels(pixels []byte, region image.Rectangle) {
|
func (i *Image) WritePixels(pixels []byte, region image.Rectangle) {
|
||||||
i.bufferedWP = append(i.bufferedWP, &graphicsdriver.WritePixelsArgs{
|
i.bufferedWP = append(i.bufferedWP, &graphicsdriver.PixelsArgs{
|
||||||
Pixels: pixels,
|
Pixels: pixels,
|
||||||
Region: region,
|
Region: region,
|
||||||
})
|
})
|
||||||
|
@ -130,7 +130,7 @@ func (i *image11) ReadPixels(buf []byte, region image.Rectangle) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *image11) WritePixels(args []*graphicsdriver.WritePixelsArgs) error {
|
func (i *image11) WritePixels(args []*graphicsdriver.PixelsArgs) error {
|
||||||
for _, a := range args {
|
for _, a := range args {
|
||||||
i.graphics.deviceContext.UpdateSubresource(unsafe.Pointer(i.texture), 0, &_D3D11_BOX{
|
i.graphics.deviceContext.UpdateSubresource(unsafe.Pointer(i.texture), 0, &_D3D11_BOX{
|
||||||
left: uint32(a.Region.Min.X),
|
left: uint32(a.Region.Min.X),
|
||||||
|
@ -149,7 +149,7 @@ func (i *image12) ReadPixels(buf []byte, region image.Rectangle) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *image12) WritePixels(args []*graphicsdriver.WritePixelsArgs) error {
|
func (i *image12) WritePixels(args []*graphicsdriver.PixelsArgs) error {
|
||||||
if i.screen {
|
if i.screen {
|
||||||
return errors.New("directx: WritePixels cannot be called on the screen")
|
return errors.New("directx: WritePixels cannot be called on the screen")
|
||||||
}
|
}
|
||||||
|
@ -68,12 +68,12 @@ type Image interface {
|
|||||||
Dispose()
|
Dispose()
|
||||||
IsInvalidated() bool
|
IsInvalidated() bool
|
||||||
ReadPixels(buf []byte, region image.Rectangle) error
|
ReadPixels(buf []byte, region image.Rectangle) error
|
||||||
WritePixels(args []*WritePixelsArgs) error
|
WritePixels(args []*PixelsArgs) error
|
||||||
}
|
}
|
||||||
|
|
||||||
type ImageID int
|
type ImageID int
|
||||||
|
|
||||||
type WritePixelsArgs struct {
|
type PixelsArgs struct {
|
||||||
Pixels []byte
|
Pixels []byte
|
||||||
Region image.Rectangle
|
Region image.Rectangle
|
||||||
}
|
}
|
||||||
|
@ -831,7 +831,7 @@ func (i *Image) ReadPixels(buf []byte, region image.Rectangle) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) WritePixels(args []*graphicsdriver.WritePixelsArgs) error {
|
func (i *Image) WritePixels(args []*graphicsdriver.PixelsArgs) error {
|
||||||
g := i.graphics
|
g := i.graphics
|
||||||
|
|
||||||
g.flushRenderCommandEncoderIfNeeded()
|
g.flushRenderCommandEncoderIfNeeded()
|
||||||
|
@ -131,7 +131,7 @@ func (i *Image) ensureStencilBuffer() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) WritePixels(args []*graphicsdriver.WritePixelsArgs) error {
|
func (i *Image) WritePixels(args []*graphicsdriver.PixelsArgs) error {
|
||||||
if i.screen {
|
if i.screen {
|
||||||
return errors.New("opengl: WritePixels cannot be called on the screen")
|
return errors.New("opengl: WritePixels cannot be called on the screen")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user