Skip to content

Commit

Permalink
Go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkauzh committed Dec 24, 2023
1 parent c38e420 commit 9594ec1
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 74 deletions.
14 changes: 6 additions & 8 deletions examples/basic-window/main.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package main

import (
"github.com/dimkauzh/vuelto-engine"
"github.com/dimkauzh/vuelto-engine"
)

func main() {
a := vuelto.NewApp()
w := a.NewWindow("hi", 800, 600, false)
a := vuelto.NewApp()
w := a.NewWindow("hi", 800, 600, false)

for !w.Close(){
w.Refresh()
}
for !w.Close() {
w.Refresh()
}
}


24 changes: 11 additions & 13 deletions examples/images/main.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
package main

import (
"github.com/dimkauzh/vuelto-engine"
"github.com/dimkauzh/vuelto-engine"
)

func main() {
a := vuelto.NewApp()
w := a.NewWindow("hi", 800, 600, false)
ren := a.NewRenderer2D()
a := vuelto.NewApp()
w := a.NewWindow("hi", 800, 600, false)
ren := a.NewRenderer2D()

image := ren.LoadImage("test/image.png", 300, 300, 250, 250)
image1 := ren.LoadImage("test/image.png", 100, 100, 150, 150)
image := ren.LoadImage("test/image.png", 300, 300, 250, 250)
image1 := ren.LoadImage("test/image.png", 100, 100, 150, 150)

for !w.Close() {
image.Draw()
image1.Draw()
w.Refresh()
for !w.Close() {
image.Draw()
image1.Draw()
w.Refresh()

}
}
}


22 changes: 10 additions & 12 deletions examples/rectangle/main.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
package main

import (
"github.com/dimkauzh/vuelto-engine"
"github.com/dimkauzh/vuelto-engine"
)

func main() {
a := vuelto.NewApp()
w := a.NewWindow("hi", 800, 600, false)
a := vuelto.NewApp()
w := a.NewWindow("hi", 800, 600, false)

ren := a.NewRenderer2D()
ren := a.NewRenderer2D()

for !w.Close() {
ren.ClearColor([3]float32{0.3, 0.4, 0.3})
for !w.Close() {
ren.ClearColor([3]float32{0.3, 0.4, 0.3})

ren.DrawRect(0, 0, 500, 500, [3]float32{0.1, 0.5, 0.7})

w.Refresh()

}
}
ren.DrawRect(0, 0, 500, 500, [3]float32{0.1, 0.5, 0.7})

w.Refresh()

}
}
37 changes: 17 additions & 20 deletions examples/two-windows/main.go
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
package main

import (
"github.com/dimkauzh/vuelto-engine"
"github.com/dimkauzh/vuelto-engine"
)

func main() {
a := vuelto.NewApp()
a := vuelto.NewApp()

w1 := a.NewWindow("hi", 800, 600, false)
w2 := a.NewWindow("hi2", 800, 600, false)
w1 := a.NewWindow("hi", 800, 600, false)
w2 := a.NewWindow("hi2", 800, 600, false)

ren := a.NewRenderer2D()
ren := a.NewRenderer2D()

image := ren.LoadImage("test/image.png", 300, 300, 250, 250)
image1 := ren.LoadImage("test/image.png", 100, 100, 150, 150)
image := ren.LoadImage("test/image.png", 300, 300, 250, 250)
image1 := ren.LoadImage("test/image.png", 100, 100, 150, 150)

for !w1.Close() && !w2.Close() {
w1.SetContextCurrent()
ren.ClearColor([3]float32{0.3, 0.4, 0.3})
for !w1.Close() && !w2.Close() {
w1.SetContextCurrent()
ren.ClearColor([3]float32{0.3, 0.4, 0.3})

ren.DrawRect(0, 0, 500, 500, [3]float32{0.1, 0.5, 0.7})

w1.Refresh()
w2.SetContextCurrent()
ren.DrawRect(0, 0, 500, 500, [3]float32{0.1, 0.5, 0.7})

w1.Refresh()
w2.SetContextCurrent()

image.Draw()
image1.Draw()
image.Draw()
image1.Draw()

w2.Refresh()
w2.Refresh()

}
}
}


37 changes: 17 additions & 20 deletions test/test1/test.go
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
package main

import (
"github.com/dimkauzh/vuelto-engine"
"github.com/dimkauzh/vuelto-engine"
)

func main() {
a := vuelto.NewApp()
a := vuelto.NewApp()

w1 := a.NewWindow("hi", 800, 600, false)
w2 := a.NewWindow("hi2", 800, 600, false)
w1 := a.NewWindow("hi", 800, 600, false)
w2 := a.NewWindow("hi2", 800, 600, false)

ren := a.NewRenderer2D()
ren := a.NewRenderer2D()

image := ren.LoadImage("test/image.png", 300, 300, 250, 250)
image1 := ren.LoadImage("test/image.png", 100, 100, 150, 150)
image := ren.LoadImage("test/image.png", 300, 300, 250, 250)
image1 := ren.LoadImage("test/image.png", 100, 100, 150, 150)

for !w1.Close() && !w2.Close() {
w1.SetContextCurrent()
ren.ClearColor([3]float32{0.3, 0.4, 0.3})
for !w1.Close() && !w2.Close() {
w1.SetContextCurrent()
ren.ClearColor([3]float32{0.3, 0.4, 0.3})

ren.DrawRect(0, 0, 500, 500, [3]float32{0.1, 0.5, 0.7})

w1.Refresh()
w2.SetContextCurrent()
ren.DrawRect(0, 0, 500, 500, [3]float32{0.1, 0.5, 0.7})

w1.Refresh()
w2.SetContextCurrent()

image.Draw()
image1.Draw()
image.Draw()
image1.Draw()

w2.Refresh()
w2.Refresh()

}
}
}


1 change: 0 additions & 1 deletion test/text/main.go

This file was deleted.

0 comments on commit 9594ec1

Please sign in to comment.