Re-enable BMP and JPG support, add OpenGL ES 2.0 for desktop platforms, update README.md

This commit is contained in:
JupiterRider 2023-04-13 18:46:45 +02:00
parent 70e5708243
commit 7116f4cf05
7 changed files with 30 additions and 25 deletions

View file

@ -59,6 +59,7 @@ You can also build binary in [MSYS2](https://msys2.github.io/) shell.
* `opengl43` - uses OpenGL 4.3 backend
* `opengl21` - uses OpenGL 2.1 backend (default is 3.3 on desktop)
* `opengl11` - uses OpenGL 1.1 backend (pseudo OpenGL 1.1 style)
* `angle` - uses OpenGL ES 2.0 backend (can be used to link against [Google's ANGLE](https://github.com/google/angle))
### Documentation
@ -69,10 +70,11 @@ Documentation on [GoDoc](https://godoc.org/github.com/gen2brain/raylib-go/raylib
```go
package main
import "github.com/gen2brain/raylib-go/raylib"
import rl "github.com/gen2brain/raylib-go/raylib"
func main() {
rl.InitWindow(800, 450, "raylib [core] example - basic window")
defer rl.CloseWindow()
rl.SetTargetFPS(60)
for !rl.WindowShouldClose() {
@ -83,8 +85,6 @@ func main() {
rl.EndDrawing()
}
rl.CloseWindow()
}
```

View file

@ -26,9 +26,10 @@ package rl
#cgo darwin LDFLAGS: -framework OpenGL -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,opengl11 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo darwin,opengl21 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo darwin,opengl43 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo darwin,!opengl11,!opengl21,!opengl43 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo darwin,opengl11,!angle CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo darwin,opengl21,!angle CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo darwin,opengl43,!angle CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo darwin,!opengl11,!opengl21,!opengl43,!angle CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo darwin,angle CFLAGS: -DGRAPHICS_API_OPENGL_ES2
*/
import "C"

View file

@ -42,9 +42,10 @@ package rl
#cgo freebsd,!wayland CFLAGS: -D_GLFW_X11
#cgo freebsd,wayland CFLAGS: -D_GLFW_WAYLAND
#cgo freebsd,opengl11 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo freebsd,opengl21 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo freebsd,opengl43 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo freebsd,!opengl11,!opengl21,!opengl43 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo freebsd,opengl11,!angle CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo freebsd,opengl21,!angle CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo freebsd,opengl43,!angle CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo freebsd,!opengl11,!opengl21,!opengl43,!angle CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo freebsd,angle CFLAGS: -DGRAPHICS_API_OPENGL_ES2
*/
import "C"

View file

@ -41,9 +41,10 @@ package rl
#cgo linux,!wayland CFLAGS: -D_GLFW_X11
#cgo linux,wayland CFLAGS: -D_GLFW_WAYLAND
#cgo linux,opengl11 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo linux,opengl21 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo linux,opengl43 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo linux,!opengl11,!opengl21,!opengl43 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo linux,opengl11,!angle CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo linux,opengl21,!angle CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo linux,opengl43,!angle CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo linux,!opengl11,!opengl21,!opengl43,!angle CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo linux,angle CFLAGS: -DGRAPHICS_API_OPENGL_ES2
*/
import "C"

View file

@ -42,9 +42,10 @@ package rl
#cgo openbsd,!wayland CFLAGS: -D_GLFW_X11
#cgo openbsd,wayland CFLAGS: -D_GLFW_WAYLAND
#cgo openbsd,opengl11 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo openbsd,opengl21 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo openbsd,opengl43 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo openbsd,!opengl11,!opengl21,!opengl43 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo openbsd,opengl11,!angle CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo openbsd,opengl21,!angle CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo openbsd,opengl43,!angle CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo openbsd,!opengl11,!opengl21,!opengl43,!angle CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo openbsd,angle CFLAGS: -DGRAPHICS_API_OPENGL_ES2
*/
import "C"

View file

@ -26,9 +26,10 @@ package rl
#cgo windows LDFLAGS: -lopengl32 -lgdi32 -lwinmm -lole32
#cgo windows CFLAGS: -D_GLFW_WIN32 -Iexternal -Iexternal/glfw/include -Iexternal/glfw/deps/mingw -DPLATFORM_DESKTOP
#cgo windows,opengl11 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo windows,opengl21 CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo windows,opengl43 CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo windows,!opengl11,!opengl21,!opengl43 CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo windows,opengl11,!angle CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo windows,opengl21,!angle CFLAGS: -DGRAPHICS_API_OPENGL_21
#cgo windows,opengl43,!angle CFLAGS: -DGRAPHICS_API_OPENGL_43
#cgo windows,!opengl11,!opengl21,!opengl43,!angle CFLAGS: -DGRAPHICS_API_OPENGL_33
#cgo windows,angle CFLAGS: -DGRAPHICS_API_OPENGL_ES2
*/
import "C"

View file

@ -143,9 +143,9 @@
//------------------------------------------------------------------------------------
// Select the desired fileformats to be supported for image data loading
#define SUPPORT_FILEFORMAT_PNG 1
//#define SUPPORT_FILEFORMAT_BMP 1
#define SUPPORT_FILEFORMAT_BMP 1
//#define SUPPORT_FILEFORMAT_TGA 1
//#define SUPPORT_FILEFORMAT_JPG 1
#define SUPPORT_FILEFORMAT_JPG 1
#define SUPPORT_FILEFORMAT_GIF 1
#define SUPPORT_FILEFORMAT_QOI 1
//#define SUPPORT_FILEFORMAT_PSD 1