00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00041 #ifndef __DRAWSTUFF_H__
00042 #define __DRAWSTUFF_H__
00043
00044
00045 #if defined(ODE_PLATFORM_WINDOWS)
00046 #if defined(DS_DLL)
00047 #define DS_API __declspec(dllexport)
00048 #elif !defined(DS_LIB)
00049 #define DS_DLL_API __declspec(dllimport)
00050 #endif
00051 #endif
00052
00053 #if !defined(DS_API)
00054 #define DS_API
00055 #endif
00056
00057 #ifdef __cplusplus
00058 extern "C" {
00059 #endif
00060
00061
00062 #include <drawstuff/version.h>
00063
00064
00065
00066 enum DS_TEXTURE_NUMBER
00067 {
00068 DS_NONE = 0,
00069 DS_WOOD,
00070 DS_CHECKERED,
00071 DS_GROUND,
00072 DS_SKY,
00073 };
00074
00075
00076
00077 #define DS_POLYFILL 0
00078 #define DS_WIREFRAME 1
00079
00085 typedef struct dsFunctions {
00086 int version;
00087
00088 void (*start)();
00089 void (*step) (int pause);
00090 void (*command) (int cmd);
00091 void (*stop)();
00092
00093 const char *path_to_textures;
00094 } dsFunctions;
00095
00096
00105 DS_API void dsSimulationLoop (int argc, char **argv,
00106 int window_width, int window_height,
00107 struct dsFunctions *fn);
00108
00115 DS_API void dsError (const char *msg, ...);
00116
00123 DS_API void dsDebug (const char *msg, ...);
00124
00130 DS_API void dsPrint (const char *msg, ...);
00131
00140 DS_API void dsSetViewpoint (float xyz[3], float hpr[3]);
00141
00142
00149 DS_API void dsGetViewpoint (float xyz[3], float hpr[3]);
00150
00159 DS_API void dsStop();
00160
00166 DS_API double dsElapsedTime();
00167
00178 DS_API void dsSetTexture (int texture_number);
00179
00187 DS_API void dsSetColor (float red, float green, float blue);
00188
00195 DS_API void dsSetColorAlpha (float red, float green, float blue, float alpha);
00196
00207 DS_API void dsDrawBox (const float pos[3], const float R[12], const float sides[3]);
00208
00216 DS_API void dsDrawSphere (const float pos[3], const float R[12], float radius);
00217
00228 DS_API void dsDrawTriangle (const float pos[3], const float R[12],
00229 const float *v0, const float *v1, const float *v2, int solid);
00230
00235 DS_API void dsDrawCylinder (const float pos[3], const float R[12],
00236 float length, float radius);
00237
00242 DS_API void dsDrawCapsule (const float pos[3], const float R[12],
00243 float length, float radius);
00244
00249 DS_API void dsDrawLine (const float pos1[3], const float pos2[3]);
00250
00255 DS_API void dsDrawConvex(const float pos[3], const float R[12],
00256 float *_planes,
00257 unsigned int _planecount,
00258 float *_points,
00259 unsigned int _pointcount,
00260 unsigned int *_polygons);
00261
00262
00263
00264
00265 DS_API void dsDrawBoxD (const double pos[3], const double R[12],
00266 const double sides[3]);
00267 DS_API void dsDrawSphereD (const double pos[3], const double R[12],
00268 const float radius);
00269 DS_API void dsDrawTriangleD (const double pos[3], const double R[12],
00270 const double *v0, const double *v1, const double *v2, int solid);
00271 DS_API void dsDrawCylinderD (const double pos[3], const double R[12],
00272 float length, float radius);
00273 DS_API void dsDrawCapsuleD (const double pos[3], const double R[12],
00274 float length, float radius);
00275 DS_API void dsDrawLineD (const double pos1[3], const double pos2[3]);
00276 DS_API void dsDrawConvexD(const double pos[3], const double R[12],
00277 double *_planes,
00278 unsigned int _planecount,
00279 double *_points,
00280 unsigned int _pointcount,
00281 unsigned int *_polygons);
00282
00290 DS_API void dsSetSphereQuality (int n);
00291 DS_API void dsSetCapsuleQuality (int n);
00292
00298 DS_API void dsSetDrawMode(int mode);
00299
00300
00301 #define dsDrawCappedCylinder dsDrawCapsule
00302 #define dsDrawCappedCylinderD dsDrawCapsuleD
00303 #define dsSetCappedCylinderQuality dsSetCapsuleQuality
00304
00305
00306 #ifdef __cplusplus
00307 }
00308 #endif
00309
00310 #endif
00311