Blender  V2.93
wm_surface.h
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 
25 #pragma once
26 
27 struct bContext;
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 typedef struct wmSurface {
34  struct wmSurface *next, *prev;
35 
36  GHOST_ContextHandle ghost_ctx;
38 
39  void *customdata;
40 
41  void (*draw)(struct bContext *);
43  void (*free_data)(struct wmSurface *);
44 
46  void (*activate)(void);
48  void (*deactivate)(void);
50 
51 /* Create/Free */
54 void wm_surfaces_free(void);
55 
56 /* Utils */
57 void wm_surfaces_iter(struct bContext *C, void (*cb)(struct bContext *, wmSurface *));
58 
59 /* Drawing */
61 void wm_surface_clear_drawable(void);
63 void wm_surface_reset_drawable(void);
64 
65 #ifdef __cplusplus
66 }
67 #endif
struct GPUContext GPUContext
Definition: GPU_context.h:44
#define C
Definition: RandGen.cpp:39
void activate(bool forceActivation=false) const
struct @203::@204 surface
void(* free_data)(struct wmSurface *)
Definition: wm_surface.h:43
void(* activate)(void)
Definition: wm_surface.h:46
GHOST_ContextHandle ghost_ctx
Definition: wm_surface.h:36
void * customdata
Definition: wm_surface.h:39
struct GPUContext * gpu_ctx
Definition: wm_surface.h:37
struct wmSurface * next
Definition: wm_surface.h:34
struct wmSurface * prev
Definition: wm_surface.h:34
void(* draw)(struct bContext *)
Definition: wm_surface.h:41
void(* deactivate)(void)
Definition: wm_surface.h:48
void wm_surface_set_drawable(wmSurface *surface, bool activate)
Definition: wm_surface.c:67
void wm_surface_clear_drawable(void)
Definition: wm_surface.c:53
void wm_surface_reset_drawable(void)
Definition: wm_surface.c:92
void wm_surface_add(wmSurface *surface)
Definition: wm_surface.c:103
void wm_surface_remove(wmSurface *surface)
Definition: wm_surface.c:108
void wm_surface_make_drawable(wmSurface *surface)
Definition: wm_surface.c:82
void wm_surfaces_free(void)
Definition: wm_surface.c:115
struct wmSurface wmSurface
void wm_surfaces_iter(struct bContext *C, void(*cb)(struct bContext *, wmSurface *))