Blender  V2.93
gpu_init_exit.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2013 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #include "GPU_init_exit.h" /* interface */
25 #include "BKE_global.h"
26 #include "BLI_sys_types.h"
27 #include "GPU_batch.h"
28 #include "GPU_buffers.h"
29 #include "GPU_context.h"
30 #include "GPU_immediate.h"
31 
32 #include "intern/gpu_codegen.h"
34 #include "intern/gpu_private.h"
35 
41 static bool initialized = false;
42 
43 void GPU_init(void)
44 {
45  /* can't avoid calling this multiple times, see wm_window_ghostwindow_add */
46  if (initialized) {
47  return;
48  }
49 
50  initialized = true;
51 
54 
56 
57 #ifndef GPU_STANDALONE
58  gpu_pbvh_init();
59 #endif
60 }
61 
62 void GPU_exit(void)
63 {
64 #ifndef GPU_STANDALONE
65  gpu_pbvh_exit();
66 #endif
67 
69 
72 
73  initialized = false;
74 }
75 
76 bool GPU_is_init(void)
77 {
78  return initialized;
79 }
void gpu_batch_init(void)
Definition: gpu_batch.cc:318
void gpu_batch_exit(void)
Definition: gpu_batch.cc:323
void gpu_pbvh_exit()
Definition: gpu_buffers.c:130
void gpu_pbvh_init()
Definition: gpu_buffers.c:112
void gpu_codegen_init(void)
Definition: gpu_codegen.c:1116
void gpu_codegen_exit(void)
Definition: gpu_codegen.c:1120
bool GPU_is_init(void)
Definition: gpu_init_exit.c:76
void GPU_init(void)
Definition: gpu_init_exit.c:43
static bool initialized
Definition: gpu_init_exit.c:41
void GPU_exit(void)
Definition: gpu_init_exit.c:62
void gpu_material_library_exit(void)
void gpu_material_library_init(void)