Home > other >  Percentage, cocos2dx 3. Version event mechanism
Percentage, cocos2dx 3. Version event mechanism

Time:09-25

Cocos2dx below call in the main loop
 
Director - & gt; MainLoop ();
Glview - & gt; PollEvents ();

In the mainloop timer function call processing, if the emptied a pointer, and after that I click a button on the interface will produce a touch event,
This event will be asynchronous join the glview below the message queue, glview - & gt; PollEvents (); Invokes the response of the touch response that button will be response of events, if operating the pointer will not collapse?
question: as the possibility of such concerns have, such as exist and how to solve or avoid?

CodePudding user response:

Judgment is pointer is not empty before operation

CodePudding user response:

reference 1st floor daoxwj response:
judgment is only a pointer is not empty operating bai

Just want to a example, pointer may be able to handle, but if it is an int, empty to 0, later I will switch case, not into the hooks