1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
/*
* Copyright 2016, Blender Foundation.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Contributor(s): Blender Institute
*
*/
/** \file workbench_private.h
* \ingroup draw_engine
*/
#ifndef __WORKBENCH_PRIVATE_H__
#define __WORKBENCH_PRIVATE_H__
#include "DRW_render.h"
#define WORKBENCH_ENGINE "BLENDER_WORKBENCH"
typedef struct WORKBENCH_StorageList {
struct WORKBENCH_PrivateData *g_data;
} WORKBENCH_StorageList;
typedef struct WORKBENCH_PassList {
struct DRWPass *depth_pass;
struct DRWPass *solid_pass;
} WORKBENCH_PassList;
typedef struct WORKBENCH_Data {
void *engine_type;
DRWViewportEmptyList *fbl;
DRWViewportEmptyList *txl;
WORKBENCH_PassList *psl;
WORKBENCH_StorageList *stl;
} WORKBENCH_Data;
typedef struct WORKBENCH_PrivateData {
DRWShadingGroup *depth_shgrp;
DRWShadingGroup *shadeless_shgrp;
struct GHash *material_hash;
} WORKBENCH_PrivateData; /* Transient data */
typedef struct WORKBENCH_MaterialData {
/* Solid color */
float color[3];
/* Linked shgroup for drawing */
DRWShadingGroup * shgrp;
} WORKBENCH_MaterialData;
/* workbench_engine.c */
void workbench_solid_materials_init(void);
void workbench_solid_materials_cache_init(WORKBENCH_Data* vedata);
void workbench_solid_materials_cache_populate(WORKBENCH_Data* vedata, Object* ob);
void workbench_solid_materials_cache_finish(WORKBENCH_Data* vedata);
void workbench_solid_materials_draw_scene(WORKBENCH_Data* vedata);
void workbench_solid_materials_free(void);
/* workbench_materials.c */
void workbench_materials_engine_init(void);
void workbench_materials_engine_finish(void);
void workbench_materials_cache_init(WORKBENCH_Data *vedata);
WORKBENCH_MaterialData* workbench_get_or_create_solid_flat_material_data(WORKBENCH_Data *vedata, const float color[3]);
WORKBENCH_MaterialData* workbench_get_or_create_solid_studio_material_data(WORKBENCH_Data *vedata, const float color[3]);
void workbench_materials_cache_finish(WORKBENCH_Data *vedata);
#endif
|