start cleanup

This commit is contained in:
filifa 2024-08-24 14:37:44 -05:00
parent 7c377aa79b
commit c715f42c71
1 changed files with 7 additions and 5 deletions

12
main.go
View File

@ -17,13 +17,16 @@ import (
)
func main() {
if err := sdl.Init(sdl.INIT_EVERYTHING); err != nil {
windowWidth := 800
windowHeight := 600
err := sdl.Init(sdl.INIT_VIDEO)
if err != nil {
panic(err)
}
defer sdl.Quit()
window, err := sdl.CreateWindow("milkbucket", sdl.WINDOWPOS_UNDEFINED, sdl.WINDOWPOS_UNDEFINED,
800, 600, sdl.WINDOW_OPENGL)
window, err := sdl.CreateWindow("milkbucket", sdl.WINDOWPOS_UNDEFINED, sdl.WINDOWPOS_UNDEFINED, int32(windowWidth), int32(windowHeight), sdl.WINDOW_OPENGL)
if err != nil {
panic(err)
}
@ -41,7 +44,7 @@ func main() {
}
defer C.projectm_destroy(handle)
C.projectm_set_window_size(handle, 800, 600)
C.projectm_set_window_size(handle, C.ulong(windowWidth), C.ulong(windowHeight))
preset := C.CString("/usr/share/projectM/presets/presets_stock/Zylot - Wisps.milk")
C.projectm_load_preset_file(handle, preset, false)
@ -53,7 +56,6 @@ func main() {
for event := sdl.PollEvent(); event != nil; event = sdl.PollEvent() {
switch event.(type) {
case *sdl.QuitEvent:
println("Quit")
running = false
break
}