Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_manager.c
| Show First 20 Lines • Show All 3,133 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| BLI_assert(DST.gl_context == NULL); /* Ensure it's called once */ | BLI_assert(DST.gl_context == NULL); /* Ensure it's called once */ | ||||
| DST.gl_context_mutex = BLI_ticket_mutex_alloc(); | DST.gl_context_mutex = BLI_ticket_mutex_alloc(); | ||||
| /* This changes the active context. */ | /* This changes the active context. */ | ||||
| DST.gl_context = WM_opengl_context_create(); | DST.gl_context = WM_opengl_context_create(); | ||||
| WM_opengl_context_activate(DST.gl_context); | WM_opengl_context_activate(DST.gl_context); | ||||
| /* Be sure to create gpu_context too. */ | /* Be sure to create gpu_context too. */ | ||||
| DST.gpu_context = GPU_context_create(NULL); | DST.gpu_context = GPU_context_create(0, DST.gl_context); | ||||
| /* So we activate the window's one afterwards. */ | /* So we activate the window's one afterwards. */ | ||||
| wm_window_reset_drawable(); | wm_window_reset_drawable(); | ||||
| } | } | ||||
| void DRW_opengl_context_destroy(void) | void DRW_opengl_context_destroy(void) | ||||
| { | { | ||||
| BLI_assert(BLI_thread_is_main()); | BLI_assert(BLI_thread_is_main()); | ||||
| if (DST.gl_context != NULL) { | if (DST.gl_context != NULL) { | ||||
| ▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines | |||||