diff options
Diffstat (limited to 'unicorn/FakeUnicorn2.go')
-rw-r--r-- | unicorn/FakeUnicorn2.go | 57 |
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{} +} |