Add es3 build tag

This commit is contained in:
Milan Nikolic 2023-11-07 14:39:26 +01:00
parent 040d87fb79
commit 4da19689d8
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
11 changed files with 71 additions and 60 deletions

View file

@ -56,6 +56,7 @@ You can also build binary in [MSYS2](https://msys2.github.io/) shell.
* `opengl21` - uses OpenGL 2.1 backend (default is 3.3 on desktop)
* `opengl11` - uses OpenGL 1.1 backend (pseudo OpenGL 1.1 style)
* `es2` - uses OpenGL ES 2.0 backend (can be used to link against [Google's ANGLE](https://github.com/google/angle))
* `es3` - experimental support for OpenGL ES 3.0
### Documentation

View file

@ -26,12 +26,13 @@ package rl
#cgo darwin LDFLAGS: -framework Cocoa -framework IOKit -framework CoreVideo -framework CoreFoundation
#cgo darwin CFLAGS: -x objective-c -Iexternal/glfw/include -D_GLFW_COCOA -D_GLFW_USE_CHDIR -D_GLFW_USE_MENUBAR -D_GLFW_USE_RETINA -Wno-deprecated-declarations -Wno-implicit-const-int-float-conversion -DPLATFORM_DESKTOP
#cgo darwin,!es2 LDFLAGS: -framework OpenGL
#cgo darwin,!es2,!es3 LDFLAGS: -framework OpenGL
#cgo darwin,opengl11,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo darwin,opengl21,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo darwin,opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo darwin,!opengl11,!opengl21,!opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo darwin,es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo darwin,opengl11,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo darwin,opengl21,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo darwin,opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo darwin,!opengl11,!opengl21,!opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo darwin,es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo darwin,es3,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES3
*/
import "C"

View file

@ -8,12 +8,13 @@ package rl
#cgo darwin CFLAGS: -x objective-c -Wno-deprecated-declarations -Wno-implicit-const-int-float-conversion -DPLATFORM_DESKTOP_SDL
#cgo darwin pkg-config: sdl2
#cgo darwin,!es2 LDFLAGS: -framework OpenGL
#cgo darwin,!es2,!es3 LDFLAGS: -framework OpenGL
#cgo darwin,opengl11,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo darwin,opengl21,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo darwin,opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo darwin,!opengl11,!opengl21,!opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo darwin,es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo darwin,opengl11,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo darwin,opengl21,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo darwin,opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo darwin,!opengl11,!opengl21,!opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo darwin,es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo darwin,es3,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES3
*/
import "C"

View file

@ -39,15 +39,16 @@ package rl
#cgo freebsd,!wayland LDFLAGS: -lm -pthread -ldl -lrt -lX11
#cgo freebsd,wayland LDFLAGS: -lm -pthread -ldl -lrt -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
#cgo freebsd,!es2 LDFLAGS: -lGL
#cgo freebsd,!es2,!es3 LDFLAGS: -lGL
#cgo freebsd,!wayland CFLAGS: -D_GLFW_X11
#cgo freebsd,wayland CFLAGS: -D_GLFW_WAYLAND
#cgo freebsd,opengl11,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo freebsd,opengl21,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo freebsd,opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo freebsd,!opengl11,!opengl21,!opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo freebsd,es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo freebsd,opengl11,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo freebsd,opengl21,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo freebsd,opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo freebsd,!opengl11,!opengl21,!opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo freebsd,es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo freebsd,es3,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES3
*/
import "C"

View file

@ -9,12 +9,13 @@ package rl
#cgo freebsd pkg-config: sdl2
#cgo freebsd,!es2 LDFLAGS: -lGL
#cgo freebsd,!es2,!es3 LDFLAGS: -lGL
#cgo freebsd,opengl11,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo freebsd,opengl21,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo freebsd,opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo freebsd,!opengl11,!opengl21,!opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo freebsd,es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo freebsd,opengl11,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo freebsd,opengl21,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo freebsd,opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo freebsd,!opengl11,!opengl21,!opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo freebsd,es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo freebsd,es3,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES3
*/
import "C"

View file

@ -38,15 +38,16 @@ package rl
#cgo linux,!wayland LDFLAGS: -lm -pthread -ldl -lrt -lX11
#cgo linux,wayland LDFLAGS: -lm -pthread -ldl -lrt -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
#cgo linux,!es2 LDFLAGS: -lGL
#cgo linux,!es2,!es3 LDFLAGS: -lGL
#cgo linux,!wayland CFLAGS: -D_GLFW_X11
#cgo linux,wayland CFLAGS: -D_GLFW_WAYLAND
#cgo linux,opengl11,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo linux,opengl21,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo linux,opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo linux,!opengl11,!opengl21,!opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo linux,es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo linux,opengl11,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo linux,opengl21,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo linux,opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo linux,!opengl11,!opengl21,!opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo linux,es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo linux,es3,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES3
*/
import "C"

View file

@ -8,12 +8,13 @@ package rl
#cgo linux CFLAGS: -DPLATFORM_DESKTOP_SDL -Wno-stringop-overflow
#cgo linux pkg-config: sdl2
#cgo linux,!es2 LDFLAGS: -lGL
#cgo linux,!es2,!es3 LDFLAGS: -lGL
#cgo linux,opengl11,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo linux,opengl21,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo linux,opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo linux,!opengl11,!opengl21,!opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo linux,es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo linux,opengl11,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo linux,opengl21,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo linux,opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo linux,!opengl11,!opengl21,!opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo linux,es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo linux,es3,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES3
*/
import "C"

View file

@ -39,15 +39,16 @@ package rl
#cgo openbsd,!wayland LDFLAGS: -lm -pthread -lX11
#cgo openbsd,wayland LDFLAGS: -lm -pthread -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
#cgo openbsd,!es2 LDFLAGS: -lGL
#cgo openbsd,!es2,!es3 LDFLAGS: -lGL
#cgo openbsd,!wayland CFLAGS: -D_GLFW_X11
#cgo openbsd,wayland CFLAGS: -D_GLFW_WAYLAND
#cgo openbsd,opengl11,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo openbsd,opengl21,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo openbsd,opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo openbsd,!opengl11,!opengl21,!opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo openbsd,es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo openbsd,opengl11,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo openbsd,opengl21,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo openbsd,opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo openbsd,!opengl11,!opengl21,!opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo openbsd,es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo openbsd,es3,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES3
*/
import "C"

View file

@ -9,12 +9,13 @@ package rl
#cgo openbsd pkg-config: sdl2
#cgo openbsd,!es2 LDFLAGS: -lGL
#cgo openbsd,!es2,!es3 LDFLAGS: -lGL
#cgo openbsd,opengl11,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo openbsd,opengl21,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo openbsd,opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo openbsd,!opengl11,!opengl21,!opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo openbsd,es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo openbsd,opengl11,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo openbsd,opengl21,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo openbsd,opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo openbsd,!opengl11,!opengl21,!opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo openbsd,es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo openbsd,es3,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES3
*/
import "C"

View file

@ -26,12 +26,13 @@ package rl
#cgo windows LDFLAGS: -lgdi32 -lwinmm -lole32
#cgo windows CFLAGS: -D_GLFW_WIN32 -Iexternal -Iexternal/glfw/include -Iexternal/glfw/deps/mingw -DPLATFORM_DESKTOP -Wno-stringop-overflow
#cgo windows,!es2 LDFLAGS: -lopengl32
#cgo windows,!es2,!es3 LDFLAGS: -lopengl32
#cgo windows,opengl11,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo windows,opengl21,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo windows,opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo windows,!opengl11,!opengl21,!opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo windows,es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo windows,opengl11,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo windows,opengl21,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo windows,opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo windows,!opengl11,!opengl21,!opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo windows,es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo windows,es3,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES3
*/
import "C"

View file

@ -7,12 +7,13 @@ package rl
#cgo windows LDFLAGS: -lgdi32 -lwinmm -lole32 -lSDL2
#cgo windows CFLAGS: -Iexternal -DPLATFORM_DESKTOP_SDL -Wno-stringop-overflow
#cgo windows,!es2 LDFLAGS: -lopengl32
#cgo windows,!es2,!es3 LDFLAGS: -lopengl32
#cgo windows,opengl11,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo windows,opengl21,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo windows,opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo windows,!opengl11,!opengl21,!opengl43,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo windows,es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo windows,opengl11,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo windows,opengl21,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo windows,opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo windows,!opengl11,!opengl21,!opengl43,!es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo windows,es2,!es3 CFLAGS: -DGRAPHICS_API_OPENGL_ES2
#cgo windows,es3,!es2 CFLAGS: -DGRAPHICS_API_OPENGL_ES3
*/
import "C"