wx application flow
BlitzMax Forums/Brucey's Modules/wx application flow
| ||
I got wxWidgets working with my engine: In Sandbox (using MaxGUI), my program loop is like this: Repeat If realtime PauseApp() While PeekEvent() WaitEvent() Wend ResumeApp() world.Update() world.Render() Flip(0) Else WaitEvent() EndIf Forever How can I achieve the real-time approach with wxWidgets? I do not want to use a timer. |
| ||
real-time approach What is that, exactly? All I see is a loop which decides what to do based on a variable which has no description.In wxMax you do not handle event gathering - it does it for you - so all you need to worry about is doing the right stuff when your events are received. |
| ||
The 'realtime' variable is set to True when the application is running in realtime rendering mode. |
| ||
Have a look at the "mainloop" sample. (if you can make sense of it ;-) It gives you more control over the event loop of wxWidgets. Somewhere in that loop you should be able to run your own stuff too. If you are intending on having the window resizable, you should probably connect to the wxEVT_SIZE event, and maybe call SetViewPort - just in case... |
| ||
Just one word of warning - wxWidgets doesn't like to go full-screen. There are issues forwarding events to a full-screen context. For windowed tools and apps, it works great though. Not that I haven't tried to solve this issue, but once I have to start working with low-level hacky OS-specific things.... well... you can imagine how much fun that is. |
| ||
Thanks. The full-screen graphics problem is not an issue for me. |
| ||
Cool, this is fine. wxWidgets is a little weird, but if I can just isolate the code off I will be fine. |