who can tell me how to use glut in MFC?
it will be awkward to use glut with mfc, since glut drives the message pump, and mfc wants to do this too, by default.
i would suggest creating your own render context with mfc, since it wraps up all the ui stuff anyway. wouldn’t be much point in using glut there.
Thank you very much.
But I want to write a programme that can obtain the SUB of two objects.I have seen sb
s programme write with GLUT.but I must use MFC,so I dont know how to program it.
See WGL (Windows OpenGL Extensions) functions such as wglCreateContext, wglMakeCurrent, etc. Do a Google search, this FAQ, etc. and you’ll find numerous examples of OpenGL and MFC.
You cannot do this with GLUT. You can use MFC quite easily with OpenGL using WGL to greate a context from the HDC but MFC is fundamentally incompatible with GLUT because of the glutmainloop requirement.
This article might be of use to you, it certainly was of use to me!
nice link. i didn’t see the render context init though. maybe it’s in the source distribution. usually do that in the OnCreate() and PreCreateWindow() methods (very important).