Strange anomaly visualization


I'm new to opencascade and have build the example Canuck posted here.

It compiles and links perfectly and I can run the application without errors but nothing is displayed in the viewer.

Now, when I do the following actions(don't ask me how I figured this out :p) the app suddenly works perfectly:

1)I press the printscreen button on my keyboard with my app open(i.e. on the screen).
2)I open another random window in Windows(for ex. an IE window) so it overlays the window of the opencascade app.
3)I close(or minimalise) that top window again.
4)My app is uncovered and shown on the screen. The objects I have drawn in the view are suddenly visible!

I have attached the 2 printscreens of my app in a rar.

Some side notes here:
- clicking in the window, resizing the window, opening the menu, etc, has no effect
- maximizing or minimizing the app has no effect
- running the app from inside visual studio or outside it as a .exe doesn't make a difference

I wonder what kind of problem this is...

Maybe the repainting of the window isn't programmed right, but then again it's an example from Canuck(and I made ~no changes to the code), so I assume it's working for him and the others that compiled the program.

Could this be a video card problem? I hope someone can point me in the right direction.

Kind regards, Foxtrot

Mark's picture

That's from 2004, so it is quite dated!

See if there's a way to force a redraw, and call it as the last step in initializing your app. If necessary, have a loop which processes wx events for 1/2 second, then redraw the screen.

For an example that's known to work with current versions of WxWindows and OCC, take a look at heekscad.


vliegenkristof's picture

Thank you for your reply.

I will give your ideas a try, but I must tell you that I noticed earlier this day that the tutorial example(run from the start menu in Windows) behaves the same way. The bottle will not show in the tutorial if I don't execute the same steps outlined above.

Kind regards, Foxtrot