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.
|
||||
type writePixelsCommand struct {
|
||||
dst *Image
|
||||
args []*graphicsdriver.WritePixelsArgs
|
||||
args []*graphicsdriver.PixelsArgs
|
||||
}
|
||||
|
||||
func (c *writePixelsCommand) String() string {
|
||||
|
@ -43,7 +43,7 @@ type Image struct {
|
||||
// have its graphicsdriver.Image.
|
||||
id int
|
||||
|
||||
bufferedWP []*graphicsdriver.WritePixelsArgs
|
||||
bufferedWP []*graphicsdriver.PixelsArgs
|
||||
}
|
||||
|
||||
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) {
|
||||
i.bufferedWP = append(i.bufferedWP, &graphicsdriver.WritePixelsArgs{
|
||||
i.bufferedWP = append(i.bufferedWP, &graphicsdriver.PixelsArgs{
|
||||
Pixels: pixels,
|
||||
Region: region,
|
||||
})
|
||||
|
@ -130,7 +130,7 @@ func (i *image11) ReadPixels(buf []byte, region image.Rectangle) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (i *image11) WritePixels(args []*graphicsdriver.WritePixelsArgs) error {
|
||||
func (i *image11) WritePixels(args []*graphicsdriver.PixelsArgs) error {
|
||||
for _, a := range args {
|
||||
i.graphics.deviceContext.UpdateSubresource(unsafe.Pointer(i.texture), 0, &_D3D11_BOX{
|
||||
left: uint32(a.Region.Min.X),
|
||||
|
@ -149,7 +149,7 @@ func (i *image12) ReadPixels(buf []byte, region image.Rectangle) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (i *image12) WritePixels(args []*graphicsdriver.WritePixelsArgs) error {
|
||||
func (i *image12) WritePixels(args []*graphicsdriver.PixelsArgs) error {
|
||||
if i.screen {
|
||||
return errors.New("directx: WritePixels cannot be called on the screen")
|
||||
}
|
||||
|
@ -68,12 +68,12 @@ type Image interface {
|
||||
Dispose()
|
||||
IsInvalidated() bool
|
||||
ReadPixels(buf []byte, region image.Rectangle) error
|
||||
WritePixels(args []*WritePixelsArgs) error
|
||||
WritePixels(args []*PixelsArgs) error
|
||||
}
|
||||
|
||||
type ImageID int
|
||||
|
||||
type WritePixelsArgs struct {
|
||||
type PixelsArgs struct {
|
||||
Pixels []byte
|
||||
Region image.Rectangle
|
||||
}
|
||||
|
@ -831,7 +831,7 @@ func (i *Image) ReadPixels(buf []byte, region image.Rectangle) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (i *Image) WritePixels(args []*graphicsdriver.WritePixelsArgs) error {
|
||||
func (i *Image) WritePixels(args []*graphicsdriver.PixelsArgs) error {
|
||||
g := i.graphics
|
||||
|
||||
g.flushRenderCommandEncoderIfNeeded()
|
||||
|
@ -131,7 +131,7 @@ func (i *Image) ensureStencilBuffer() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (i *Image) WritePixels(args []*graphicsdriver.WritePixelsArgs) error {
|
||||
func (i *Image) WritePixels(args []*graphicsdriver.PixelsArgs) error {
|
||||
if i.screen {
|
||||
return errors.New("opengl: WritePixels cannot be called on the screen")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user