Add support for PLATFORM_DRM

This commit is contained in:
Milan Nikolic 2021-05-25 20:19:35 +02:00
parent 93ec54f81f
commit 43484d2b81
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
6 changed files with 6 additions and 5 deletions

View file

@ -6,6 +6,6 @@ package rl
#include "external/android/native_app_glue/android_native_app_glue.c"
#cgo android LDFLAGS: -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lm
#cgo android CFLAGS: -DPLATFORM_ANDROID -DGRAPHICS_API_OPENGL_ES2 -DMAL_NO_SDL -Iexternal/android/native_app_glue
#cgo android CFLAGS: -DPLATFORM_ANDROID -DGRAPHICS_API_OPENGL_ES2 -Iexternal/android/native_app_glue
*/
import "C"

View file

@ -21,7 +21,7 @@ package rl
#include "external/glfw/src/osmesa_context.c"
#cgo darwin LDFLAGS: -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo -framework CoreFoundation
#cgo darwin CFLAGS: -x objective-c -Iexternal/glfw/include -D_GLFW_COCOA -D_GLFW_USE_CHDIR -D_GLFW_USE_MENUBAR -D_GLFW_USE_RETINA -Wno-deprecated-declarations -DPLATFORM_DESKTOP -DMAL_NO_COREAUDIO
#cgo darwin CFLAGS: -x objective-c -Iexternal/glfw/include -D_GLFW_COCOA -D_GLFW_USE_CHDIR -D_GLFW_USE_MENUBAR -D_GLFW_USE_RETINA -Wno-deprecated-declarations -DPLATFORM_DESKTOP
#cgo darwin,opengl11 CFLAGS: -DGRAPHICS_API_OPENGL_11
#cgo darwin,opengl21 CFLAGS: -DGRAPHICS_API_OPENGL_21

View file

@ -1,4 +1,4 @@
// +build linux,!arm,!arm64
// +build linux,!drm,!rpi,!android
package rl

View file

@ -566,6 +566,7 @@ static void InitGamepad(void); // Init raw gamepad inpu
static void *GamepadThread(void *arg); // Mouse reading thread
#if defined(PLATFORM_DRM)
typedef unsigned int uint;
static int FindMatchingConnectorMode(const drmModeConnector *connector, const drmModeModeInfo *mode); // Search matching DRM mode in connector's mode list
static int FindExactConnectorMode(const drmModeConnector *connector, uint width, uint height, uint fps, bool allowInterlaced); // Search exactly matching DRM connector mode in connector's list
static int FindNearestConnectorMode(const drmModeConnector *connector, uint width, uint height, uint fps, bool allowInterlaced); // Search the nearest matching DRM connector mode in connector's list

View file

@ -26,7 +26,7 @@
// It is fine to use C99 in this file because it will not be built with VS
//========================================================================
#define _POSIX_C_SOURCE 199309L
//#define _POSIX_C_SOURCE 199309L
#include "internal.h"

View file

@ -1,4 +1,4 @@
// +build !android,!arm
// +build !rpi,!drm,!android
package rl