Hello,
(I am still new to c++, but i made quite lot of progress, i am not a computer science student although.)
I have a question that could appear "non intelligent" but it kinda confused me. Here it is:
While using the "window" module, its functions were easy to use and pretty straighforward (
https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1Window.php)
The "Public Member Functions" section contains all the functions at one glance, for instance i can use window1.isOpen() if i created and object called window1 from the classe Window.
But then i went to the event page (
https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1Event.php)
because i wanted to check an example that i had read from here :
https://www.sfml-dev.org/tutorials/2.5/window-events.php which is below:
if (event.type == sf::Event::MouseWheelScrolled)
{
if (event.mouseWheelScroll.wheel == sf::Mouse::VerticalWheel)
cout << "wheel type: vertical" << endl;
else if (event.mouseWheelScroll.wheel == sf::Mouse::HorizontalWheel)
cout << "wheel type: horizontal" << endl;
else
cout << "wheel type: unknown" << endl;
cout << "wheel movement: " << event.mouseWheelScroll.delta << endl; // this line
cout << "mouse x: " << event.mouseWheelScroll.x << endl;
cout << "mouse y: " << event.mouseWheelScroll.y << endl;
}
I got confused when i read this part " event.mouseWheelScroll.delta",
What is : "mouseWheelScroll"?
It can neither be found on the classes section of the Event pages nor the public types, i can see it on the public Attributes somehow.
Checking the Event.hpp page :
https://www.sfml-dev.org/documentation/2.5.1/Event_8hpp_source.php, i don't find "mouseWheelScroll", only "MouseWheelScrollEvent" and "MouseWheelEvent" which are different from "mouseWheelScroll".
As for the "delta" in "event.mouseWheelScroll.delta" no confusion, it's one of variables of the structures i found on the "Event.hpp" page.
Sorry if the answer is obvious, maybe i miss something in c++ that i still need to learn. If yes, please do enlighten me.
Thank you