Based on Nehe tutorials, I am rendering OpenGL in a a child of one window in my Win32 API app. Now I need to render on a child of -another- window in my app. Currently, in WM_CREATE for each child window I do something like:
I do the same for both windows. Of course, different hRC and the hDC of each corresponding windows. hRC, hDC for each different child has a different name and is in a different file which contains the different window procedure.
Only one of the OpenGL window is shown rendering. If I comment out the call to CreateGLWindow of the one showing, it will then show the other one.
Note that each child window is calling different versions of CreateGLWindow and the other initializing functions. I did this while experimenting. Will create a single function for both child windows when I get this working, which passed the RC and DC as arguments.
CreateGLWindow is based on nehe.gamedev.net tutorials, and is working well (at least for one window). Just the normal GL under win32 API creation stuff… pixel format, getting a RC based on the DC, etc.
Later, thanks for any help!!