1
Window / Window and multiple threads
« on: September 19, 2011, 11:07:17 pm »
thanks, that explains everything. i believe this should be mentioned in the docs.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
sf::Window* wnd = new sf::Window(sf::VideoMode(400, 300), "some title", sf::Style::Close);
sf::Event event;
while (true)
while(wnd->PollEvent(event))
{
//....
}
while (true)
{
//...
wnd->Display();
}
Failed to activate window's contextmessages to the console. Is what i am trying to do even possible?
// Mouse wheel event
case WM_MOUSEWHEEL :
{
// Mouse position is in screen coordinates, convert it to window coordinates
POINT position;
position.x = static_cast<Int16>(LOWORD(lParam));
position.y = static_cast<Int16>(HIWORD(lParam));
ScreenToClient(myHandle, &position);
Event event;
event.Type = Event::MouseWheelMoved;
event.MouseWheel.Delta = static_cast<Int16>(HIWORD(wParam)) / 120;
event.MouseButton.X = position.x;
event.MouseButton.Y = position.y;
PushEvent(event);
break;
}
The high-order word indicates the distance the wheel is rotated, expressed in multiples or divisions of WHEEL_DELTA, which is 120.
event.MouseWheel.Delta = static_cast<Int16>(HIWORD(wParam)) / 120;
event.MouseWheel.Delta = windowEvent.xbutton.button == Button4 ? 1 : -1;
which can return only 1 or -1 i believe the windows one should be changed to something likeevent.MouseWheel.Delta = static_cast<Int16>(HIWORD(wParam)) > 0 ? 1 : -1;