I have a MFC app with a standard CView class.
Getting it to work with OpenGL wasn’t difficult.
However, I have now added support for FSAA Multisampling and it isn’t happening.
Everything checks out, but the multisamplling doesn’t happen. (polygons are still jagged)
I am using code taken directly from a sample MFC project that works just fine.
The only difference, that I can see, has to do with when the pixelformat stuff happens.
The sample project does it after calling createwindow.
In my CView, I don’t have that. I have an OnCreate() handler.
What is the right time and place to setup the opengl pixelformat for an MFC CView ?
I noticed that he creates the window twice.
If he successfully can negotiate a multisample pixelformat, he destroys the window and builds it again.
I don’t know if I can do that with a CView
You have to create another window since you need to set pixel format for it in order to create GL rendering context in which you can execute other WGL functions and actually choose pixel format. You should not use the drawing window for the purpose since it is not recommended to set pixel format more than once for the window. Maybe it is the best to use CFrameWnd, if you are using MFC. Just create it with Create(NULL,NULL).