You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the sandbox example, I was trying to get the mouse location to highlight the box when the mouse hovered over it. I had to add these included files to get the mouse location.
The text was updated successfully, but these errors were encountered:
Looking at the OpenGL-Examples solution, you can also do it using events, which is included in GLCore.h
in OnEvent:
EventDispatcher dispatcher(event);
dispatcher.Dispatch<MouseMovedEvent>(
[&](MouseMovedEvent& e)
{
// now you can use e.GetX() and e.GetY()
});
If you just want to use Input.h to get the mouse position feel free to do so - it's your project - but to me it seems like Cherno intended for it to be used this way.
One thing I would like to add is that if the mouse is not moving the event dispatcher won't fire any MouseMovedEvents, so for an FPS controller (or something similar) I would recommend polling the mouse position each frame, but then you would have to add those three includes you mentioned.
Should the following libraries be added to the GLCore.h?
In the sandbox example, I was trying to get the mouse location to highlight the box when the mouse hovered over it. I had to add these included files to get the mouse location.
The text was updated successfully, but these errors were encountered: