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 #define DS_NONE 0
00067 #define DS_WOOD 1
00068
00069
00075 typedef struct dsFunctions {
00076 int version;
00077
00078 void (*start)();
00079 void (*step) (int pause);
00080 void (*command) (int cmd);
00081 void (*stop)();
00082
00083 char *path_to_textures;
00084 } dsFunctions;
00085
00086
00095 DS_API void dsSimulationLoop (int argc, char **argv,
00096 int window_width, int window_height,
00097 struct dsFunctions *fn);
00098
00105 DS_API void dsError (char *msg, ...);
00106
00113 DS_API void dsDebug (char *msg, ...);
00114
00120 DS_API void dsPrint (char *msg, ...);
00121
00130 DS_API void dsSetViewpoint (float xyz[3], float hpr[3]);
00131
00132
00139 DS_API void dsGetViewpoint (float xyz[3], float hpr[3]);
00140
00149 DS_API void dsStop();
00150
00156 DS_API double dsElapsedTime();
00157
00168 DS_API void dsSetTexture (int texture_number);
00169
00177 DS_API void dsSetColor (float red, float green, float blue);
00178
00185 DS_API void dsSetColorAlpha (float red, float green, float blue, float alpha);
00186
00197 DS_API void dsDrawBox (const float pos[3], const float R[12], const float sides[3]);
00198
00206 DS_API void dsDrawSphere (const float pos[3], const float R[12], float radius);
00207
00218 DS_API void dsDrawTriangle (const float pos[3], const float R[12],
00219 const float *v0, const float *v1, const float *v2, int solid);
00220
00225 DS_API void dsDrawCylinder (const float pos[3], const float R[12],
00226 float length, float radius);
00227
00232 DS_API void dsDrawCapsule (const float pos[3], const float R[12],
00233 float length, float radius);
00234
00239 DS_API void dsDrawLine (const float pos1[3], const float pos2[3]);
00240
00245 DS_API void dsDrawConvex(const float pos[3], const float R[12],
00246 float *_planes,
00247 unsigned int _planecount,
00248 float *_points,
00249 unsigned int _pointcount,
00250 unsigned int *_polygons);
00251
00252
00253
00254
00255 DS_API void dsDrawBoxD (const double pos[3], const double R[12],
00256 const double sides[3]);
00257 DS_API void dsDrawSphereD (const double pos[3], const double R[12],
00258 const float radius);
00259 DS_API void dsDrawTriangleD (const double pos[3], const double R[12],
00260 const double *v0, const double *v1, const double *v2, int solid);
00261 DS_API void dsDrawCylinderD (const double pos[3], const double R[12],
00262 float length, float radius);
00263 DS_API void dsDrawCapsuleD (const double pos[3], const double R[12],
00264 float length, float radius);
00265 DS_API void dsDrawLineD (const double pos1[3], const double pos2[3]);
00266 DS_API void dsDrawConvexD(const double pos[3], const double R[12],
00267 double *_planes,
00268 unsigned int _planecount,
00269 double *_points,
00270 unsigned int _pointcount,
00271 unsigned int *_polygons);
00272
00280 DS_API void dsSetSphereQuality (int n);
00281 DS_API void dsSetCapsuleQuality (int n);
00282
00283
00284 #define dsDrawCappedCylinder dsDrawCapsule
00285 #define dsDrawCappedCylinderD dsDrawCapsuleD
00286 #define dsSetCappedCylinderQuality dsSetCapsuleQuality
00287
00288
00289 #ifdef __cplusplus
00290 }
00291 #endif
00292
00293 #endif
00294