Commit Graph

4 Commits

Author SHA1 Message Date
Robert Osfield
07e94c8ce0 From Almalric Alexandre, "I've noticed that all osgViewerMFC example from osg 2.x.x are flickering when resizing 3D view, to avoid this only add OnEraseBkgnd callback in CMFC_OSG_MDIView class and do nothing in it. Just like the WxWidget example.
Attached the modified version of MFC_OSG_MDIView.cpp and MFC_OSG_MDIView.h."

Note from Robert Osfield, submission came with wrong header file, so have had
to guess at what it should be, fingers crossed it worn't break windows build... :-)
2007-09-03 10:04:34 +00:00
Robert Osfield
fee5bc9f8c From Michael Hartman, "Here is an update for the closing issue with the example osgviewerMFC where the MFC rendering thread would not exit before the application and the thread would be left running in the background and the user would have to use TaskManager to kill the process.
Changes:

MFC_OSG.cpp:

            Removed pixelformatdesciptor from the class initialization.

            Used setInheritedWindowPixelFormat to true so it will setup the pixelformat for the window.

            Added class destructor code.

MFC_OSG.h:

            Removed the ref_ptr on osgViewer::Viewer

MFC_OSG_MDIViewer.cpp:

            Changed the OnDestroy function code.

            Added WaitforSingleObject with thread handle for the MFC render handle.

MFC_OSG_MDIView.h:

            Added class variable for MFC Render Thread Handle for use with the WaitforSingleObject.
"
2007-07-23 20:37:49 +00:00
Robert Osfield
c913f00d21 From Michael Hartman, "CMakeLists.txt:
Changed this back to setup_example since WIN32 flag is now supported.

 

MFC_OSG.h:

   Added flag to indicate when the rendering thread has exited.

 

MFC_OSG.cpp:

   Code modifications to support rendering flag thread exit.

 

MFC_OSG_MDIView.cpp:

   Change to OnDestroy function to wait until we get render thread exit flag is true before we close the window.

 

 

Main Exit Process:

   User presses escape button

   Viewer captures escape button and stops threading etc.

   Viewer sets Done when shutdown is complete

   MFC Render Thread monitors viewer->done for true

   MFC Render Thread exits while loop and sets MFC Done flag

   MFC View Window monitors MFC Done flag and then closes/destroys the window

"
2007-06-01 21:28:18 +00:00
Robert Osfield
4eb8427327 From Michael Hartman, " Here is the MFC_OSG example. It is very basic and the community is welcome to enhance/improve this example. There is one bug documented in the Readme.txt file that I just have not had time to solve. Also, the code is built outside of the OSG environment and uses environment variables to get to the OSG distribution headers and examples. That should be the only change a user needs to make to get the code to compile." 2007-05-11 08:19:46 +00:00