diff options
author | David Walter Seikel | 2014-04-22 15:13:38 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-04-22 15:13:38 +1000 |
commit | dd009ccdfd62f9153dbc72f5f5de5d5f72979690 (patch) | |
tree | 50d62438c6d47dccf82f440986919b1ed3edbbd9 /ClientHamr/extantz/extantz.h | |
parent | Move most of the README's and other docs into the new docs directory. (diff) | |
download | SledjHamr-dd009ccdfd62f9153dbc72f5f5de5d5f72979690.zip SledjHamr-dd009ccdfd62f9153dbc72f5f5de5d5f72979690.tar.gz SledjHamr-dd009ccdfd62f9153dbc72f5f5de5d5f72979690.tar.bz2 SledjHamr-dd009ccdfd62f9153dbc72f5f5de5d5f72979690.tar.xz |
Move all source into the new src directory, and shuffle a few other things around.
Diffstat (limited to 'ClientHamr/extantz/extantz.h')
-rw-r--r-- | ClientHamr/extantz/extantz.h | 215 |
1 files changed, 0 insertions, 215 deletions
diff --git a/ClientHamr/extantz/extantz.h b/ClientHamr/extantz/extantz.h deleted file mode 100644 index afb94af..0000000 --- a/ClientHamr/extantz/extantz.h +++ /dev/null | |||
@@ -1,215 +0,0 @@ | |||
1 | #define USE_EO 0 | ||
2 | #define USE_PHYSICS 1 | ||
3 | #define USE_EGL 1 // If using Evas_GL, though it might be via Elm. | ||
4 | #define USE_ELM_GL 1 | ||
5 | #define USE_IRR 1 | ||
6 | #define USE_DEMO 1 | ||
7 | #define DO_GEARS 0 | ||
8 | |||
9 | #if USE_EO | ||
10 | /* Enable access to unstable EFL API that are still in beta */ | ||
11 | #define EFL_BETA_API_SUPPORT 1 | ||
12 | /* Enable access to unstable EFL EO API. */ | ||
13 | #define EFL_EO_API_SUPPORT 1 | ||
14 | #endif | ||
15 | |||
16 | #include <Elementary.h> | ||
17 | #include <elm_widget_glview.h> | ||
18 | #include <Evas_GL.h> | ||
19 | #include <EPhysics.h> | ||
20 | #include "extantzCamera.h" | ||
21 | |||
22 | |||
23 | #ifdef GL_GLES | ||
24 | #include <EGL/egl.h> | ||
25 | #include <EGL/eglext.h> | ||
26 | #else | ||
27 | # include <GL/glext.h> | ||
28 | # include <GL/glx.h> | ||
29 | #endif | ||
30 | |||
31 | |||
32 | #ifdef __cplusplus | ||
33 | /* | ||
34 | In the Irrlicht Engine, everything can be found in the namespace 'irr'. So if | ||
35 | you want to use a class of the engine, you have to write irr:: before the name | ||
36 | of the class. For example to use the IrrlichtDevice write: irr::IrrlichtDevice. | ||
37 | To get rid of the irr:: in front of the name of every class, we tell the | ||
38 | compiler that we use that namespace from now on, and we will not have to write | ||
39 | irr:: anymore. | ||
40 | */ | ||
41 | using namespace irr; | ||
42 | |||
43 | /* | ||
44 | There are 5 sub namespaces in the Irrlicht Engine. Take a look at them, you can | ||
45 | read a detailed description of them in the documentation by clicking on the top | ||
46 | menu item 'Namespace List' or by using this link: | ||
47 | http://irrlicht.sourceforge.net/docu/namespaces.html | ||
48 | Like the irr namespace, we do not want these 5 sub namespaces now, to keep this | ||
49 | example simple. Hence, we tell the compiler again that we do not want always to | ||
50 | write their names. | ||
51 | */ | ||
52 | using namespace core; | ||
53 | using namespace scene; | ||
54 | using namespace video; | ||
55 | |||
56 | extern "C"{ | ||
57 | #else | ||
58 | |||
59 | // Irrlicht stuff. It's C++, so we gotta use incomplete types. | ||
60 | typedef struct IrrlichtDevice IrrlichtDevice; | ||
61 | typedef struct IVideoDriver IVideoDriver; | ||
62 | typedef struct ISceneManager ISceneManager; | ||
63 | typedef struct ICameraSceneNode ICameraSceneNode; | ||
64 | |||
65 | #endif | ||
66 | |||
67 | |||
68 | #define CRI(...) EINA_LOG_DOM_CRIT(_log_domain, _VA_ARGS__) | ||
69 | #define ERR(...) EINA_LOG_DOM_ERR(_log_domain, __VA_ARGS__) | ||
70 | #define WRN(...) EINA_LOG_DOM_WARN(_log_domain, __VA_ARGS__) | ||
71 | #define INF(...) EINA_LOG_DOM_INFO(_log_domain, __VA_ARGS__) | ||
72 | #define DBG(...) EINA_LOG_DOM_DBG(_log_domain, __VA_ARGS__) | ||
73 | |||
74 | extern int _log_domain; | ||
75 | |||
76 | |||
77 | typedef struct _Gear Gear; | ||
78 | typedef struct _GLData GLData; | ||
79 | |||
80 | typedef enum | ||
81 | { | ||
82 | EZP_NONE, | ||
83 | EZP_AURORA, | ||
84 | EZP_OPENSIM, | ||
85 | EZP_SECOND_LIFE, | ||
86 | EZP_SLEDJHAMR, | ||
87 | EZP_TRITIUM | ||
88 | } ezPlatform; | ||
89 | |||
90 | typedef struct | ||
91 | { | ||
92 | char *name; | ||
93 | char *version; // Version string. | ||
94 | char *path; // OS filesystem path to the viewer install. | ||
95 | char *icon; | ||
96 | uint16_t tag; // The UUID of the texture used in the avatar bake hack. | ||
97 | uint8_t r, g, b; // Colour used for the in world tag. | ||
98 | Elm_Object_Item *item; | ||
99 | } ezViewer; | ||
100 | |||
101 | typedef struct | ||
102 | { | ||
103 | Eina_Clist accounts; | ||
104 | Eina_Clist landmarks; | ||
105 | char *name; | ||
106 | char *loginURI; | ||
107 | char *splashPage; | ||
108 | char *helperURI; | ||
109 | char *website; | ||
110 | char *supportPage; | ||
111 | char *registerPage; | ||
112 | char *passwordPage; | ||
113 | char *icon; | ||
114 | ezPlatform platform; | ||
115 | ezViewer *viewer; | ||
116 | Elm_Object_Item *item; | ||
117 | GLData *gld; // Just a temporary evil hack to pass gld to _grid_sel_cb(). | ||
118 | } ezGrid; | ||
119 | |||
120 | typedef struct | ||
121 | { | ||
122 | Eina_Clist grid; | ||
123 | char *name; | ||
124 | char *password; // Think we need to pass unencrypted passwords to the viewer. B-( | ||
125 | char *icon; | ||
126 | ezViewer *viewer; | ||
127 | } ezAccount; | ||
128 | |||
129 | typedef struct | ||
130 | { | ||
131 | Eina_Clist grid; | ||
132 | char *name; | ||
133 | char *sim; | ||
134 | char *screenshot; | ||
135 | short x, y, z; | ||
136 | } ezLandmark; | ||
137 | |||
138 | |||
139 | |||
140 | struct _Gear | ||
141 | { | ||
142 | GLfloat *vertices; | ||
143 | GLuint vbo; | ||
144 | int count; | ||
145 | }; | ||
146 | |||
147 | // GL related data here. | ||
148 | struct _GLData | ||
149 | { | ||
150 | Evas_Object *win, *winwin; | ||
151 | |||
152 | Ecore_Evas *ee; | ||
153 | Evas *canvas; | ||
154 | Evas_Native_Surface ns; | ||
155 | |||
156 | Evas_GL_Context *ctx; | ||
157 | Evas_GL_Surface *sfc; | ||
158 | Evas_GL_Config *cfg; | ||
159 | Evas_GL *evasGl; // The Evas way. | ||
160 | Evas_Object *elmGl; // The Elm way. | ||
161 | Evas_GL_API *glApi; | ||
162 | |||
163 | GLuint program; | ||
164 | GLuint vtx_shader; | ||
165 | GLuint fgmt_shader; | ||
166 | int scr_w, scr_h; // The size of the screen. | ||
167 | int win_w, win_h; // The size of the window. | ||
168 | int win_x, win_y; // The position of the window. | ||
169 | int sfc_w, sfc_h; // This is what Irrlicht is using, size of the GL image surface / glview. | ||
170 | 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? | ||
171 | int useEGL : 1; | ||
172 | int useIrr : 1; | ||
173 | int doneIrr : 1; | ||
174 | int gearsInited : 1; | ||
175 | int resized : 1; | ||
176 | |||
177 | Evas_Object *bx, *r1; | ||
178 | Ecore_Animator *animator; | ||
179 | |||
180 | IrrlichtDevice *device; | ||
181 | IVideoDriver *driver; | ||
182 | ISceneManager *smgr; | ||
183 | ICameraSceneNode *camera; | ||
184 | |||
185 | cameraMove *move; | ||
186 | |||
187 | // Gear Stuff | ||
188 | GLfloat view_rotx; | ||
189 | GLfloat view_roty; | ||
190 | GLfloat view_rotz; | ||
191 | |||
192 | Gear *gear1; | ||
193 | Gear *gear2; | ||
194 | Gear *gear3; | ||
195 | |||
196 | GLfloat angle; | ||
197 | |||
198 | GLuint proj_location; | ||
199 | GLuint light_location; | ||
200 | GLuint color_location; | ||
201 | |||
202 | GLfloat proj[16]; | ||
203 | GLfloat light[3]; | ||
204 | }; | ||
205 | |||
206 | |||
207 | EAPI int startIrr(GLData *gld); | ||
208 | EAPI void drawIrr_start(GLData *gld); | ||
209 | EAPI void drawIrr_end(GLData *gld); | ||
210 | EAPI void finishIrr(GLData *gld); | ||
211 | |||
212 | #ifdef __cplusplus | ||
213 | } | ||
214 | #endif | ||
215 | |||