
How to fix the frozen menu on Mac OS X, if you game implements manual event loop processing.
Posted Friday, 9 September, 2011 - 13:48 by doterax| Project: | The Open Toolkit library |
| Version: | 1.0.0-rc1 |
| Component: | Miscellaneous |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | open |
Jump to:
Description
link to my description of the patch on the Russian.
http://dl.dropbox.com/u/18568924/MacOS%20Programming/MenuHotfix.pdf
You can translate this document to English. Source of this PDF for translators:
http://dl.dropbox.com/u/18568924/MacOS%20Programming/MenuHotfix.odt


Comments
#1
Solving the problem with menu in Mac OS X or how correctly pump messages in Mac OS X.
Google translated text below, sorry :-)
For that would render the game more smoothly, we use a series of pumping messages. That is - we each frame is pumping messages that have occurred over time, rendering the previous frame, and we do it like this:
The main loop looks like this (pseudocode):
As it turns out that's not enough, the whole point is that the treatment menu is only as a function of RunApplicationEventLoop.
And in order to handle this - it is necessary the main loop of the application to make in the context of the function RunApplicationEventLoop.
To do this, create a unique event specifications, signed by him and a handler sent him, and in the handler put the main message loop. Such an approach is completely solved the problem with the menu.
This is done like this (pseudocode):