Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_view.c
| Show First 20 Lines • Show All 916 Lines • ▼ Show 20 Lines | else { | ||||
| gpu_select_mode = GPU_SELECT_ALL; | gpu_select_mode = GPU_SELECT_ALL; | ||||
| } | } | ||||
| } | } | ||||
| /* Tools may request depth outside of regular drawing code. */ | /* Tools may request depth outside of regular drawing code. */ | ||||
| UI_Theme_Store(&theme_state); | UI_Theme_Store(&theme_state); | ||||
| UI_SetTheme(SPACE_VIEW3D, RGN_TYPE_WINDOW); | UI_SetTheme(SPACE_VIEW3D, RGN_TYPE_WINDOW); | ||||
| #ifndef WITH_OPENGL_LEGACY | |||||
| /* All of the queries need to be perform on the drawing context. */ | |||||
| DRW_ogl_ctx_enable(); | |||||
| #endif | |||||
| /* Re-use cache (rect must be smaller then the cached) | /* Re-use cache (rect must be smaller then the cached) | ||||
| * other context is assumed to be unchanged */ | * other context is assumed to be unchanged */ | ||||
| if (GPU_select_is_cached()) { | if (GPU_select_is_cached()) { | ||||
| GPU_select_begin(buffer, bufsize, &rect, gpu_select_mode, 0); | GPU_select_begin(buffer, bufsize, &rect, gpu_select_mode, 0); | ||||
| GPU_select_cache_load_id(); | GPU_select_cache_load_id(); | ||||
| hits = GPU_select_end(); | hits = GPU_select_end(); | ||||
| goto finally; | goto finally; | ||||
| } | } | ||||
| G.f |= G_PICKSEL; | G.f |= G_PICKSEL; | ||||
| /* Important we use the 'viewmat' and don't re-calculate since | /* Important we use the 'viewmat' and don't re-calculate since | ||||
| * the object & bone view locking takes 'rect' into account, see: T51629. */ | * the object & bone view locking takes 'rect' into account, see: T51629. */ | ||||
| ED_view3d_draw_setup_view(vc->win, eval_ctx, scene, ar, v3d, vc->rv3d->viewmat, NULL, &rect); | ED_view3d_draw_setup_view(vc->win, eval_ctx, scene, ar, v3d, vc->rv3d->viewmat, NULL, &rect); | ||||
| if (v3d->drawtype > OB_WIRE) { | if (v3d->drawtype > OB_WIRE) { | ||||
| v3d->zbuf = true; | v3d->zbuf = true; | ||||
| glEnable(GL_DEPTH_TEST); | glEnable(GL_DEPTH_TEST); | ||||
| } | } | ||||
| if (vc->rv3d->rflag & RV3D_CLIPPING) | if (vc->rv3d->rflag & RV3D_CLIPPING) | ||||
| ED_view3d_clipping_set(vc->rv3d); | ED_view3d_clipping_set(vc->rv3d); | ||||
| GPU_select_begin(buffer, bufsize, &rect, gpu_select_mode, 0); | GPU_select_begin(buffer, bufsize, &rect, gpu_select_mode, 0); | ||||
| #ifdef WITH_OPENGL_LEGACY | #ifdef WITH_OPENGL_LEGACY | ||||
| if (IS_VIEWPORT_LEGACY(vc->v3d)) { | if (IS_VIEWPORT_LEGACY(vc->v3d)) { | ||||
| ED_view3d_draw_select_loop(vc, scene, sl, v3d, ar, use_obedit_skip, use_nearest); | ED_view3d_draw_select_loop(vc, scene, sl, v3d, ar, use_obedit_skip, use_nearest); | ||||
| Show All 36 Lines | if (v3d->drawtype > OB_WIRE) { | ||||
| v3d->zbuf = 0; | v3d->zbuf = 0; | ||||
| glDisable(GL_DEPTH_TEST); | glDisable(GL_DEPTH_TEST); | ||||
| } | } | ||||
| if (vc->rv3d->rflag & RV3D_CLIPPING) | if (vc->rv3d->rflag & RV3D_CLIPPING) | ||||
| ED_view3d_clipping_disable(); | ED_view3d_clipping_disable(); | ||||
| finally: | finally: | ||||
| #ifndef WITH_OPENGL_LEGACY | |||||
| DRW_ogl_ctx_disable(); | |||||
| #endif | |||||
| if (hits < 0) printf("Too many objects in select buffer\n"); /* XXX make error message */ | if (hits < 0) printf("Too many objects in select buffer\n"); /* XXX make error message */ | ||||
| UI_Theme_Restore(&theme_state); | UI_Theme_Restore(&theme_state); | ||||
| return hits; | return hits; | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| ▲ Show 20 Lines • Show All 258 Lines • Show Last 20 Lines | |||||