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 #ifdef __cplusplus
00045 extern "C" {
00046 #endif
00047
00048
00049 #include <drawstuff/version.h>
00050
00051
00052
00053 #define DS_NONE 0
00054 #define DS_WOOD 1
00055
00056
00062 typedef struct dsFunctions {
00063 int version;
00064
00065 void (*start)();
00066 void (*step) (int pause);
00067 void (*command) (int cmd);
00068 void (*stop)();
00069
00070 char *path_to_textures;
00071 } dsFunctions;
00072
00073
00082 void dsSimulationLoop (int argc, char **argv,
00083 int window_width, int window_height,
00084 struct dsFunctions *fn);
00085
00092 void dsError (char *msg, ...);
00093
00100 void dsDebug (char *msg, ...);
00101
00107 void dsPrint (char *msg, ...);
00108
00117 void dsSetViewpoint (float xyz[3], float hpr[3]);
00118
00119
00126 void dsGetViewpoint (float xyz[3], float hpr[3]);
00127
00136 void dsStop();
00137
00143 double dsElapsedTime();
00144
00155 void dsSetTexture (int texture_number);
00156
00164 void dsSetColor (float red, float green, float blue);
00165
00172 void dsSetColorAlpha (float red, float green, float blue, float alpha);
00173
00184 void dsDrawBox (const float pos[3], const float R[12], const float sides[3]);
00185
00193 void dsDrawSphere (const float pos[3], const float R[12], float radius);
00194
00205 void dsDrawTriangle (const float pos[3], const float R[12],
00206 const float *v0, const float *v1, const float *v2, int solid);
00207
00212 void dsDrawCylinder (const float pos[3], const float R[12],
00213 float length, float radius);
00214
00219 void dsDrawCapsule (const float pos[3], const float R[12],
00220 float length, float radius);
00221
00226 void dsDrawLine (const float pos1[3], const float pos2[3]);
00227
00232 void dsDrawConvex(const float pos[3], const float R[12],
00233 float *_planes,
00234 unsigned int _planecount,
00235 float *_points,
00236 unsigned int _pointcount,
00237 unsigned int *_polygons);
00238
00239
00240
00241
00242 void dsDrawBoxD (const double pos[3], const double R[12],
00243 const double sides[3]);
00244 void dsDrawSphereD (const double pos[3], const double R[12],
00245 const float radius);
00246 void dsDrawTriangleD (const double pos[3], const double R[12],
00247 const double *v0, const double *v1, const double *v2, int solid);
00248 void dsDrawCylinderD (const double pos[3], const double R[12],
00249 float length, float radius);
00250 void dsDrawCapsuleD (const double pos[3], const double R[12],
00251 float length, float radius);
00252 void dsDrawLineD (const double pos1[3], const double pos2[3]);
00253 void dsDrawConvexD(const double pos[3], const double R[12],
00254 double *_planes,
00255 unsigned int _planecount,
00256 double *_points,
00257 unsigned int _pointcount,
00258 unsigned int *_polygons);
00259
00267 void dsSetSphereQuality (int n);
00268 void dsSetCapsuleQuality (int n);
00269
00270
00271 #define dsDrawCappedCylinder dsDrawCapsule
00272 #define dsDrawCappedCylinderD dsDrawCapsuleD
00273 #define dsSetCappedCylinderQuality dsSetCapsuleQuality
00274
00275
00276 #ifdef __cplusplus
00277 }
00278 #endif
00279
00280 #endif
00281