2020-06-29 00:41:58 -04:00
|
|
|
package d2interface
|
2020-01-31 23:18:11 -05:00
|
|
|
|
|
|
|
import (
|
2020-02-22 23:59:45 -05:00
|
|
|
"image"
|
2020-01-31 23:18:11 -05:00
|
|
|
"image/color"
|
2020-06-30 09:58:53 -04:00
|
|
|
|
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
2020-01-31 23:18:11 -05:00
|
|
|
)
|
|
|
|
|
2020-06-30 09:58:53 -04:00
|
|
|
// Surface represents a renderable surface.
|
2020-01-31 23:18:11 -05:00
|
|
|
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)
|
2020-07-08 21:57:35 -04:00
|
|
|
PushEffect(effect d2enum.DrawEffect)
|
2020-07-06 21:26:08 -04:00
|
|
|
PushFilter(filter d2enum.Filter)
|
2020-01-31 23:18:11 -05:00
|
|
|
PushTranslation(x, y int)
|
2020-06-27 18:58:41 -04:00
|
|
|
PushBrightness(brightness float64)
|
2020-01-31 23:18:11 -05:00
|
|
|
Render(surface Surface) error
|
2020-06-30 12:43:13 -04:00
|
|
|
// Renders a section of the surface enclosed by bounds
|
|
|
|
RenderSection(surface Surface, bound image.Rectangle) error
|
2020-01-31 23:18:11 -05:00
|
|
|
ReplacePixels(pixels []byte) error
|
2020-02-22 23:59:45 -05:00
|
|
|
Screenshot() *image.RGBA
|
2020-01-31 23:18:11 -05:00
|
|
|
}
|