Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormano-wii <germano.costa@ig.com.br>2019-01-02 15:01:46 +0300
committermano-wii <germano.costa@ig.com.br>2019-01-02 15:01:46 +0300
commit945007b32e9a30252216398413bff88c103d8667 (patch)
treed32f5249c0140696368582b7d17066b2e57e20d4 /source/blender/gpu
parentc862c14339e4c3ccf660153a5589ceb3561112d8 (diff)
Fix T59773: Raise exception if the gpu module is used in backgound mode.
Instead of crashing, an error message is displayed if a function of the gpu module is called without a GPU context. Reviewers: brecht, campbellbarton, JacquesLucke, mont29 Subscribers: abdelmatinboulbayam, amir.shehata Differential Revision: https://developer.blender.org/D4143
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/GPU_init_exit.h1
-rw-r--r--source/blender/gpu/intern/gpu_init_exit.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/gpu/GPU_init_exit.h b/source/blender/gpu/GPU_init_exit.h
index e89c970b7d9..8f1a42c8795 100644
--- a/source/blender/gpu/GPU_init_exit.h
+++ b/source/blender/gpu/GPU_init_exit.h
@@ -38,6 +38,7 @@ extern "C" {
void GPU_init(void);
void GPU_exit(void);
+bool GPU_is_initialized(void);
#ifdef __cplusplus
}
diff --git a/source/blender/gpu/intern/gpu_init_exit.c b/source/blender/gpu/intern/gpu_init_exit.c
index 55d0466c929..d21acb188d9 100644
--- a/source/blender/gpu/intern/gpu_init_exit.c
+++ b/source/blender/gpu/intern/gpu_init_exit.c
@@ -73,7 +73,6 @@ void GPU_init(void)
}
-
void GPU_exit(void)
{
if (!G.background) {
@@ -92,3 +91,9 @@ void GPU_exit(void)
initialized = false;
}
+
+
+bool GPU_is_initialized(void)
+{
+ return initialized;
+}