Add support for SDL3

This commit is contained in:
Milan Nikolic 2024-12-03 09:06:39 +01:00
parent 5df9325f63
commit ea071de5c2
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
21 changed files with 88 additions and 50 deletions

View file

@ -1,5 +1,5 @@
//go:build darwin && !rgfw && !sdl
// +build darwin,!rgfw,!sdl
//go:build darwin && !rgfw && !sdl && !sdl3
// +build darwin,!rgfw,!sdl,!sdl3
package rl

View file

@ -1,5 +1,5 @@
//go:build darwin && rgfw && !sdl
// +build darwin,rgfw,!sdl
//go:build darwin && rgfw && !sdl && !sdl3
// +build darwin,rgfw,!sdl,!sdl3
package rl

View file

@ -1,12 +1,17 @@
//go:build darwin && sdl && !rgfw
// +build darwin,sdl,!rgfw
//go:build darwin && (sdl || sdl3) && !rgfw
// +build darwin
// +build sdl sdl3
// +build !rgfw
package rl
/*
#cgo darwin LDFLAGS: -framework Cocoa -framework IOKit -framework CoreVideo -framework CoreFoundation
#cgo darwin CFLAGS: -Wno-deprecated-declarations -Wno-implicit-const-int-float-conversion -DPLATFORM_DESKTOP_SDL
#cgo darwin pkg-config: sdl2
#cgo darwin CFLAGS: -Wno-deprecated-declarations -Wno-implicit-const-int-float-conversion
#cgo darwin,sdl CFLAGS: -DPLATFORM_DESKTOP_SDL
#cgo darwin,sdl3 CFLAGS: -DPLATFORM_DESKTOP_SDL -DPLATFORM_DESKTOP_SDL3
#cgo darwin,sdl pkg-config: sdl2
#cgo darwin,sdl3 pkg-config: sdl3
#cgo darwin,!es2,!es3 LDFLAGS: -framework OpenGL

View file

@ -1,5 +1,5 @@
//go:build freebsd && !linux && !rgfw && !drm && !sdl && !android
// +build freebsd,!linux,!rgfw,!drm,!sdl,!android
//go:build freebsd && !linux && !rgfw && !drm && !sdl && !sdl3 && !android
// +build freebsd,!linux,!rgfw,!drm,!sdl,!sdl3,!android
package rl

View file

@ -1,5 +1,5 @@
//go:build freebsd && rgfw && !linux && !drm && !sdl && !android
// +build freebsd,rgfw,!linux,!drm,!sdl,!android
//go:build freebsd && rgfw && !linux && !drm && !sdl && !sdl3 && !android
// +build freebsd,rgfw,!linux,!drm,!sdl,!sdl3,!android
package rl

View file

@ -1,13 +1,21 @@
//go:build freebsd && !linux && sdl && !rgfw && !drm && !android
// +build freebsd,!linux,sdl,!rgfw,!drm,!android
//go:build freebsd && !linux && (sdl || sdl3) && !rgfw && !drm && !android
// +build freebsd
// +build !linux
// +build sdl sdl3
// +build !rgfw
// +build !drm
// +build !android
package rl
/*
#cgo freebsd CFLAGS: -I. -I/usr/local/include -DPLATFORM_DESKTOP_SDL
#cgo freebsd CFLAGS: -I. -I/usr/local/include
#cgo freebsd,sdl CFLAGS: -DPLATFORM_DESKTOP_SDL
#cgo freebsd,sdl3 CFLAGS: -DPLATFORM_DESKTOP_SDL -DPLATFORM_DESKTOP_SDL3
#cgo freebsd LDFLAGS: -L/usr/local/lib
#cgo freebsd pkg-config: sdl2
#cgo freebsd,sdl pkg-config: sdl2
#cgo freebsd,sdl3 pkg-config: sdl3
#cgo freebsd,!es2,!es3 LDFLAGS: -lGL

View file

@ -1,5 +1,5 @@
//go:build linux && !rgfw && !drm && !sdl && !android
// +build linux,!rgfw,!drm,!sdl,!android
//go:build linux && !rgfw && !drm && !sdl && !sdl3 && !android
// +build linux,!rgfw,!drm,!sdl,!sdl3,!android
package rl

View file

@ -1,5 +1,5 @@
//go:build linux && drm && !rgfw && !sdl && !android
// +build linux,drm,!rgfw,!sdl,!android
//go:build linux && drm && !rgfw && !sdl && !sdl3 && !android
// +build linux,drm,!rgfw,!sdl,!sdl3,!android
package rl

View file

@ -1,5 +1,5 @@
//go:build linux && rgfw && !drm && !sdl && !android
// +build linux,rgfw,!drm,!sdl,!android
//go:build linux && rgfw && !drm && !sdl && !sdl3 && !android
// +build linux,rgfw,!drm,!sdl,!sdl3,!android
package rl

View file

@ -1,12 +1,19 @@
//go:build linux && sdl && !rgfw && !drm && !android
// +build linux,sdl,!rgfw,!drm,!android
//go:build linux && (sdl || sdl3) && !rgfw && !drm && !android
// +build linux
// +build sdl sdl3
// +build !rgfw
// +build !drm
// +build !android
package rl
/*
#cgo linux,!es2 LDFLAGS: -lm
#cgo linux CFLAGS: -DPLATFORM_DESKTOP_SDL -Wno-stringop-overflow
#cgo linux pkg-config: sdl2
#cgo linux CFLAGS: -Wno-stringop-overflow
#cgo linux,sdl CFLAGS: -DPLATFORM_DESKTOP_SDL
#cgo linux,sdl3 CFLAGS: -DPLATFORM_DESKTOP_SDL -DPLATFORM_DESKTOP_SDL3
#cgo linux,sdl pkg-config: sdl2
#cgo linux,sdl3 pkg-config: sdl3
#cgo linux,!es2,!es3 LDFLAGS: -lGL

View file

@ -1,5 +1,5 @@
//go:build openbsd && !linux && !rgfw && !drm && !sdl && !android
// +build openbsd,!linux,!rgfw,!drm,!sdl,!android
//go:build openbsd && !linux && !rgfw && !drm && !sdl && !sdl3 && !android
// +build openbsd,!linux,!rgfw,!drm,!sdl,!sdl3,!android
package rl

View file

@ -1,5 +1,5 @@
//go:build openbsd && rgfw && !linux && !sdl && !drm && !android
// +build openbsd,rgfw,!linux,!sdl,!drm,!android
//go:build openbsd && rgfw && !linux && !sdl && !sdl3 && !drm && !android
// +build openbsd,rgfw,!linux,!sdl,!sdl3,!drm,!android
package rl

View file

@ -1,13 +1,21 @@
//go:build openbsd && !linux && sdl && !rgfw && !drm && !android
// +build openbsd,!linux,sdl,!rgfw,!drm,!android
//go:build openbsd && !linux && (sdl || sdl3) && !rgfw && !drm && !android
// +build openbsd
// +build !linux
// +build sdl sdl3
// +build !rgfw
// +build !drm
// +build !android
package rl
/*
#cgo openbsd CFLAGS: -I. -I/usr/X11R6/include -DPLATFORM_DESKTOP_SDL
#cgo openbsd CFLAGS: -I. -I/usr/X11R6/include
#cgo openbsd,sdl CFLAGS: -DPLATFORM_DESKTOP_SDL
#cgo openbsd,sdl3 CFLAGS: -DPLATFORM_DESKTOP_SDL -DPLATFORM_DESKTOP_SDL3
#cgo openbsd LDFLAGS: -L/usr/X11R6/lib
#cgo openbsd pkg-config: sdl2
#cgo openbsd,sdl pkg-config: sdl2
#cgo openbsd,sdl3 pkg-config: sdl3
#cgo openbsd,!es2,!es3 LDFLAGS: -lGL

View file

@ -1,5 +1,5 @@
//go:build windows && !rgfw && !sdl
// +build windows,!rgfw,!sdl
//go:build windows && !rgfw && !sdl && !sdl3
// +build windows,!rgfw,!sdl,!sdl3
package rl

View file

@ -1,5 +1,5 @@
//go:build windows && rgfw && !sdl
// +build windows,rgfw,!sdl
//go:build windows && rgfw && !sdl && !sdl3
// +build windows,rgfw,!sdl,!sdl3
package rl

View file

@ -1,11 +1,17 @@
//go:build windows && sdl && !rgfw
// +build windows,sdl,!rgfw
//go:build windows && (sdl || sdl3) && !rgfw
// +build windows
// +build sdl sdl3
// +build !rgfw
package rl
/*
#cgo windows LDFLAGS: -lgdi32 -lwinmm -lole32 -lSDL2
#cgo windows CFLAGS: -Iexternal -DPLATFORM_DESKTOP_SDL -Wno-stringop-overflow
#cgo windows LDFLAGS: -lgdi32 -lwinmm -lole32
#cgo windows,sdl LDFLAGS: -lSDL2
#cgo windows,sdl3 LDFLAGS: -lSDL3
#cgo windows CFLAGS: -Iexternal -Wno-stringop-overflow
#cgo windows,sdl CFLAGS: -DPLATFORM_DESKTOP_SDL
#cgo windows,sdl3 CFLAGS: -DPLATFORM_DESKTOP_SDL -DPLATFORM_DESKTOP_SDL3
#cgo windows,!es2,!es3 LDFLAGS: -lopengl32

View file

@ -1,5 +1,5 @@
//go:build !rgfw && !sdl && !drm && !android
// +build !rgfw,!sdl,!drm,!android
//go:build !rgfw && !sdl && !sdl3 && !drm && !android
// +build !rgfw,!sdl,!sdl3,!drm,!android
package rl

View file

@ -1,5 +1,5 @@
//go:build rgfw && !sdl && !drm && !android
// +build rgfw,!sdl,!drm,!android
//go:build rgfw && !sdl && !sdl3 && !drm && !android
// +build rgfw,!sdl,!sdl3,!drm,!android
package rl

View file

@ -1,5 +1,8 @@
//go:build sdl && !rgfw && !drm && !android
// +build sdl,!rgfw,!drm,!android
//go:build (sdl || sdl3) && !rgfw && !drm && !android
// +build sdl sdl3
// +build !rgfw
// +build !drm
// +build !android
package rl

View file

@ -1,5 +1,5 @@
//go:build linux && drm && !rgfw && !sdl && !android
// +build linux,drm,!rgfw,!sdl,!android
//go:build linux && drm && !rgfw && !sdl && !sdl3 && !android
// +build linux,drm,!rgfw,!sdl,!sdl3,!android
package rl