Setting up gl in a pic box

Started by
1 comment, last by llvllatrix 20 years, 2 months ago
I just finished writing a wrapper for gl in an mdi environment. It can also render to the background of a dialog box. I want to try to get it to render to a picture box in a dialog box but the dc i get from the pic box seems incompatible with gl - it seems that the pixelformat could not be set. Anyone know how i could get it to render or am i using the wrong control? tia
Advertisement
I know what you are talking about.

I did it along time ago.

If i remember correctly, i got some example source for exactly that from PlanetSourceCode.com under the C++ section. I think i just typed in OpenGL and it was there!

Also, on that example, i belive he used a text box to put the opengl window on, with it disabled so you couldnt type. All i know was it worked so there might be a reason he used a text box, there might not.

If you cant find it, another thing you could do is just create the regular OpenGL window and make it a child of the dialog box. Then just use SetWindowPos() and it will be as if it is really included in the dialog box. That is how i have done some things before and it looks really nice. But i guess your first idea would be easier, so check it out!

Good Luck

"What we do in life, echos in eternity" -- Gladiator
"What we do in life, echos in eternity" -- Gladiator
I have several MFC OpenGL examples on my site, and I have used the CStatic control several times. I don''t know why the DC you get would be incompatible with OpenGL, but maybe the MFC source code has some clues.

Love means nothing to a tennis player

My nothing-to-write-home-about OpenGL webpage. (please pardon the popups!)

This topic is closed to new replies.

Advertisement