Dear Marcus > ReleaseDC shouldn't be called until you are closing the window. Doing it > before probably releases the glcontext as well, making wglMakeCurrent > fail.
But it is calling in WIN32Window::init function ReleaseDC. It is intersting to see it is calling twice in init function. I donot know why ? ----- Original Message ----- From: "Marcus Lindblom" <[email protected]> To: <[email protected]> Sent: Tuesday, July 21, 2009 4:54 PM Subject: Re: [Opensg-users] wglMakeCurrent Failed in OpenSG > alex wrote: >> Hi Folks >> >> I am trying to use OpenSG 2.0 with MFC but device creation is fail, I >> tried >> to debug it and found wglMakeCurrent function is failed to set current >> context. I know basics of OpenGL for device creations. I had also >> changed >> style of dialog with adding CS_OWNDC in style. >> >> If i removing ReleaseDC from library then device creation is fine. >> Basically >> it only work once when wglCreateContext called. >> >> Any idea why ? > > I don't understand exactly how your code works, but wglCreateContext > must be called if any wglMakeCurrent call is to succeed. (You need an > OpenGL context for the entire lifetime of the OpenGL window) > > ReleaseDC shouldn't be called until you are closing the window. Doing it > before probably releases the glcontext as well, making wglMakeCurrent > fail. > > Cheers, > /Marcus > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full > prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Opensg-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/opensg-users > ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
