FreeWRL/FreeX3D  3.0.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
18 class DLLFREEWRL_API CdllFreeWRL {
19 public:
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_external, //June 2016 html > frontend anchoring
59  };
60 
61  void setDensityFactor(float density_factor);
62  void onInit(int width, int height, void* windowhandle=0, bool bEai = false, bool frontend_handles_display_thread = false);
63  void onLoad(char* scene_url);
64  void onResize(int width, int height);
65  int onMouse(int mouseAction,int mouseButton,int x, int y);
66  int onTouch(int touchAction, unsigned int ID, int x, int y);
67  void onGyro(float rx, float ry, float rz);
68  void onAccelerometer(float ax, float ay, float az);
69  void onMagnetic(float azimuth, float pitch, float roll);
70  void onKey(int keyAction,int keyValue);
71  void onDraw(); //use when FRONTEND_HANDLES_DISPLAY_THREAD
72  void onClose();
73  void print(char *str);
74  void setTempFolder(char *tmpFolder);
75  void setFontFolder(char *fontFolder);
76  int getUpdatedCursorStyle();
77  void* frontenditem_dequeue();
78  char* resitem_getURL(void *res);
79  int resitem_getStatus(void *res);
80  void resitem_setStatus(void *res, int status);
81  int resitem_getType(void *res);
82  int resitem_getMediaType(void *res);
83  void resitem_enqueuNextMulti(void *res);
84  void resitem_setLocalPath(void *res, char* path);
85  void resitem_enqueue(void *res);
86  void resitem_load(void *res);
87  void commandline(char *cmdline);
88 
89 private:
90  void *globalcontexthandle;
91 };
92