Blender  V2.93
gpu_testing.cc
Go to the documentation of this file.
1 /* Apache License, Version 2.0 */
2 
3 #include "testing/testing.h"
4 
5 #include "GPU_context.h"
6 #include "GPU_init_exit.h"
7 #include "gpu_testing.hh"
8 
9 #include "GHOST_C-api.h"
10 
11 namespace blender::gpu {
12 
14 {
15  GHOST_GLSettings glSettings = {0};
16  ghost_system = GHOST_CreateSystem();
17  ghost_context = GHOST_CreateOpenGLContext(ghost_system, glSettings);
18  context = GPU_context_create(nullptr);
19  GPU_init();
20 }
21 
23 {
24  GPU_exit();
26  GPU_context_discard(context);
27  GHOST_DisposeOpenGLContext(ghost_system, ghost_context);
28  GHOST_DisposeSystem(ghost_system);
29 }
30 
31 } // namespace blender::gpu
GHOST C-API function and type declarations.
GHOST_SystemHandle GHOST_CreateSystem(void)
Definition: GHOST_C-api.cpp:40
GHOST_TSuccess GHOST_DisposeOpenGLContext(GHOST_SystemHandle systemhandle, GHOST_ContextHandle contexthandle)
GHOST_ContextHandle GHOST_CreateOpenGLContext(GHOST_SystemHandle systemhandle, GHOST_GLSettings glSettings)
GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle)
Definition: GHOST_C-api.cpp:55
void GPU_context_discard(GPUContext *)
Definition: gpu_context.cc:113
GPUContext * GPU_context_create(void *ghost_window)
Definition: gpu_context.cc:99
void GPU_backend_exit(void)
Definition: gpu_context.cc:183
void GPU_init(void)
Definition: gpu_init_exit.c:43
void GPU_exit(void)
Definition: gpu_init_exit.c:62
void TearDown() override
Definition: gpu_testing.cc:22
void SetUp() override
Definition: gpu_testing.cc:13