automated snapshot

This commit is contained in:
sumi
2025-12-23 11:43:38 -06:00
parent 2c61cd2f46
commit 5cbb9aee14
3 changed files with 41 additions and 15 deletions

View File

@@ -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
}