summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2021-08-15 12:58:34 +0200
committerraysan5 <[email protected]>2021-08-15 12:58:34 +0200
commit848cdb267a7cc52ee0084185eacffdca2e9b3a31 (patch)
treea3dc443d91d5cc07dc4051c98e84dd94a99b1e71
parent760cfd361e055326cf459812855d8dd83129c132 (diff)
downloadraylib-848cdb267a7cc52ee0084185eacffdca2e9b3a31.tar.gz
raylib-848cdb267a7cc52ee0084185eacffdca2e9b3a31.zip
Support C++ usage as standalone library
-rw-r--r--src/gestures.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gestures.h b/src/gestures.h
index 2ed9f8fd..355f6081 100644
--- a/src/gestures.h
+++ b/src/gestures.h
@@ -99,10 +99,6 @@ typedef struct {
Vector2 position[4];
} GestureEvent;
-#ifdef __cplusplus
-extern "C" { // Prevents name mangling of functions
-#endif
-
//----------------------------------------------------------------------------------
// Global Variables Definition
//----------------------------------------------------------------------------------
@@ -111,11 +107,15 @@ extern "C" { // Prevents name mangling of functions
//----------------------------------------------------------------------------------
// Module Functions Declaration
//----------------------------------------------------------------------------------
+
+#ifdef __cplusplus
+extern "C" { // Prevents name mangling of functions
+#endif
+
void ProcessGestureEvent(GestureEvent event); // Process gesture event and translate it into gestures
void UpdateGestures(void); // Update gestures detected (must be called every frame)
-
#if defined(GESTURES_STANDALONE)
-void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags
+void SetGesturesEnabled(unsigned int flags); // Enable a set of gestures using flags
bool IsGestureDetected(int gesture); // Check if a gesture have been detected
int GetGestureDetected(void); // Get latest detected gesture
int GetTouchPointsCount(void); // Get touch points count
@@ -141,9 +141,15 @@ float GetGesturePinchAngle(void); // Get gesture pinch ang
#if defined(GESTURES_IMPLEMENTATION)
#if defined(_WIN32)
+ #if defined(__cplusplus)
+ extern "C" { // Prevents name mangling of functions
+ #endif
// Functions required to query time on Windows
int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount);
int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency);
+ #if defined(__cplusplus)
+ }
+ #endif
#elif defined(__linux__)
#if _POSIX_C_SOURCE < 199309L
#undef _POSIX_C_SOURCE