summaryrefslogtreecommitdiffhomepage
path: root/src/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/src/core.c b/src/core.c
index 8e15eb96..241772ec 100644
--- a/src/core.c
+++ b/src/core.c
@@ -4,24 +4,25 @@
*
* Basic functions to manage windows, OpenGL context and input on multiple platforms
*
-* The following platforms are supported:
-* PLATFORM_DESKTOP - Windows, Linux, Mac (OSX)
-* PLATFORM_ANDROID - Only OpenGL ES 2.0 devices
-* PLATFORM_RPI - Rapsberry Pi (tested on Raspbian)
-* PLATFORM_WEB - Emscripten, HTML5
-* Oculus Rift CV1 (with desktop mirror) - View [rlgl] module to enable it
+* The following platforms are supported: Windows, Linux, Mac (OSX), Android, Raspberry Pi, HTML5, Oculus Rift CV1
*
-* On PLATFORM_DESKTOP, the external lib GLFW3 (www.glfw.com) is used to manage graphic
-* device, OpenGL context and input on multiple operating systems (Windows, Linux, OSX).
-*
-* On PLATFORM_ANDROID, graphic device is managed by EGL and input system by Android activity.
-*
-* On PLATFORM_RPI, graphic device is managed by EGL and input system is coded in raw mode.
+* External libs:
+* GLFW3 - Manage graphic device, OpenGL context and inputs on PLATFORM_DESKTOP (Windows, Linux, OSX)
+* raymath - 3D math functionality (Vector3, Matrix, Quaternion)
+* camera - Multiple 3D camera modes (free, orbital, 1st person, 3rd person)
+* gestures - Gestures system for touch-ready devices (or simulated from mouse inputs)
*
* Module Configuration Flags:
+* PLATFORM_DESKTOP - Windows, Linux, Mac (OSX)
+* PLATFORM_ANDROID - Android (only OpenGL ES 2.0 devices), graphic device is managed by EGL and input system by Android activity.
+* PLATFORM_RPI - Rapsberry Pi (tested on Raspbian), graphic device is managed by EGL and input system is coded in raw mode.
+* PLATFORM_WEB - HTML5 (using emscripten compiler)
*
* RL_LOAD_DEFAULT_FONT - Use external module functions to load default raylib font (module: text)
*
+* NOTE: Oculus Rift CV1 requires PLATFORM_DESKTOP for render mirror - View [rlgl] module to enable it
+*
+*
* Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
*
* This software is provided "as-is", without any express or implied warranty. In no event
@@ -667,7 +668,7 @@ void Begin3dMode(Camera camera)
{
rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2)
- if (IsVrDeviceReady()) BeginVrDrawing();
+ if (IsVrDeviceReady() || IsVrSimulator()) BeginVrDrawing();
rlMatrixMode(RL_PROJECTION); // Switch to projection matrix
@@ -697,7 +698,7 @@ void End3dMode(void)
{
rlglDraw(); // Process internal buffers (update + draw)
- if (IsVrDeviceReady()) EndVrDrawing();
+ if (IsVrDeviceReady() || IsVrSimulator()) EndVrDrawing();
rlMatrixMode(RL_PROJECTION); // Switch to projection matrix
rlPopMatrix(); // Restore previous matrix (PROJECTION) from matrix stack
@@ -1174,12 +1175,14 @@ bool IsGamepadAvailable(int gamepad)
bool IsGamepadName(int gamepad, const char *name)
{
bool result = false;
+
+#if !defined(PLATFORM_ANDROID)
const char *gamepadName = NULL;
-
+
if (gamepadReady[gamepad]) gamepadName = GetGamepadName(gamepad);
-
if ((name != NULL) && (gamepadName != NULL)) result = (strcmp(name, gamepadName) == 0);
-
+#endif
+
return result;
}
@@ -1975,7 +1978,11 @@ static void PollInputEvents(void)
previousMouseWheelY = currentMouseWheelY;
currentMouseWheelY = 0;
-
+#endif
+
+// NOTE: GLFW3 joystick functionality not available in web
+// TODO: Support joysticks using emscripten API
+#if defined(PLATFORM_DESKTOP)
// Check if gamepads are ready
// NOTE: We do it here in case of disconection
for (int i = 0; i < MAX_GAMEPADS; i++)