Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/space_view3d.c
| Show First 20 Lines • Show All 539 Lines • ▼ Show 20 Lines | static void view3d_main_region_exit(wmWindowManager *wm, ARegion *ar) | ||||
| RegionView3D *rv3d = ar->regiondata; | RegionView3D *rv3d = ar->regiondata; | ||||
| ED_view3d_stop_render_preview(wm, ar); | ED_view3d_stop_render_preview(wm, ar); | ||||
| if (rv3d->gpuoffscreen) { | if (rv3d->gpuoffscreen) { | ||||
| GPU_offscreen_free(rv3d->gpuoffscreen); | GPU_offscreen_free(rv3d->gpuoffscreen); | ||||
| rv3d->gpuoffscreen = NULL; | rv3d->gpuoffscreen = NULL; | ||||
| } | } | ||||
| if (rv3d->viewport) { | |||||
| DRW_opengl_context_enable(); | |||||
| GPU_viewport_free(rv3d->viewport); | |||||
| DRW_opengl_context_disable(); | |||||
| rv3d->viewport = NULL; | |||||
| } | |||||
| } | } | ||||
| static int view3d_ob_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) | static int view3d_ob_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) | ||||
| { | { | ||||
| if (drag->type == WM_DRAG_ID) { | if (drag->type == WM_DRAG_ID) { | ||||
| ID *id = drag->poin; | ID *id = drag->poin; | ||||
| if (GS(id->name) == ID_OB) | if (GS(id->name) == ID_OB) | ||||
| return 1; | return 1; | ||||
| ▲ Show 20 Lines • Show All 161 Lines • ▼ Show 20 Lines | if (rv3d->depths) { | ||||
| MEM_freeN(rv3d->depths); | MEM_freeN(rv3d->depths); | ||||
| } | } | ||||
| if (rv3d->sms) { | if (rv3d->sms) { | ||||
| MEM_freeN(rv3d->sms); | MEM_freeN(rv3d->sms); | ||||
| } | } | ||||
| if (rv3d->gpuoffscreen) { | if (rv3d->gpuoffscreen) { | ||||
| GPU_offscreen_free(rv3d->gpuoffscreen); | GPU_offscreen_free(rv3d->gpuoffscreen); | ||||
| } | } | ||||
| if (rv3d->viewport) { | |||||
| DRW_opengl_context_enable(); | |||||
| GPU_viewport_free(rv3d->viewport); | |||||
| DRW_opengl_context_disable(); | |||||
| } | |||||
| MEM_freeN(rv3d); | MEM_freeN(rv3d); | ||||
| ar->regiondata = NULL; | ar->regiondata = NULL; | ||||
| } | } | ||||
| } | } | ||||
| /* copy regiondata */ | /* copy regiondata */ | ||||
| static void *view3d_main_region_duplicate(void *poin) | static void *view3d_main_region_duplicate(void *poin) | ||||
| { | { | ||||
| if (poin) { | if (poin) { | ||||
| RegionView3D *rv3d = poin, *new; | RegionView3D *rv3d = poin, *new; | ||||
| new = MEM_dupallocN(rv3d); | new = MEM_dupallocN(rv3d); | ||||
| if (rv3d->localvd) | if (rv3d->localvd) | ||||
| new->localvd = MEM_dupallocN(rv3d->localvd); | new->localvd = MEM_dupallocN(rv3d->localvd); | ||||
| if (rv3d->clipbb) | if (rv3d->clipbb) | ||||
| new->clipbb = MEM_dupallocN(rv3d->clipbb); | new->clipbb = MEM_dupallocN(rv3d->clipbb); | ||||
| new->depths = NULL; | new->depths = NULL; | ||||
| new->gpuoffscreen = NULL; | new->gpuoffscreen = NULL; | ||||
| new->render_engine = NULL; | new->render_engine = NULL; | ||||
| new->sms = NULL; | new->sms = NULL; | ||||
| new->smooth_timer = NULL; | new->smooth_timer = NULL; | ||||
| new->compositor = NULL; | new->compositor = NULL; | ||||
| new->viewport = NULL; | |||||
| return new; | return new; | ||||
| } | } | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| static void view3d_recalc_used_layers(ARegion *ar, wmNotifier *wmn, const Scene *UNUSED(scene)) | static void view3d_recalc_used_layers(ARegion *ar, wmNotifier *wmn, const Scene *UNUSED(scene)) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 741 Lines • Show Last 20 Lines | |||||