Super simple events added. Seems to be a good way for handling interaction. Modified a few base classes.
This commit is contained in:
@@ -56,10 +56,40 @@ namespace VISEQ::APP {
|
||||
gm.removeNodesAndEdges(nodes);
|
||||
}
|
||||
|
||||
void doInteraction(){
|
||||
while(event_queue.size() > 0){
|
||||
auto e = event_queue.front();
|
||||
std::cout << e.action << " " << e.item->z_index << std::endl;
|
||||
|
||||
if(e.item->getType() == GraphItemType::NODE || e.item->getType() == GraphItemType::CONNECTOR) {
|
||||
switch(e.action){
|
||||
case VISEQ::APP::Interaction::PICKUP:
|
||||
{
|
||||
e.item->pickUp();
|
||||
break;
|
||||
}
|
||||
case VISEQ::APP::Interaction::DRAG:
|
||||
{
|
||||
e.item->drag();
|
||||
break;
|
||||
}
|
||||
case VISEQ::APP::Interaction::PUTDOWN:
|
||||
{
|
||||
e.item->putDown();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
event_queue.pop();
|
||||
}
|
||||
}
|
||||
|
||||
void update(){
|
||||
mutex.lock();
|
||||
updateMidiPorts();
|
||||
mutex.unlock();
|
||||
doInteraction();
|
||||
mouse.update();
|
||||
|
||||
if(KEYS_DOWN.ctrl && IsKeyPressed(KEY_C)){
|
||||
|
||||
Reference in New Issue
Block a user