OpenSubdiv: Commit of OpenSubdiv integration into Blender
[blender.git] / source / blender / windowmanager / intern / wm_init_exit.c
index dc36cfbaf574a814cda50e036cb67bdec3ca03b8..ad7044c62187c9d4b3a1612c90f1192727a9901a 100644 (file)
 #include "BKE_sound.h"
 #include "COM_compositor.h"
 
+#ifdef WITH_OPENSUBDIV
+#  include "opensubdiv_capi.h"
+#endif
+
 static void wm_init_reports(bContext *C)
 {
        ReportList *reports = CTX_wm_reports(C);
@@ -171,12 +175,13 @@ void WM_init(bContext *C, int argc, const char **argv)
        /* get the default database, plus a wm */
        wm_homefile_read(C, NULL, G.factory_startup, NULL);
        
-       /* sets 3D mouse deadzone */
-       WM_ndof_deadzone_set(U.ndof_deadzone);
 
        BLF_lang_set(NULL);
 
        if (!G.background) {
+               /* sets 3D mouse deadzone */
+               WM_ndof_deadzone_set(U.ndof_deadzone);
+
                GPU_init();
 
                GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
@@ -524,6 +529,10 @@ void WM_exit_ext(bContext *C, const bool do_python)
        (void)do_python;
 #endif
 
+#ifdef WITH_OPENSUBDIV
+       openSubdiv_cleanup();
+#endif
+
        if (!G.background) {
                GPU_global_buffer_pool_free();
                GPU_free_unused_buffers();