2
* ***** BEGIN GPL LICENSE BLOCK *****
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
* The Original Code is Copyright (C) 2006 Blender Foundation.
19
* All rights reserved.
21
* The Original Code is: all of this file.
23
* Contributor(s): none yet.
25
* ***** END GPL LICENSE BLOCK *****
32
#ifndef __RE_ENGINE_H__
33
#define __RE_ENGINE_H__
35
#include "DNA_listBase.h"
36
#include "RNA_types.h"
41
struct RenderEngineType;
49
/* RenderEngineType.flag */
52
#define RE_USE_PREVIEW 4
53
#define RE_USE_POSTPROCESS 8
54
#define RE_USE_SHADING_NODES 16
56
/* RenderEngine.flag */
57
#define RE_ENGINE_ANIMATION 1
58
#define RE_ENGINE_PREVIEW 2
59
#define RE_ENGINE_DO_DRAW 4
60
#define RE_ENGINE_DO_UPDATE 8
62
extern ListBase R_engines;
64
typedef struct RenderEngineType {
65
struct RenderEngineType *next, *prev;
68
char idname[64]; // best keep the same size as BKE_ST_MAXNAME
72
void (*update)(struct RenderEngine *engine, struct Main *bmain, struct Scene *scene);
73
void (*render)(struct RenderEngine *engine, struct Scene *scene);
75
void (*view_update)(struct RenderEngine *engine, const struct bContext *context);
76
void (*view_draw)(struct RenderEngine *engine, const struct bContext *context);
82
typedef struct RenderEngine {
83
RenderEngineType *type;
87
struct Object *camera_override;
94
RenderEngine *RE_engine_create(RenderEngineType *type);
95
void RE_engine_free(RenderEngine *engine);
97
void RE_layer_load_from_file(struct RenderLayer *layer, struct ReportList *reports, const char *filename, int x, int y);
98
void RE_result_load_from_file(struct RenderResult *result, struct ReportList *reports, const char *filename);
100
struct RenderResult *RE_engine_begin_result(RenderEngine *engine, int x, int y, int w, int h);
101
void RE_engine_update_result(RenderEngine *engine, struct RenderResult *result);
102
void RE_engine_end_result(RenderEngine *engine, struct RenderResult *result);
104
int RE_engine_test_break(RenderEngine *engine);
105
void RE_engine_update_stats(RenderEngine *engine, const char *stats, const char *info);
106
void RE_engine_update_progress(RenderEngine *engine, float progress);
107
void RE_engine_report(RenderEngine *engine, int type, const char *msg);
109
int RE_engine_render(struct Render *re, int do_all);
111
int RE_engine_is_external(struct Render *re);
115
void RE_engines_init(void);
116
void RE_engines_exit(void);
118
RenderEngineType *RE_engines_find(const char *idname);
120
#endif /* __RE_ENGINE_H__ */