don't import C in root

This commit is contained in:
filifa 2024-08-24 22:03:37 -05:00
parent bcc683ede7
commit f2f49013f1
2 changed files with 7 additions and 8 deletions

View File

@ -16,13 +16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package cmd package cmd
/*
#cgo CFLAGS: -I/home/nick/Downloads/include
#cgo LDFLAGS: -L/home/nick/.local/lib -lprojectM-4
#include "projectM-4/projectM.h"
*/
import "C"
import ( import (
"os" "os"
@ -36,7 +29,7 @@ func handleWindowEvent(event *sdl.WindowEvent, m *milkDropWindow) {
switch event.Event { switch event.Event {
case sdl.WINDOWEVENT_RESIZED: case sdl.WINDOWEVENT_RESIZED:
w, h := event.Data1, event.Data2 w, h := event.Data1, event.Data2
C.projectm_set_window_size(m.handle, C.ulong(w), C.ulong(h)) m.resize(w, h)
} }
} }

View File

@ -17,6 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package cmd package cmd
/* /*
#cgo CFLAGS: -I/home/nick/Downloads/include
#cgo LDFLAGS: -L/home/nick/.local/lib -lprojectM-4
#include "projectM-4/projectM.h" #include "projectM-4/projectM.h"
#include <stdlib.h> #include <stdlib.h>
*/ */
@ -93,3 +95,7 @@ func (m *milkDropWindow) render() (bool, error) {
return true, nil return true, nil
} }
func (m *milkDropWindow) resize(w, h int32) {
C.projectm_set_window_size(m.handle, C.ulong(w), C.ulong(h))
}