FreeWRL / FreeX3D 4.3.0
dllFreeWRL.h
1// The following ifdef block is the standard way of creating macros which make exporting
2// from a DLL simpler. All files within this DLL are compiled with the DLLFREEWRL_EXPORTS
3// symbol defined on the command line. this symbol should not be defined on any project
4// that uses this DLL. This way any other project whose source files include this file see
5// DLLFREEWRL_API functions as being imported from a DLL, whereas this DLL sees symbols
6// defined with this macro as being exported.
7#ifdef _MSC_VER
8#ifdef DLLFREEWRL_EXPORTS
9#define DLLFREEWRL_API __declspec(dllexport)
10#else
11#define DLLFREEWRL_API __declspec(dllimport)
12#endif
13#else
14#define DLLFREEWRL_API
15#endif
16
17// This class is exported from the dllFreeWRL.dll
18class DLLFREEWRL_API CdllFreeWRL {
19public:
20 CdllFreeWRL();
21 CdllFreeWRL(int width, int height, void* windowhandle=0, bool bEai = false);
22 CdllFreeWRL(char *scene_url, int width, int height, void* windowhandle=0, bool bEai = false);
23 // TODO: add your methods here.
24 enum KeyAction {KEYDOWN=2,KEYUP=3,KEYPRESS=1};
25 //#define KeyChar 1 //KeyPress
26 //#define KeyPress 2 //KeyDown
27 //#define KeyRelease 3 //KeyUp
28
29 enum MouseAction {MOUSEMOVE=6,MOUSEDOWN=4,MOUSEUP=5};
30 // mev = ButtonPress; //4 down
31 // mev = ButtonRelease; //3 up
32 // mev = MotionNotify; //6 move
33 enum MouseButton {LEFT=1,MIDDLE=2,RIGHT=3,NONE=0};
34 /* butnum=1 left butnum=3 right (butnum=2 middle, not used by freewrl) */
35
36 enum resource_status {
37 ress_none, /* never processed */
38 ress_starts_good, /* path/url identification succeeded */
39 ress_invalid, /* path/url identification failed */
40 ress_downloaded, /* download succeeded (or local file available) */
41 ress_failed, /* download failed */
42 ress_loaded, /* loader succeeded */
43 ress_not_loaded, /* loader failed */
44 ress_parsed, /* parser succeeded */
45 ress_not_parsed /* parser failed */
46 };
47 enum resource_media_type {
48 resm_unknown,
49 resm_vrml,
50 resm_x3d,
51 resm_image,
52 resm_movie,
53 resm_script,
54 resm_pshader,
55 resm_fshader,
56 resm_audio,
57 resm_x3z,
58 resm_mocap,
59 resm_gltf,
60 resm_glb,
61 resm_bin,
62 resm_json,
63 resm_b3dm,
64 resm_i3dm,
65 resm_pnts,
66 resm_cmpt,
67 resm_external, //June 2016 html > frontend anchoring
68 };
69
70 void setDensityFactor(float density_factor);
71 void onInit(int width, int height, void* windowhandle=0, bool bEai = false, bool frontend_handles_display_thread = false);
72 void onInitArgv(int argc, char **argv, bool frontend_handles_display_thread);
73 void onLoad(char* scene_url);
74 void onResize(int width, int height);
75 int onMouse(int mouseAction,int mouseButton,int x, int y);
76 int onTouch(int touchAction, unsigned int ID, int x, int y);
77 void onGyro(float rx, float ry, float rz);
78 void onAccelerometer(float ax, float ay, float az);
79 void onMagnetic(float azimuth, float pitch, float roll);
80 void onKey(int keyAction,int keyValue);
81 void onDraw(); //use when FRONTEND_HANDLES_DISPLAY_THREAD
82 void onClose();
83 void print(char *str);
84 void setTempFolder(char *tmpFolder);
85 void setFontFolder(char *fontFolder);
86 int getUpdatedCursorStyle();
87 void* frontenditem_dequeue();
88 char* resitem_getURL(void *res);
89 int resitem_getStatus(void *res);
90 void resitem_setStatus(void *res, int status);
91 int resitem_getType(void *res);
92 int resitem_getMediaType(void *res);
93 void resitem_enqueuNextMulti(void *res);
94 void resitem_setLocalPath(void *res, char* path);
95 void resitem_enqueue(void *res);
96 void resitem_load(void *res);
97 void commandline(char *cmdline);
98
99private:
100 void *globalcontexthandle;
101};
102