changed SUPPORT_MOUSE_CURSOR_RPI to SUPPORT_MOUSE_CURSOR_NATIVE

This commit is contained in:
kernelkinetic 2020-09-22 19:45:25 +02:00
parent 2a12f960ad
commit 972932209b
2 changed files with 13 additions and 33 deletions

View File

@ -44,8 +44,8 @@
#define SUPPORT_MOUSE_GESTURES 1 #define SUPPORT_MOUSE_GESTURES 1
// Reconfigure standard input to receive key inputs, works with SSH connection. // Reconfigure standard input to receive key inputs, works with SSH connection.
#define SUPPORT_SSH_KEYBOARD_RPI 1 #define SUPPORT_SSH_KEYBOARD_RPI 1
// Draw a mouse reference on screen (square cursor box) // Draw a mouse pointer on screen
#define SUPPORT_MOUSE_CURSOR_RPI 1 #define SUPPORT_MOUSE_CURSOR_NATIVE 1
// Use busy wait loop for timing sync, if not defined, a high-resolution timer is setup and used // Use busy wait loop for timing sync, if not defined, a high-resolution timer is setup and used
//#define SUPPORT_BUSY_WAIT_LOOP 1 //#define SUPPORT_BUSY_WAIT_LOOP 1
// Use a half-busy wait loop, in this case frame sleeps for some time and runs a busy-wait-loop at the end // Use a half-busy wait loop, in this case frame sleeps for some time and runs a busy-wait-loop at the end

View File

@ -56,8 +56,8 @@
* WARNING: Reconfiguring standard input could lead to undesired effects, like breaking other running processes or * WARNING: Reconfiguring standard input could lead to undesired effects, like breaking other running processes or
* blocking the device is not restored properly. Use with care. * blocking the device is not restored properly. Use with care.
* *
* #define SUPPORT_MOUSE_CURSOR_RPI (Raspberry Pi only) * #define SUPPORT_MOUSE_CURSOR_NATIVE (Raspberry Pi and DRM only)
* Draw a mouse reference on screen (square cursor box) * Draw a mouse pointer on screen
* *
* #define SUPPORT_BUSY_WAIT_LOOP * #define SUPPORT_BUSY_WAIT_LOOP
* Use busy wait loop for timing sync, if not defined, a high-resolution timer is setup and used * Use busy wait loop for timing sync, if not defined, a high-resolution timer is setup and used
@ -345,7 +345,7 @@ typedef struct CoreData {
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
GLFWwindow *handle; // Native window handle (graphic device) GLFWwindow *handle; // Native window handle (graphic device)
#endif #endif
#if (defined(PLATFORM_RPI) && defined(SUPPORT_MOUSE_CURSOR_RPI)) || defined(PLATFORM_DRM) #if (defined(PLATFORM_RPI) || defined(PLATFORM_DRM)) && defined(SUPPORT_MOUSE_CURSOR_NATIVE)
Texture2D mouseTX; // software mouse on framebuffer Texture2D mouseTX; // software mouse on framebuffer
#endif #endif
#if defined(PLATFORM_RPI) #if defined(PLATFORM_RPI)
@ -1475,11 +1475,11 @@ void BeginDrawing(void)
// End canvas drawing and swap buffers (double buffering) // End canvas drawing and swap buffers (double buffering)
void EndDrawing(void) void EndDrawing(void)
{ {
#if defined(PLATFORM_DRM) #if (defined(PLATFORM_RPI) || defined(PLATFORM_DRM)) && defined(SUPPORT_MOUSE_CURSOR_NATIVE)
// On DRM mode we have no system mouse cursor, so, // On DRM mode we have no system mouse cursor, so,
// we draw a nice mouse cursor respecting cursorHidden... // we draw a nice mouse cursor respecting cursorHidden...
//DrawRectangle(CORE.Input.Mouse.position.x, CORE.Input.Mouse.position.y, 3, 3, MAROON); if (!CORE.Input.Mouse.cursorHidden)
if (!CORE.Input.Mouse.cursorHidden) { {
DrawTexture(CORE.Window.mouseTX,CORE.Input.Mouse.position.x, CORE.Input.Mouse.position.y,WHITE); DrawTexture(CORE.Window.mouseTX,CORE.Input.Mouse.position.x, CORE.Input.Mouse.position.y,WHITE);
} }
#endif #endif
@ -3104,17 +3104,6 @@ static bool InitGraphicsDevice(int width, int height)
TRACELOG(LOG_TRACE, "DISPLAY: connector index %i", i); TRACELOG(LOG_TRACE, "DISPLAY: connector index %i", i);
drmModeConnector *con = drmModeGetConnector(CORE.Window.fd, res->connectors[i]); drmModeConnector *con = drmModeGetConnector(CORE.Window.fd, res->connectors[i]);
TRACELOG(LOG_TRACE, "DISPLAY: there are %i connector modes", con->count_modes); TRACELOG(LOG_TRACE, "DISPLAY: there are %i connector modes", con->count_modes);
#if 0
for (int j = 0; j < con->count_modes; j++) {
TRACELOG(LOG_TRACE, "clock %i", con->modes[j].clock);
TRACELOG(LOG_TRACE, "hdisplay %i", con->modes[j].hdisplay);
TRACELOG(LOG_TRACE, "vdisplay %i", con->modes[j].vdisplay);
TRACELOG(LOG_TRACE, "vrefresh %i", con->modes[j].vrefresh);
TRACELOG(LOG_TRACE, "flags %X", con->modes[j].flags);
TRACELOG(LOG_TRACE, "type %i", con->modes[j].type);
TRACELOG(LOG_TRACE, "name %s", con->modes[j].name);
}
#endif
if ((con->connection == DRM_MODE_CONNECTED) && (con->encoder_id)) if ((con->connection == DRM_MODE_CONNECTED) && (con->encoder_id))
{ {
TRACELOG(LOG_TRACE, "DRM mode connected"); TRACELOG(LOG_TRACE, "DRM mode connected");
@ -3142,14 +3131,6 @@ static bool InitGraphicsDevice(int width, int height)
return false; return false;
} }
#if 0
TRACELOG(LOG_TRACE, "Encoder id %i", enc->encoder_id);
TRACELOG(LOG_TRACE, "Encoder type %i", enc->encoder_type);
TRACELOG(LOG_TRACE, "Encoder crtc id %i", enc->crtc_id);
TRACELOG(LOG_TRACE, "Encoder possible crtcs %i", enc->possible_crtcs);
TRACELOG(LOG_TRACE, "Encoder possible clones %i", enc->possible_clones);
#endif
CORE.Window.crtc = drmModeGetCrtc(CORE.Window.fd, enc->crtc_id); CORE.Window.crtc = drmModeGetCrtc(CORE.Window.fd, enc->crtc_id);
if (!CORE.Window.crtc) if (!CORE.Window.crtc)
{ {
@ -3738,8 +3719,7 @@ find_connector_mode:
ClearBackground(RAYWHITE); // Default background color for raylib games :P ClearBackground(RAYWHITE); // Default background color for raylib games :P
// suggest changing to SUPPORT_DRM_POINTER instead of SUPPORT_MOUSE_CURSOR_RPI #if (defined(PLATFORM_RPI) || defined(PLATFORM_DRM)) && defined(SUPPORT_MOUSE_CURSOR_NATIVE)
#if defined(PLATFORM_DRM)
// software mouse on framebuffer // software mouse on framebuffer
#include "drm_mouse_img.h" #include "drm_mouse_img.h"