diff --git a/examples/Makefile b/examples/Makefile index cd079c312..9404d39cc 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -225,6 +225,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) endif endif ifeq ($(PLATFORM),PLATFORM_DRM) + INCLUDE_PATHS += -I$(RAYLIB_INCLUDE_PATH) INCLUDE_PATHS += -I/usr/include/libdrm endif diff --git a/src/Makefile b/src/Makefile index 63cbe2a41..e75ae5368 100644 --- a/src/Makefile +++ b/src/Makefile @@ -384,6 +384,7 @@ ifeq ($(PLATFORM),PLATFORM_DRM) # without EGL_NO_X11 eglplatform.h tears Xlib.h in which tears X.h in # which contains a conflicting type Font CFLAGS += -DEGL_NO_X11 + CFLAGS += -Werror=implicit-function-declaration endif # Use Wayland display on Linux desktop ifeq ($(PLATFORM),PLATFORM_DESKTOP) diff --git a/src/rcore.h b/src/rcore.h index b866273f0..219f9b737 100644 --- a/src/rcore.h +++ b/src/rcore.h @@ -16,6 +16,41 @@ // NOTE: GLFW3 already includes gl.h (OpenGL) headers #endif +#if defined(PLATFORM_DRM) + + #include // POSIX file control definitions - open(), creat(), fcntl() + #include // POSIX standard function definitions - read(), close(), STDIN_FILENO + #include // POSIX terminal control definitions - tcgetattr(), tcsetattr() + #include // POSIX threads management (inputs reading) + #include // POSIX directory browsing + + #include // Required for: ioctl() - UNIX System call for device-specific input/output operations + #include // Linux: KDSKBMODE, K_MEDIUMRAM constants definition + #include // Linux: Keycodes constants definition (KEY_A, ...) + #include // Linux: Joystick support library + + #include // Generic Buffer Management (native platform for EGL on DRM) + #include // Direct Rendering Manager user-level library interface + #include // Direct Rendering Manager mode setting (KMS) interface + + #include "EGL/egl.h" // Native platform windowing system interface + #include "EGL/eglext.h" // EGL extensions + + typedef struct + { + pthread_t threadId; // Event reading thread id + int fd; // File descriptor to the device it is assigned to + int eventNum; // Number of 'event' device + Rectangle absRange; // Range of values for absolute pointing devices (touchscreens) + int touchSlot; // Hold the touch slot number of the currently being sent multitouch block + bool isMouse; // True if device supports relative X Y movements + bool isTouch; // True if device supports absolute X Y movements and has BTN_TOUCH + bool isMultitouch; // True if device supports multiple absolute movevents and has BTN_TOUCH + bool isKeyboard; // True if device has letter keycodes + bool isGamepad; // True if device has gamepad buttons + } InputEventWorker; + +#endif // PROVIDE A HEADER TO BE USED BY ALL THE rcore_* IMPLEMENTATIONS. /* diff --git a/src/rcore_drm.c b/src/rcore_drm.c index c15dbf4a2..4fdc73296 100644 --- a/src/rcore_drm.c +++ b/src/rcore_drm.c @@ -4,38 +4,6 @@ #include "rcore.h" -#include // POSIX file control definitions - open(), creat(), fcntl() -#include // POSIX standard function definitions - read(), close(), STDIN_FILENO -#include // POSIX terminal control definitions - tcgetattr(), tcsetattr() -#include // POSIX threads management (inputs reading) -#include // POSIX directory browsing - -#include // Required for: ioctl() - UNIX System call for device-specific input/output operations -#include // Linux: KDSKBMODE, K_MEDIUMRAM constants definition -#include // Linux: Keycodes constants definition (KEY_A, ...) -#include // Linux: Joystick support library - -#include // Generic Buffer Management (native platform for EGL on DRM) -#include // Direct Rendering Manager user-level library interface -#include // Direct Rendering Manager mode setting (KMS) interface - -#include "EGL/egl.h" // Native platform windowing system interface -#include "EGL/eglext.h" // EGL extensions - -typedef struct -{ - pthread_t threadId; // Event reading thread id - int fd; // File descriptor to the device it is assigned to - int eventNum; // Number of 'event' device - Rectangle absRange; // Range of values for absolute pointing devices (touchscreens) - int touchSlot; // Hold the touch slot number of the currently being sent multitouch block - bool isMouse; // True if device supports relative X Y movements - bool isTouch; // True if device supports absolute X Y movements and has BTN_TOUCH - bool isMultitouch; // True if device supports multiple absolute movevents and has BTN_TOUCH - bool isKeyboard; // True if device has letter keycodes - bool isGamepad; // True if device has gamepad buttons -} InputEventWorker; - static bool InitGraphicsDevice(int width, int height); // Initialize graphics device // Initialize window and OpenGL context