Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/tests/gpu_testing.cc
| Show All 13 Lines | |||||
| void GPUTest::SetUp() | void GPUTest::SetUp() | ||||
| { | { | ||||
| GHOST_GLSettings glSettings = {0}; | GHOST_GLSettings glSettings = {0}; | ||||
| CLG_init(); | CLG_init(); | ||||
| ghost_system = GHOST_CreateSystem(); | ghost_system = GHOST_CreateSystem(); | ||||
| ghost_context = GHOST_CreateOpenGLContext(ghost_system, glSettings); | ghost_context = GHOST_CreateOpenGLContext(ghost_system, glSettings); | ||||
| GHOST_ActivateOpenGLContext(ghost_context); | GHOST_ActivateOpenGLContext(ghost_context); | ||||
| context = GPU_context_create(nullptr); | context = GPU_context_create(nullptr, ghost_context); | ||||
| GPU_init(); | GPU_init(); | ||||
| } | } | ||||
| void GPUTest::TearDown() | void GPUTest::TearDown() | ||||
| { | { | ||||
| GPU_exit(); | GPU_exit(); | ||||
| GPU_context_discard(context); | GPU_context_discard(context); | ||||
| GHOST_DisposeOpenGLContext(ghost_system, ghost_context); | GHOST_DisposeOpenGLContext(ghost_system, ghost_context); | ||||
| GHOST_DisposeSystem(ghost_system); | GHOST_DisposeSystem(ghost_system); | ||||
| CLG_exit(); | CLG_exit(); | ||||
| } | } | ||||
| } // namespace blender::gpu | } // namespace blender::gpu | ||||