Monday, May 4, 2009

OpenGL Stack overflow

This strange problem bugging me for some time. the scenario is create opengl rendering context on an existing window, opengl render successfully until the window resize or window bring to top, the window crash immediately after that.

The problem was caused by the opengl context was created on a window that wasn't build for opengl, there are some requirement for a opengl ( i got the hint from this MSDN help)

The solution is create a child window for the exisitng window, the settings work for me was:

[quote]
exStyle = WS_EX_TOPMOST;
style = WS_CHILD | WS_VISIBLE;
[/quote]

No comments: