aboutsummaryrefslogtreecommitdiff
path: root/unicorn/FakeUnicorn2.go
diff options
context:
space:
mode:
authorMartin Ashby <martin@martin-laptop.lan>2018-05-28 11:40:30 +0100
committerMartin Ashby <martin@martin-laptop.lan>2018-05-28 11:40:30 +0100
commit4ec7e493520d558dd05e911b58ea354d25f33f45 (patch)
tree0097c34ae8ba15c2d812e1da4ab42aad7d5097d0 /unicorn/FakeUnicorn2.go
parente6060fb69c32dcdf5904793e61e4b272bbd79de2 (diff)
downloadunicornpaint-4ec7e493520d558dd05e911b58ea354d25f33f45.tar.gz
unicornpaint-4ec7e493520d558dd05e911b58ea354d25f33f45.tar.bz2
unicornpaint-4ec7e493520d558dd05e911b58ea354d25f33f45.tar.xz
unicornpaint-4ec7e493520d558dd05e911b58ea354d25f33f45.zip
Started animated implementation
Diffstat (limited to 'unicorn/FakeUnicorn2.go')
-rw-r--r--unicorn/FakeUnicorn2.go57
1 files changed, 57 insertions, 0 deletions
diff --git a/unicorn/FakeUnicorn2.go b/unicorn/FakeUnicorn2.go
new file mode 100644
index 0000000..73ce8ab
--- /dev/null
+++ b/unicorn/FakeUnicorn2.go
@@ -0,0 +1,57 @@
+package unicorn
+
+import (
+ "image"
+
+ "github.com/veandco/go-sdl2/sdl"
+)
+
+type FakeUnicorn2 struct {
+ BaseUnicorn2
+}
+
+func renderImage(im image.Image) {
+ // b := im.Bounds()
+ // width := b.Dx()
+ // height := b.Dy()
+ // for x := 0; x < width; x++ {
+ // for y := 0; y < height; y++ {
+ // r, g, b, _ := im.At(x, y).RGBA()
+ // un.SetPixel(uint8(x), uint8(y), uint8(r), uint8(g), uint8(b))
+ // }
+ // }
+ // un.Show()
+}
+
+func render() {
+ // for !stop {
+ // for i := 0; i < len(gf.Image); i++ {
+ // im := gf.Image[i]
+ // delay := gf.Delay[i] //100ths of a second
+ // renderImage(un, im)
+ // time.Sleep(time.Duration(delay * 10000000)) // nanoseconds 10^-9 sec
+ // }
+ // }
+}
+
+func (u *FakeUnicorn2) StartRender() {
+
+}
+
+func MainLoop() {
+ running := true
+ for running {
+ for event := sdl.PollEvent(); event != nil; event = sdl.PollEvent() {
+ switch event.(type) {
+ case *sdl.QuitEvent:
+ println("Quit")
+ running = false
+ break
+ }
+ }
+ }
+}
+
+func NewUnicorn2() *FakeUnicorn2 {
+ return &FakeUnicorn2{}
+}