From e90b4d8915d593ab57cedfe988da8fbbd18b4408 Mon Sep 17 00:00:00 2001 From: kernelkinetic <67117582+kernelkinetic@users.noreply.github.com> Date: Sun, 27 Sep 2020 10:18:43 +0200 Subject: Platform DRM (#1388) * updated README.md * fixed CMakeLists.txt to allow building and debugging with Visual Studio Code and CMAKE Tools extension * added PLATFORM_DRM contains mouse pointer code from https://github.com/chriscamacho * removed redundant cleanup in InitGraphicsDevice * fixed DRM connector mode selection * added choosen DRM connected mode to log output * added respecting TargetFPS on DRM mode selection, default to 60 * added support for GetMonitorRefreshRate * changed SUPPORT_MOUSE_CURSOR_RPI to SUPPORT_MOUSE_CURSOR_NATIVE * changed avoidProgressive to allowInterlaced * cleanup, function extraction and improved mode selection * README reverted to original for PR * line endings fixed for core.c * removed old code * mouse pointer reverted to small square * replaced SetGraphicDeviceName() by DEFAULT_GRAPHIC_DEVICE_DRM Co-authored-by: kernelkinetic --- examples/Makefile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'examples') diff --git a/examples/Makefile b/examples/Makefile index 21482851..6ca8b6cf 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -96,6 +96,12 @@ ifeq ($(PLATFORM),PLATFORM_RPI) PLATFORM_OS=LINUX endif endif +ifeq ($(PLATFORM),PLATFORM_DRM) + UNAMEOS=$(shell uname) + ifeq ($(UNAMEOS),Linux) + PLATFORM_OS=LINUX + endif +endif # RAYLIB_PATH adjustment for different platforms. # If using GNU make, we can get the full path to the top of the tree. Windows? BSD? @@ -112,6 +118,9 @@ endif ifeq ($(PLATFORM),PLATFORM_RPI) RAYLIB_PATH ?= /home/pi/raylib endif +ifeq ($(PLATFORM),PLATFORM_DRM) + RAYLIB_PATH ?= /home/pi/raylib +endif ifeq ($(PLATFORM),PLATFORM_WEB) # Emscripten required variables @@ -221,6 +230,9 @@ endif ifeq ($(PLATFORM),PLATFORM_RPI) CFLAGS += -std=gnu99 endif +ifeq ($(PLATFORM),PLATFORM_DRM) + CFLAGS += -std=gnu99 -DEGL_NO_X11 +endif ifeq ($(PLATFORM),PLATFORM_WEB) # -Os # size optimization # -O2 # optimization level 2, if used, also set --memory-init-file 0 @@ -259,6 +271,10 @@ ifeq ($(PLATFORM),PLATFORM_RPI) INCLUDE_PATHS += -I/opt/vc/include/interface/vmcs_host/linux INCLUDE_PATHS += -I/opt/vc/include/interface/vcos/pthreads endif +ifeq ($(PLATFORM),PLATFORM_DRM) + # DRM required libraries + INCLUDE_PATHS += -I/usr/include/libdrm +endif ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),BSD) # Consider -L$(RAYLIB_H_INSTALL_PATH) @@ -299,6 +315,10 @@ ifeq ($(PLATFORM),PLATFORM_RPI) LDFLAGS += -L/opt/vc/lib endif +ifeq ($(PLATFORM),PLATFORM_DRM) + LDFLAGS += -lGLESv2 -lEGL -ldrm -lgbm +endif + # Define any libraries required on linking # if you want to link libraries (libname.so or libname.a), use the -lname ifeq ($(PLATFORM),PLATFORM_DESKTOP) @@ -351,6 +371,11 @@ ifeq ($(PLATFORM),PLATFORM_RPI) # NOTE: Required packages: libasound2-dev (ALSA) LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl endif +ifeq ($(PLATFORM),PLATFORM_DRM) + # Libraries for DRM compiling + # NOTE: Required packages: libasound2-dev (ALSA) + LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl +endif ifeq ($(PLATFORM),PLATFORM_WEB) # Libraries for web (HTML5) compiling LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.a @@ -522,6 +547,10 @@ ifeq ($(PLATFORM),PLATFORM_RPI) find . -type f -executable -delete rm -fv *.o endif +ifeq ($(PLATFORM),PLATFORM_DRM) + find . -type f -executable -delete + rm -fv *.o +endif ifeq ($(PLATFORM),PLATFORM_WEB) del *.o *.html *.js endif -- cgit v1.2.3