diff options
Diffstat (limited to 'source/blender/gpu/tests/gpu_testing.cc')
-rw-r--r-- | source/blender/gpu/tests/gpu_testing.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/gpu/tests/gpu_testing.cc b/source/blender/gpu/tests/gpu_testing.cc new file mode 100644 index 00000000000..2772139b8f6 --- /dev/null +++ b/source/blender/gpu/tests/gpu_testing.cc @@ -0,0 +1,31 @@ +/* Apache License, Version 2.0 */ + +#include "testing/testing.h" + +#include "GPU_context.h" +#include "GPU_init_exit.h" +#include "gpu_testing.hh" + +#include "GHOST_C-api.h" + +namespace blender::gpu { + +void GPUTest::SetUp() +{ + GHOST_GLSettings glSettings = {0}; + ghost_system = GHOST_CreateSystem(); + ghost_context = GHOST_CreateOpenGLContext(ghost_system, glSettings); + context = GPU_context_create(NULL); + GPU_init(); +} + +void GPUTest::TearDown() +{ + GPU_exit(); + GPU_backend_exit(); + GPU_context_discard(context); + GHOST_DisposeOpenGLContext(ghost_system, ghost_context); + GHOST_DisposeSystem(ghost_system); +} + +} // namespace blender::gpu
\ No newline at end of file |