Browse Source

Merge pull request #245 from raysan5/develop

Integrate develop branch
pull/207/merge
Ray 8 years ago
committed by GitHub
parent
commit
2c0604aa29
5 changed files with 10 additions and 6 deletions
  1. BIN
      docs/images/rfxgen_dark.old.png
  2. BIN
      docs/images/rfxgen_dark.png
  3. BIN
      docs/images/rfxgen_light.png
  4. +0
    -0
      docs/images/rguistyler.png
  5. +10
    -6
      src/core.c

BIN
docs/images/rfxgen_dark.old.png View File

Before After
Width: 560  |  Height: 450  |  Size: 9.1 KiB

BIN
docs/images/rfxgen_dark.png View File

Before After
Width: 560  |  Height: 450  |  Size: 9.1 KiB Width: 500  |  Height: 500  |  Size: 26 KiB

BIN
docs/images/rfxgen_light.png View File

Before After
Width: 500  |  Height: 500  |  Size: 26 KiB

docs/images/raygui_styler.png → docs/images/rguistyler.png View File


+ 10
- 6
src/core.c View File

@ -583,12 +583,15 @@ void SetWindowIcon(Image image)
// Set window position on screen (windowed mode) // Set window position on screen (windowed mode)
void SetWindowPosition(int x, int y) void SetWindowPosition(int x, int y)
{ {
#if defined(PLATFORM_DESKTOP)
glfwSetWindowPos(window, x, y); glfwSetWindowPos(window, x, y);
#endif
} }
// Set monitor for the current window (fullscreen mode) // Set monitor for the current window (fullscreen mode)
void SetWindowMonitor(int monitor) void SetWindowMonitor(int monitor)
{ {
#if defined(PLATFORM_DESKTOP)
int monitorCount; int monitorCount;
GLFWmonitor** monitors = glfwGetMonitors(&monitorCount); GLFWmonitor** monitors = glfwGetMonitors(&monitorCount);
@ -598,6 +601,7 @@ void SetWindowMonitor(int monitor)
TraceLog(INFO, "Selected fullscreen monitor: [%i] %s", monitor, glfwGetMonitorName(monitors[monitor])); TraceLog(INFO, "Selected fullscreen monitor: [%i] %s", monitor, glfwGetMonitorName(monitors[monitor]));
} }
else TraceLog(WARNING, "Selected monitor not found"); else TraceLog(WARNING, "Selected monitor not found");
#endif
} }
// Get current screen width // Get current screen width
@ -1125,16 +1129,16 @@ Ray GetMouseRay(Vector2 mousePosition, Camera camera)
MatrixInvert(&matProjView); MatrixInvert(&matProjView);
// Calculate far and near points // 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 // Multiply points by unproject matrix
QuaternionTransform(&near, matProjView);
QuaternionTransform(&far, matProjView);
QuaternionTransform(&qNear, matProjView);
QuaternionTransform(&qFar, matProjView);
// Calculate normalized world points in vectors // 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 #endif
// Calculate normalized direction vector // Calculate normalized direction vector

Loading…
Cancel
Save