Skip to content

Commit ec5e8d7

Browse files
Add new demo: sdl3_renderer
This is a highly updated demo for libSDL3. It fixes a lot of long occuring issues and brings some improvements specific to SDL3 API. The origin and development of this demo is quite long. The exact track of development is something like this: `Nuklear/demo/sdl_renderer` -> #772 -> #779 + #825 -> _this_ commit... You may wish to read the linked PRs in order to get the full context. Commit message is too small to describe everything. I'm sorry...
1 parent c4e370b commit ec5e8d7

File tree

5 files changed

+1168
-2
lines changed

5 files changed

+1168
-2
lines changed

demo/sdl3_renderer/Makefile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# this Makefile is specific to GNU Make and GCC'compatible compilers
2+
3+
PKG_CONFIG ?= $(shell command -v pkg-config)
4+
ifeq (,$(PKG_CONFIG))
5+
$(error missing pkg-config utility!)
6+
endif
7+
8+
PKG_SDL3 ?= sdl3
9+
ifeq (,$(shell $(PKG_CONFIG) --path $(PKG_SDL3)))
10+
$(error $(PKG_CONFIG) could not find: $(PKG_SDL3))
11+
endif
12+
13+
OS ?= $(shell uname -s)
14+
BINEXT-Windows_NT = .exe
15+
BINEXT ?= $(BINEXIT-$(OS))
16+
17+
TEMPDIR ?= ./bin
18+
BIN ?= $(TEMPDIR)/demo$(BINEXT)
19+
20+
CFLAGS += -std=c89 -Wall -Wextra -Wpedantic
21+
CFLAGS += -O2
22+
#CFLAGS += -O0 -g
23+
#CFLAGS += -fsanitize=address
24+
#CFLAGS += -fsanitize=undefined
25+
CFLAGS += $(shell $(PKG_CONFIG) $(PKG_SDL3) --cflags)
26+
27+
LIBS += -lm
28+
LIBS += $(shell $(PKG_CONFIG) $(PKG_SDL3) --libs)
29+
30+
DEP ?= $(BIN).d
31+
32+
SRC = main.c
33+
34+
$(BIN):
35+
mkdir -p $(dir $@)
36+
$(CC) $(SRC) -o $@ -MD -MF $(DEP) $(CFLAGS) $(LIBS)
37+
38+
$(BIN): $(SRC) ./Makefile ./nuklear_sdl3_renderer.h ./../../nuklear.h
39+
40+
-include $(DEP)
41+

0 commit comments

Comments
 (0)