7f1cb32fc1
Below is the changes made to the included files. The examples CMakeList.txt file was not included but the code change needed for osgviewerMFC inclusion is listed below. CMakeList.txt: This is a little different than other example cmakelist.txt files in that I could not use the setup_example macro. I had to go in and extract out the important parts of the macro and inline them in the CMakeList.txt file so that I could add the WIN32 declaration into the ADD_EXECUTABLE() statement. In the future the setup_example macro might be modified to support osgviewerMFC but this is special case so you might not want to muddy the water for one example. MFC_OSG.h: This file had some small changes: From: #include <osgViewer/GraphicsWindowWin32> To: #include <osgViewer/api/win32/GraphicsWindowWin32> Also added two new function declarations Void PreFrameUpdate(void); Void PostFrameUpdate(void); MFC_OSG.cpp: This file changed only in that I am explicitly showing the viewer run loop and added the two new functions in the MFC_OSG.h file. " |
||
---|---|---|
.. | ||
res | ||
ChildFrm.cpp | ||
ChildFrm.h | ||
CMakeLists.txt | ||
MainFrm.cpp | ||
MainFrm.h | ||
MFC_OSG_MDI.cpp | ||
MFC_OSG_MDI.h | ||
MFC_OSG_MDI.rc | ||
MFC_OSG_MDI.vcproj | ||
MFC_OSG_MDIDoc.cpp | ||
MFC_OSG_MDIDoc.h | ||
MFC_OSG_MDIView.cpp | ||
MFC_OSG_MDIView.h | ||
MFC_OSG.cpp | ||
MFC_OSG.h | ||
ReadMe.txt | ||
Resource.h | ||
stdafx.cpp | ||
stdafx.h |
This project is a very simple implementation of the Microsoft Multiple Document/View Architecture. The only changes needed to compile the project should be to modify the include paths for headers and librarys. This project was written to show how to implement the new osgViewer library with MFC. There is only one problem that I have seen to this point and that is when you have multiple OSG documents open and then you close one of them then all remaining OSG documents quit rendering. I have a small work around in the code that calls AfxMessageBox when the closing windows tread exits and this keeps the other windows rendering correctly. Not sure what the problem is at this point so if anyone finds the cause and has a fix please update the code.