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