automated snapshot
This commit is contained in:
29
sketch.go
29
sketch.go
@@ -265,6 +265,35 @@ type Layer interface {
|
||||
IsDirty() bool
|
||||
}
|
||||
|
||||
|
||||
type ImageLayer struct {
|
||||
texture rl.Texture2D
|
||||
dirty bool
|
||||
}
|
||||
|
||||
func NewImageLayer(path string) *ImageLayer {
|
||||
image := rl.LoadImage(path)
|
||||
tex := rl.LoadTextureFromImage(image)
|
||||
return &ImageLayer {
|
||||
texture: tex,
|
||||
dirty: true,
|
||||
}
|
||||
}
|
||||
|
||||
func (il *ImageLayer) Update(ctx *RenderCtx) {
|
||||
;
|
||||
}
|
||||
|
||||
func (il *ImageLayer) Draw(ctx *RenderCtx) {
|
||||
rl.Translatef(float32(ctx.SourceWidth) / 2.0 - float32(il.texture.Width) / 2.0, float32(ctx.SourceHeight) / 2.0 - float32(il.texture.Height) / 2.0, 0)
|
||||
rl.DrawTexture(il.texture, 0, 0, rl.White)
|
||||
}
|
||||
|
||||
func (il *ImageLayer) IsDirty() bool {
|
||||
return il.dirty
|
||||
}
|
||||
|
||||
|
||||
type TestPattern struct{
|
||||
dirty bool
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user