1. I cant help you with Glut or Opengl games , because it were just my memories from 90's, with their old school Intel386 and Windows95 .Mick P. wrote: ↑Sun Jun 09, 2019 10:32 pm Well, I'm adapting it to GLUT event model now, so user code executes inline. If it takes long to execute so that many timers expire while it is working, then as soon a paint or idle event happens all of those timers are dispatched. All that matters is that the timers have decent resolution.
Off-topic: There are many use cases. And in that model, it can be done just as you describe. The user code just has to arrange for that. wxTimer would not work... but since you mentioned games... do you use wxGLCanvas? Because I'm having a problem with the Show method of wxWindow only works if it's called immediately after the wxFrame is created...
So I'm forced to show the window before the first frame is rendered to the canvas. And there is junk already in the canvas, visible for a brief moment.
I can't even glClear the canvas immediately after it's created. The only thing that works is to do Refresh and wait for a paint event. So I'm having difficulty revealing the window with a desired picture on the initial frame. I may have to make a thread for this, since I've tried damn near everything.
(EDITED: I assume that Show doesn't work in certain contexts, like inside of an event handler. But it's definitely weird that you call Show and the window doesn't show itself.)
2. About show. Such a systems newer really paint a control on Show/Hide - but just mark control as visible/unvisible and invalidate its area on screen. Physically control will be repainted when system reaches common repainting loop, or during events handling - if there are repaint events.
to immediately repaint window seems you need function -
but i never used it.virtual void wxWindow::Update ( )
virtual
Calling this method immediately repaints the invalidated area of the window and all of its children recursively (this normally only happens when the flow of control returns to the event loop).
Notice that this function doesn't invalidate any area of the window so nothing happens if nothing has been invalidated (i.e. marked as requiring a redraw). Use Refresh() first if you want to immediately redraw the window unconditionally.