aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2017-03-12 11:40:41 +0100
committerGitHub <noreply@github.com>2017-03-12 11:40:41 +0100
commit2c0604aa29c720de03797ed102dfa3fe7f05f9b5 (patch)
treee9ccccfa3469ec0458df8c51db1a743645e4200c /src
parent6d1519c1322c6c1718f67e362c87b92c35ce55fd (diff)
parent023a08aeb9169b557b7b9613879b6e6242202a99 (diff)
downloadraylib-2c0604aa29c720de03797ed102dfa3fe7f05f9b5.tar.gz
raylib-2c0604aa29c720de03797ed102dfa3fe7f05f9b5.zip
Merge pull request #245 from raysan5/develop
Integrate develop branch
Diffstat (limited to 'src')
-rw-r--r--src/core.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core.c b/src/core.c
index a3b5f486..c0f5be83 100644
--- a/src/core.c
+++ b/src/core.c
@@ -583,12 +583,15 @@ void SetWindowIcon(Image image)
// Set window position on screen (windowed mode)
void SetWindowPosition(int x, int y)
{
+#if defined(PLATFORM_DESKTOP)
glfwSetWindowPos(window, x, y);
+#endif
}
// Set monitor for the current window (fullscreen mode)
void SetWindowMonitor(int monitor)
{
+#if defined(PLATFORM_DESKTOP)
int monitorCount;
GLFWmonitor** monitors = glfwGetMonitors(&monitorCount);
@@ -598,6 +601,7 @@ void SetWindowMonitor(int monitor)
TraceLog(INFO, "Selected fullscreen monitor: [%i] %s", monitor, glfwGetMonitorName(monitors[monitor]));
}
else TraceLog(WARNING, "Selected monitor not found");
+#endif
}
// Get current screen width
@@ -1125,16 +1129,16 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
MatrixInvert(&matProjView);
// Calculate far and near points
- Quaternion near = { deviceCoords.x, deviceCoords.y, 0.0f, 1.0f };
- Quaternion far = { deviceCoords.x, deviceCoords.y, 1.0f, 1.0f };
+ Quaternion qNear = { deviceCoords.x, deviceCoords.y, 0.0f, 1.0f };
+ Quaternion qFar = { deviceCoords.x, deviceCoords.y, 1.0f, 1.0f };
// Multiply points by unproject matrix
- QuaternionTransform(&near, matProjView);
- QuaternionTransform(&far, matProjView);
+ QuaternionTransform(&qNear, matProjView);
+ QuaternionTransform(&qFar, matProjView);
// Calculate normalized world points in vectors
- Vector3 nearPoint = { near.x/near.w, near.y/near.w, near.z/near.w};
- Vector3 farPoint = { far.x/far.w, far.y/far.w, far.z/far.w};
+ Vector3 nearPoint = { qNear.x/qNear.w, qNear.y/qNear.w, qNear.z/qNear.w};
+ Vector3 farPoint = { qFar.x/qFar.w, qFar.y/qFar.w, qFar.z/qFar.w};
#endif
// Calculate normalized direction vector