Changeset View
Changeset View
Standalone View
Standalone View
intern/ghost/intern/GHOST_SystemCocoa.mm
| Show All 12 Lines | |||||
| #include "GHOST_EventWheel.h" | #include "GHOST_EventWheel.h" | ||||
| #include "GHOST_TimerManager.h" | #include "GHOST_TimerManager.h" | ||||
| #include "GHOST_TimerTask.h" | #include "GHOST_TimerTask.h" | ||||
| #include "GHOST_WindowCocoa.h" | #include "GHOST_WindowCocoa.h" | ||||
| #include "GHOST_WindowManager.h" | #include "GHOST_WindowManager.h" | ||||
| #include "GHOST_ContextCGL.h" | #include "GHOST_ContextCGL.h" | ||||
| #ifdef WITH_VULKAN_BACKEND | |||||
| # include "GHOST_ContextVK.h" | |||||
| #endif | |||||
| #ifdef WITH_INPUT_NDOF | #ifdef WITH_INPUT_NDOF | ||||
| # include "GHOST_NDOFManagerCocoa.h" | # include "GHOST_NDOFManagerCocoa.h" | ||||
| #endif | #endif | ||||
| #include "AssertMacros.h" | #include "AssertMacros.h" | ||||
| #import <Cocoa/Cocoa.h> | #import <Cocoa/Cocoa.h> | ||||
| ▲ Show 20 Lines • Show All 716 Lines • ▼ Show 20 Lines | |||||
| /** | /** | ||||
| * Create a new off-screen context. | * Create a new off-screen context. | ||||
| * Never explicitly delete the context, use #disposeContext() instead. | * Never explicitly delete the context, use #disposeContext() instead. | ||||
| * \return The new context (or 0 if creation failed). | * \return The new context (or 0 if creation failed). | ||||
| */ | */ | ||||
| GHOST_IContext *GHOST_SystemCocoa::createOffscreenContext(GHOST_GLSettings glSettings) | GHOST_IContext *GHOST_SystemCocoa::createOffscreenContext(GHOST_GLSettings glSettings) | ||||
| { | { | ||||
| #ifdef WITH_VULKAN_BACKEND | |||||
| if (glSettings.context_type == GHOST_kDrawingContextTypeVulkan) { | |||||
| const bool debug_context = (glSettings.flags & GHOST_glDebugContext) != 0; | |||||
| GHOST_Context *context = new GHOST_ContextVK(false, NULL, 1, 0, debug_context); | |||||
| if (!context->initializeDrawingContext()) { | |||||
| delete context; | |||||
| return NULL; | |||||
| } | |||||
| return context; | |||||
| } | |||||
| #endif | |||||
| GHOST_Context *context = new GHOST_ContextCGL(false, NULL, NULL, NULL, glSettings.context_type); | GHOST_Context *context = new GHOST_ContextCGL(false, NULL, NULL, NULL, glSettings.context_type); | ||||
| if (context->initializeDrawingContext()) | if (context->initializeDrawingContext()) | ||||
| return context; | return context; | ||||
| else | else | ||||
| delete context; | delete context; | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,209 Lines • Show Last 20 Lines | |||||