22# RGFW_WAYLAND=1 -> use wayland
33# NO_VULKAN=1 -> do not compile the vulkan example
44# NO_GLES=1 -> do not compile the gles example (on by default for non-linux OSes)
5+ # NO_OSMESA=1 -> do not compile the osmesa example (on by default for non-linux OSes)
56
67CC = gcc
78AR = ar
@@ -23,6 +24,7 @@ WARNINGS = -Wall -Wstrict-prototypes -Wextra -Wstrict-prototypes -Wold-style-de
2324OS_DIR = \\
2425
2526NO_GLES = 1
27+ NO_OSMESA = 1
2628detected_OS = windows
2729
2830OBJ_FILE = .o
@@ -46,6 +48,7 @@ ifeq (,$(filter $(CC),x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc x86_64-w64-min
4648 LIB_EXT = .so
4749 OS_DIR = /
4850 NO_GLES = 0
51+ NO_OSMESA = 0
4952 endif
5053else
5154 OS_DIR = /
@@ -79,6 +82,8 @@ else ifneq ($(CC),g++)
7982 LIBS += -std=c99
8083endif
8184
85+ LIBS += -lOSMesa
86+
8287EXAMPLE_OUTPUTS = \
8388 examples/basic/basic \
8489 examples/gamepad/gamepad \
@@ -93,6 +98,7 @@ EXAMPLE_OUTPUTS_CUSTOM = \
9398 examples/gl33/gl33 \
9499 examples/portableGL/pgl \
95100 examples/gles2/gles2 \
101+ examples/osmesa/osmesa \
96102 examples/vk10/vk10 \
97103 examples/dx11/dx11 \
98104 examples/metal/metal \
@@ -116,6 +122,13 @@ else
116122 @echo gles has been disabled
117123endif
118124
125+ examples/osmesa/osmesa : examples/osmesa/osmesa.c RGFW.h
126+ ifneq ($(NO_GLES ) , 1)
127+ $(CC) $(CFLAGS) -I. $< $(LIBS) $(LINK_GL2) -lOSMesa -o $@$(EXT)
128+ else
129+ @echo gles has been disabled
130+ endif
131+
119132examples/vk10/vk10 : examples/vk10/vk10.c RGFW.h
120133ifneq ($(NO_VULKAN ) , 1)
121134 glslangValidator -V examples/vk10/shaders/vert.vert -o examples/vk10/shaders/vert.h --vn vert_code
@@ -174,6 +187,9 @@ debug: all
174187ifneq ($(NO_GLES ) , 1)
175188 ./examples/gles2/gles2$(EXT)
176189endif
190+ ifneq ($(NO_OSMESA ) , 1)
191+ ./examples/gles2/gles2$(EXT)
192+ endif
177193ifneq ($(NO_VULKAN ) , 1)
178194 ./examples/vk10/vk10$(EXT)
179195endif
0 commit comments