1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2026-05-09 22:59:10 -04:00
Files
gravestench 2e814f29b0 transform component, scene testing
* removed position,scale,rotation components
* added Transform component that contains position, rotation, and scale
* scene graph update now regenerates the local mat4 using the transform
component
* akara bugfix: adding new subscriptions will process existing entities
* added `--testscene` arg for testing individual scenes in isolation
* added rotation support to d2interface.Surface
2020-12-07 12:44:11 -08:00

36 lines
902 B
Go

package d2interface
import (
"image"
"image/color"
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
)
// Surface represents a renderable surface.
type Surface interface {
Renderer() Renderer
Clear(color color.Color)
DrawRect(width, height int, color color.Color)
DrawLine(x, y int, color color.Color)
DrawTextf(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)
PushSkew(x, y float64)
PushScale(x, y float64)
PushRotate(theta float64)
PushBrightness(brightness float64)
PushSaturation(saturation float64)
Render(surface Surface)
// Renders a section of the surface enclosed by bounds
RenderSection(surface Surface, bound image.Rectangle)
ReplacePixels(pixels []byte)
Screenshot() *image.RGBA
}