the function gets executed but you can only draw from the draw function so anything you draw in the mouse callbacks for example won’t be seen in the screen.
Thanks, that makes sense , but then i do have another question if you could be so kind to help me. It’s probably another really simple thing. Still learning C++.
Why can’t I edit the values that are used in the draw function from the other function? Is this because you can’t edit a memory location while reading it? The device.writeByte() function also doesn’t work in the sendData() function (which is called by the mouse drag), but it does work in the draw() function
They are called in that files header file, communication.hpp.
But:
The draw() function is called from the draw in ofApp.cpp and the sendData() function is called from another file, kinematics.cpp.
that shouldn’t be a problem. could it be that you are creating 2 different instances of the class? so you are setting the values in one and drawing the other?
or, how are you passing the instance from wherever you are creating it, i guess ofApp, to the class that calls sendData?