Add X11 frontend

This commit is contained in:
Miloslav Ciz 2025-05-29 22:27:28 +02:00
parent eb640d27a1
commit f7a24f2aa1
4 changed files with 204 additions and 15 deletions

24
make.sh
View file

@ -30,30 +30,36 @@ if [ $# -gt 0 ]; then
fi
if [ $PLATFORM = "sdl" ]; then
# PC SDL build, requires:
# - SDL2 (dev) package
# PC SDL build, requires: SDL2 (dev) package
# preferred, should support all features
SDL_FLAGS=`sdl2-config --cflags --libs`
COMMAND="${COMPILER} ${C_FLAGS} frontend_sdl.c -I/usr/local/include ${SDL_FLAGS}"
elif [ $PLATFORM = "csfml" ]; then
# PC CMFML build, requires:
# - csfml (dev) package
# PC CMFML build, requires: csfml (dev) package
# similar to SDL, should support all features
COMMAND="${COMPILER} ${C_FLAGS} frontend_csfml.c -lcsfml-graphics -lcsfml-window -lcsfml-system -lcsfml-audio"
elif [ $PLATFORM = "saf" ]; then
# SAF build, requires:
# - saf.h
# - backend libraries (SDL2 by default)
# SAF build, requires: saf.h, backend libraries (SDL2 by default)
# limited by SAF (low resoulution, few colors, no files, simple sound, ...)
SDL_FLAGS=`sdl2-config --cflags --libs`
COMMAND="${COMPILER} ${C_FLAGS} frontend_saf.c -lcsfml-graphics -I/use/local/include ${SDL_FLAGS}"
elif [ $PLATFORM = "test" ]; then
# autotest build
# unplayable, only serves for development
COMMAND="${COMPILER} ${C_FLAGS} frontend_test.c"
elif [ $PLATFORM = "x11" ]; then
# X11 build, requires: xlib
# has no sound
COMMAND="${COMPILER} ${C_FLAGS} -lX11 frontend_x11.c"
elif [ $PLATFORM = "emscripten" ]; then
# emscripten (browser Javascript) build, requires:
# - emscripten
# emscripten (browser Javascript) build, requires: emscripten
# limited, low quality, no files
COMMAND="../emsdk/upstream/emscripten/emcc ./frontend_sdl.c -s USE_SDL=2 -O3 -lopenal --shell-file HTMLshell.html -o licar.html -s EXPORTED_FUNCTIONS='[\"_main\"]' -s EXPORTED_RUNTIME_METHODS='[\"ccall\",\"cwrap\"]'"
else
echo "unknown frontend"