diff options
Diffstat (limited to '')
-rw-r--r-- | ClientHamr/extantz/extantz.h | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/ClientHamr/extantz/extantz.h b/ClientHamr/extantz/extantz.h new file mode 100644 index 0000000..fdcb6b5 --- /dev/null +++ b/ClientHamr/extantz/extantz.h | |||
@@ -0,0 +1,155 @@ | |||
1 | #include <Elementary.h> | ||
2 | #include <elm_widget_glview.h> | ||
3 | #include <Evas_GL.h> | ||
4 | #include <EPhysics.h> | ||
5 | |||
6 | |||
7 | #ifdef GL_GLES | ||
8 | #include <EGL/egl.h> | ||
9 | #include <EGL/eglext.h> | ||
10 | #else | ||
11 | # include <GL/glext.h> | ||
12 | # include <GL/glx.h> | ||
13 | #endif | ||
14 | |||
15 | |||
16 | #ifdef __cplusplus | ||
17 | extern "C"{ | ||
18 | #else | ||
19 | |||
20 | // Irrlicht stuff. It's C++, so we gotta use incomplete types. | ||
21 | typedef struct IrrlichtDevice IrrlichtDevice; | ||
22 | typedef struct IVideoDriver IVideoDriver; | ||
23 | typedef struct ISceneManager ISceneManager; | ||
24 | |||
25 | #endif | ||
26 | |||
27 | |||
28 | #define USE_PHYSICS 1 | ||
29 | #define USE_EGL 1 | ||
30 | #define USE_IRR 1 | ||
31 | |||
32 | |||
33 | typedef enum | ||
34 | { | ||
35 | EZP_NONE, | ||
36 | EZP_AURORA, | ||
37 | EZP_OPENSIM, | ||
38 | EZP_SECOND_LIFE, | ||
39 | EZP_SLEDJHAMR, | ||
40 | EZP_TRITIUM | ||
41 | } ezPlatform; | ||
42 | |||
43 | typedef struct | ||
44 | { | ||
45 | char *name; | ||
46 | char *version; // Version string. | ||
47 | char *path; // OS filesystem path to the viewer install. | ||
48 | char *icon; | ||
49 | uint16_t tag; // The UUID of the texture used in the avatar bake hack. | ||
50 | uint8_t r, g, b; // Colour used for the in world tag. | ||
51 | } ezViewer; | ||
52 | |||
53 | typedef struct | ||
54 | { | ||
55 | Eina_Clist accounts; | ||
56 | Eina_Clist landmarks; | ||
57 | char *name; | ||
58 | char *loginURI; | ||
59 | char *splashPage; | ||
60 | char *helperURI; | ||
61 | char *website; | ||
62 | char *supportPage; | ||
63 | char *registerPage; | ||
64 | char *passwordPage; | ||
65 | char *icon; | ||
66 | ezPlatform platform; | ||
67 | ezViewer *viewer; | ||
68 | Elm_Object_Item *item; | ||
69 | } ezGrid; | ||
70 | |||
71 | typedef struct | ||
72 | { | ||
73 | Eina_Clist grid; | ||
74 | char *name; | ||
75 | char *password; // Think we need to pass unencrypted passwords to the viewer. B-( | ||
76 | char *icon; | ||
77 | ezViewer *viewer; | ||
78 | } ezAccount; | ||
79 | |||
80 | typedef struct | ||
81 | { | ||
82 | Eina_Clist grid; | ||
83 | char *name; | ||
84 | char *sim; | ||
85 | char *screenshot; | ||
86 | short x, y, z; | ||
87 | } ezLandmark; | ||
88 | |||
89 | |||
90 | typedef struct _Gear Gear; | ||
91 | typedef struct _GLData GLData; | ||
92 | |||
93 | |||
94 | struct _Gear | ||
95 | { | ||
96 | GLfloat *vertices; | ||
97 | GLuint vbo; | ||
98 | int count; | ||
99 | }; | ||
100 | |||
101 | // GL related data here. | ||
102 | struct _GLData | ||
103 | { | ||
104 | Evas_Object *win; | ||
105 | |||
106 | Evas_GL_Context *ctx; | ||
107 | Evas_GL_Surface *sfc; | ||
108 | Evas_GL_Config *cfg; | ||
109 | Evas_GL *evasgl; | ||
110 | Evas_GL_API *glapi; | ||
111 | |||
112 | GLuint program; | ||
113 | GLuint vtx_shader; | ||
114 | GLuint fgmt_shader; | ||
115 | int sfc_w, sfc_h; | ||
116 | int useEGL : 1; | ||
117 | int useIrr : 1; | ||
118 | int doneIrr : 1; | ||
119 | |||
120 | Evas_Object *bx, *r1; | ||
121 | Ecore_Animator *animator; | ||
122 | |||
123 | IrrlichtDevice *device; // IrrlichtDevice | ||
124 | IVideoDriver *driver; // IVideoDriver | ||
125 | ISceneManager *smgr; // ISceneManager | ||
126 | |||
127 | // Gear Stuff | ||
128 | GLfloat view_rotx; | ||
129 | GLfloat view_roty; | ||
130 | GLfloat view_rotz; | ||
131 | |||
132 | Gear *gear1; | ||
133 | Gear *gear2; | ||
134 | Gear *gear3; | ||
135 | |||
136 | GLfloat angle; | ||
137 | |||
138 | GLuint proj_location; | ||
139 | GLuint light_location; | ||
140 | GLuint color_location; | ||
141 | |||
142 | GLfloat proj[16]; | ||
143 | GLfloat light[3]; | ||
144 | }; | ||
145 | |||
146 | |||
147 | EAPI int startIrr(GLData *gld); | ||
148 | EAPI void drawIrr_start(GLData *gld); | ||
149 | EAPI void drawIrr_end(GLData *gld); | ||
150 | EAPI void finishIrr(GLData *gld); | ||
151 | |||
152 | #ifdef __cplusplus | ||
153 | } | ||
154 | #endif | ||
155 | |||