Hi, I’m trying to convert the graphics for a Netscape plug-in I wrote to OpenGL, but am not sure how to go about drawing into the existing window. A handler to this window is passed to the plug-in by Netscape Communicator. At this point, the current implementation subclasses the window so that it can draw into it. Is there something like this that I can do in OpenGL? Any other ideas on how to put graphics into an existing window given a handler for it?
Any other ideas on how to put graphics into an existing window given a handler for it?
what do mean by a “handle” to the window? if you mean a Device Context, then yes, you could create a rendering context for that device context and render to it. without any code to look at, I couldn;t help you further.
BTW the above would only work on a windows machine.
where hDC is an HDC and hWnd is an HWND. The first error is that GetDC does not take any parameters. The second is about not being able to convert the result of GetDC from type CDC to HDC. Any ideas on what could be causing these errors?
P.S. I’ve included the files windows.h, GL/gl.h, and GL/glu.h.
Since you’re already in a CWnd derived class, I would tend to go with the first method. Since you are already using MFC for other stuff, you may as well be consistent and use the MFC functions for that as well.