diff options
Diffstat (limited to '')
-rw-r--r-- | src/extantz/extantz.h | 79 |
1 files changed, 53 insertions, 26 deletions
diff --git a/src/extantz/extantz.h b/src/extantz/extantz.h index 6e0e03e..c475fa8 100644 --- a/src/extantz/extantz.h +++ b/src/extantz/extantz.h | |||
@@ -1,9 +1,6 @@ | |||
1 | #define USE_EO 0 | ||
2 | #define USE_PHYSICS 1 | 1 | #define USE_PHYSICS 1 |
3 | #define USE_EGL 1 // If using Evas_GL, though it might be via Elm. | 2 | #define USE_IRR 1 |
4 | #define USE_ELM_GL 1 | 3 | #define USE_DEMO 1 |
5 | #define USE_IRR 0 | ||
6 | #define USE_DEMO 0 | ||
7 | #define DO_GEARS 0 | 4 | #define DO_GEARS 0 |
8 | 5 | ||
9 | 6 | ||
@@ -60,16 +57,6 @@ typedef struct ICameraSceneNode ICameraSceneNode; | |||
60 | #endif | 57 | #endif |
61 | 58 | ||
62 | 59 | ||
63 | typedef struct _globals | ||
64 | { | ||
65 | Evas *evas; | ||
66 | Evas_Object *win; // Our Elm window. | ||
67 | Eina_Clist widgets; // Our windows widgets. | ||
68 | int logDom; // Our logging domain. | ||
69 | } globals; | ||
70 | |||
71 | extern globals ourGlobals; | ||
72 | |||
73 | 60 | ||
74 | typedef struct _Gear Gear; | 61 | typedef struct _Gear Gear; |
75 | typedef struct _GLData GLData; | 62 | typedef struct _GLData GLData; |
@@ -141,20 +128,46 @@ struct _Gear | |||
141 | int count; | 128 | int count; |
142 | }; | 129 | }; |
143 | 130 | ||
131 | typedef struct _Scene_Data | ||
132 | { | ||
133 | Evas_Object *image; // Our Elm image. | ||
134 | Evas_3D_Scene *scene; | ||
135 | Evas_3D_Node *root_node; | ||
136 | Evas_3D_Node *camera_node; | ||
137 | Evas_3D_Node *light_node; | ||
138 | |||
139 | Evas_3D_Camera *camera; | ||
140 | Evas_3D_Light *light; | ||
141 | |||
142 | Evas_3D_Mesh *mesh; | ||
143 | Evas_3D_Node *mesh_node; | ||
144 | Evas_3D_Material *material0; | ||
145 | Evas_3D_Material *material1; | ||
146 | Evas_3D_Texture *texture0; | ||
147 | Evas_3D_Texture *texture1; | ||
148 | Evas_3D_Texture *texture_normal; | ||
149 | |||
150 | Evas_3D_Mesh *mesh2; | ||
151 | Evas_3D_Node *mesh2_node; | ||
152 | Evas_3D_Material *material2; | ||
153 | Evas_3D_Texture *texture2; | ||
154 | |||
155 | Evas_3D_Mesh *mesh3; | ||
156 | Evas_3D_Node *mesh3_node; | ||
157 | Evas_3D_Material *material3; | ||
158 | Evas_3D_Texture *texture_diffuse; | ||
159 | |||
160 | } Scene_Data; | ||
161 | |||
144 | // GL related data here. | 162 | // GL related data here. |
145 | struct _GLData | 163 | struct _GLData |
146 | { | 164 | { |
147 | Evas_Object *win, *winwin; | 165 | Evas_Object *win, *winwin; |
148 | 166 | ||
149 | Ecore_Evas *ee; | 167 | Ecore_Evas *ee; |
150 | Evas *canvas; | 168 | Evas *canvas; |
151 | Evas_Native_Surface ns; | ||
152 | 169 | ||
153 | Evas_GL_Context *ctx; | 170 | Evas_Object *elmGl; |
154 | Evas_GL_Surface *sfc; | ||
155 | Evas_GL_Config *cfg; | ||
156 | Evas_GL *evasGl; // The Evas way. | ||
157 | Evas_Object *elmGl; // The Elm way. | ||
158 | Evas_GL_API *glApi; | 171 | Evas_GL_API *glApi; |
159 | 172 | ||
160 | GLuint program; | 173 | GLuint program; |
@@ -164,14 +177,13 @@ struct _GLData | |||
164 | int win_w, win_h; // The size of the window. | 177 | int win_w, win_h; // The size of the window. |
165 | int win_x, win_y; // The position of the window. | 178 | int win_x, win_y; // The position of the window. |
166 | int sfc_w, sfc_h; // This is what Irrlicht is using, size of the GL image surface / glview. | 179 | int sfc_w, sfc_h; // This is what Irrlicht is using, size of the GL image surface / glview. |
167 | int img_w, img_h; // Size of the viewport. DON'T reuse sfc_* here. Despite the fach that sfc_* is only used in the init when Irricht is disabled? WTF? | 180 | int img_w, img_h; // Size of the viewport. DON'T reuse sfc_* here. Despite the fact that sfc_* is only used in the init when Irricht is disabled? WTF? |
168 | int useEGL : 1; | ||
169 | int useIrr : 1; | 181 | int useIrr : 1; |
170 | int doneIrr : 1; | 182 | int doneIrr : 1; |
171 | int gearsInited : 1; | 183 | int gearsInited : 1; |
172 | int resized : 1; | 184 | int resized : 1; |
173 | 185 | ||
174 | Evas_Object *bx, *r1; | 186 | Evas_Object *bx;//, *r1; |
175 | Ecore_Animator *animator; | 187 | Ecore_Animator *animator; |
176 | 188 | ||
177 | IrrlichtDevice *device; | 189 | IrrlichtDevice *device; |
@@ -200,6 +212,19 @@ struct _GLData | |||
200 | GLfloat light[3]; | 212 | GLfloat light[3]; |
201 | }; | 213 | }; |
202 | 214 | ||
215 | typedef struct _globals | ||
216 | { | ||
217 | Evas *evas; | ||
218 | Evas_Object *win; // Our Elm window. | ||
219 | Eina_Clist widgets; // Our windows widgets. | ||
220 | int logDom; // Our logging domain. | ||
221 | |||
222 | struct _GLData gld; | ||
223 | Scene_Data *scene; | ||
224 | } globals; | ||
225 | |||
226 | extern globals ourGlobals; | ||
227 | |||
203 | 228 | ||
204 | void gears_init(GLData *gld); | 229 | void gears_init(GLData *gld); |
205 | void drawGears(GLData *gld); | 230 | void drawGears(GLData *gld); |
@@ -213,6 +238,8 @@ EAPI void drawIrr_end(GLData *gld); | |||
213 | EAPI void finishIrr(GLData *gld); | 238 | EAPI void finishIrr(GLData *gld); |
214 | 239 | ||
215 | EAPI void Evas_3D_Demo_add(globals *ourGlobals); | 240 | EAPI void Evas_3D_Demo_add(globals *ourGlobals); |
241 | Eina_Bool _animate_scene(void *data); | ||
242 | void Evas_3D_Demo_fini(void); | ||
216 | 243 | ||
217 | Evas_Object *fang_win_add(GLData *gld); | 244 | Evas_Object *fang_win_add(GLData *gld); |
218 | void fang_win_complete(GLData *gld, Evas_Object *win, int x, int y, int w, int h); | 245 | void fang_win_complete(GLData *gld, Evas_Object *win, int x, int y, int w, int h); |