View Full Version : OpenGL & GDI

07-03-2001, 01:59 PM
I have a C++Builder app running under W2K.
I use a TImage component for a 2D terrain map and I do all the operations through GDI.
Now I have implemented into the program a model browser that shows them with OpenGL.
The problem is that when I open the browser for the first time all the GDI operations performance go down. No matter if I close the browser neither I destroy the rendering context or so. It will continue to be slow.

If I don't open the browser and, while my program is running, I open another OpenGL application, the results are the same.

I really need help with this. At least I need to know if this must be as is, or if there is a solution.

Thanks in advance.

07-18-2001, 02:11 AM
You CAN'T use OpenGL and GDI together. The app will swap between two device contexts and it is very slow. If you don't need to have yours GDI objects on your opengl rendering view, create a standard subwindow to use GDI and an OpenGL one to use.... openGL !