1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-24 08:05:24 +00:00
OpenDiablo2/d2common/d2interface/surface.go
Ziemas e2e8a303c2
Use our own DrawEffects enum for draw effects (#564)
* Add PushEffect, handle effects in renderer

* Set effects instead of blend

* Stop using PushCompositeMode, use PushEffect

* Remove remaining composite mode things
2020-07-08 21:57:35 -04:00

31 lines
792 B
Go

package d2interface
import (
"image"
"image/color"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
)
// Surface represents a renderable surface.
type Surface interface {
Clear(color color.Color) error
DrawRect(width, height int, color color.Color)
DrawLine(x, y int, color color.Color)
DrawText(format string, params ...interface{})
GetSize() (width, height int)
GetDepth() int
Pop()
PopN(n int)
PushColor(color color.Color)
PushEffect(effect d2enum.DrawEffect)
PushFilter(filter d2enum.Filter)
PushTranslation(x, y int)
PushBrightness(brightness float64)
Render(surface Surface) error
// Renders a section of the surface enclosed by bounds
RenderSection(surface Surface, bound image.Rectangle) error
ReplacePixels(pixels []byte) error
Screenshot() *image.RGBA
}