Further abstraction of platform window handling
We could now build our own native window class and stop relying on GLFW. However this won't be important for now!
This commit is contained in:
@ -45,13 +45,15 @@ public:
|
||||
|
||||
double previous = glfwGetTime();
|
||||
double lag = 0.0;
|
||||
while (!appWindow.WindowShouldClose())
|
||||
while (!appWindow->WindowShouldClose())
|
||||
{
|
||||
PollEvents();
|
||||
double now = glfwGetTime();
|
||||
double elapsed = now - previous ;
|
||||
previous = now;
|
||||
lag += elapsed;
|
||||
|
||||
scene.Update();
|
||||
|
||||
if (sceneview.isFocused)
|
||||
{
|
||||
@ -62,9 +64,9 @@ public:
|
||||
|
||||
if (MouseButtonPressed(YOGGIE_MOUSE_BUTTON_RIGHT)) {
|
||||
|
||||
glfwSetInputMode(appWindow.GetGLFWHandle(), GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
|
||||
auto newX = getCursorPosX(&appWindow);
|
||||
auto newY = getCursorPosY(&appWindow);
|
||||
glfwSetInputMode((GLFWwindow*)appWindow->GetHandle(), GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
|
||||
auto newX = getCursorPosX(appWindow);
|
||||
auto newY = getCursorPosY(appWindow);
|
||||
|
||||
if (firstMouse)
|
||||
{
|
||||
@ -94,7 +96,7 @@ public:
|
||||
}
|
||||
else if (firstMouse == false)
|
||||
{
|
||||
glfwSetInputMode(appWindow.GetGLFWHandle(), GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||
glfwSetInputMode((GLFWwindow*)appWindow->GetHandle(), GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||
firstMouse = true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user