2
* $Id: KXH_engine_data_wraps.h 26841 2010-02-12 13:34:04Z campbellbarton $
4
* ***** BEGIN GPL LICENSE BLOCK *****
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software Foundation,
18
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21
* All rights reserved.
23
* The Original Code is: all of this file.
25
* Contributor(s): none yet.
27
* ***** END GPL LICENSE BLOCK *****
28
* Data wraps for the engine.
31
#ifndef KXH_ENGINE_DATA_WRAPS_H
32
#define KXH_ENGINE_DATA_WRAPS_H
35
#include "PLG_plugin_handles.h"
38
/**********************************
39
* Begin Blender include block
40
**********************************/
45
#include "BLI_blenlib.h"
46
#include "BLO_readfile.h"
47
#include "DNA_scene_types.h"
48
#include "BKE_blender.h"
49
#include "BKE_report.h"
53
/**********************************
54
* End Blender include block
55
**********************************/
63
class KX_KetsjiEngine;
66
class RAS_IRasterizer;
67
class RAS_IRenderTools;
68
class GPC_KeyboardDevice;
69
class GPC_MouseDevice;
70
class NG_NetworkDeviceInterface;
71
class SND_IAudioDevice;
72
class KX_BlenderSceneConverter;
76
struct _thread_data_wrap;
81
KXH_SHOW_FG_COLOR, // 2
82
KXH_TEST_LOADING_FILE_TYPE, // 3
83
KXH_PLAY_LOADING_ANIM, // 4
84
KXH_TEST_MAIN_FILE, // 5
86
KXH_PLAY_MAIN_FILE, // 7
87
KXH_AWAITING_NEW_STREAM, // 8
88
KXH_GL_ERROR_STATE, // 9
94
enum KXH_MAIN_FILE_STATE {
95
KXH_MAIN_FILE_NO_STATE,
96
KXH_MAIN_FILE_IS_PUBLISHER_FILE,
97
KXH_MAIN_FILE_IS_NOT_PUBLISHER_FILE,
98
KXH_MAIN_FILE_CORRUPT,
99
KXH_MAIN_FILE_MAX_STATE
103
typedef struct _ketsji_engine_data {
105
/** Flag that terminates the plugin. */
108
/** Flag to raise a request for termination */
109
bool termination_request;
111
/** Reference to the plugin resources (gl and x contexts). */
112
PLA_plugin_handle plugin;
114
/** Reference for getting the references right. */
115
struct _thread_data_wrap* thread_data;
117
/** The active gameengine. */
118
KX_KetsjiEngine* kx_engine;
120
/** The engine's logic system. */
121
GPC_System* logic_system;
123
/** The canvas. We sometimes need to send resizes and such. */
124
GPC_Canvas* canvas_device;
126
/** The rasterizer */
127
RAS_IRasterizer* rasterizer;
129
/** The Rendertools */
130
RAS_IRenderTools* rendertools;
132
/** The keyboarddevice */
133
GPC_KeyboardDevice* keyboarddevice;
135
/** The mousedevice */
136
GPC_MouseDevice* mousedevice;
138
/** The network device */
139
NG_NetworkDeviceInterface* net_dev;
141
/** The audiodevice */
142
SND_IAudioDevice* audiodevice;
144
/** a blend-to-kx scene converter */
145
KX_BlenderSceneConverter* converter;
147
/** State of the gameengine. Refer to the spec to see the
148
* meaning of the names. */
151
/** Is the gameengine initialised? */
154
/** The target blend file */
155
struct BlendFileData *blendfile;
157
/** Did the main file retrieval fail for some reason? */
158
bool blendfile_failed;
160
/** The loading anim resource. */
161
struct BlendFileData *loading_anim;
162
/** Did the loading anim file retrieval fail for some reason? */
163
bool loading_anim_failed;
165
/** Placeholder for blender logo, if needed */
166
GPC_RawImage* blender_logo;
168
/** Placeholder for url blender logo, if needed */
169
GPC_RawImage* blender_url_logo;
171
/** Time in 10e-6 seconds to the next redraw request. */
174
/** Restart with new streaming url? */
175
bool replacing_url_requested;
177
bool new_url_requested;
179
} ketsji_engine_data;
182
typedef struct _thread_data_wrap {
183
/** Thread for the plugin. This is retained, so we can properly
184
cancel and join on termination. */
187
/** Handle to the game data, so we can send the terminate signal. */
188
ketsji_engine_data* ked;
190
/** Handle to the plugin, for resources. */
191
PLA_plugin_handle ph;