41 #ifndef __DRAWSTUFF_H__
42 #define __DRAWSTUFF_H__
45 #if defined(ODE_PLATFORM_WINDOWS)
47 #define DS_API __declspec(dllexport)
48 #elif !defined(DS_LIB)
49 #define DS_DLL_API __declspec(dllimport)
62 #include <drawstuff/version.h>
66 enum DS_TEXTURE_NUMBER
78 #define DS_WIREFRAME 1
89 void (*step) (
int pause);
90 void (*command) (
int cmd);
93 const char *path_to_textures;
106 int window_width,
int window_height,
115 DS_API
void dsError (
const char *msg, ...);
123 DS_API
void dsDebug (
const char *msg, ...);
130 DS_API
void dsPrint (
const char *msg, ...);
187 DS_API
void dsSetColor (
float red,
float green,
float blue);
195 DS_API
void dsSetColorAlpha (
float red,
float green,
float blue,
float alpha);
207 DS_API
void dsDrawBox (
const float pos[3],
const float R[12],
const float sides[3]);
216 DS_API
void dsDrawSphere (
const float pos[3],
const float R[12],
float radius);
228 DS_API
void dsDrawTriangle (
const float pos[3],
const float R[12],
229 const float *v0,
const float *v1,
const float *v2,
int solid);
235 DS_API
void dsDrawCylinder (
const float pos[3],
const float R[12],
236 float length,
float radius);
242 DS_API
void dsDrawCapsule (
const float pos[3],
const float R[12],
243 float length,
float radius);
249 DS_API
void dsDrawLine (
const float pos1[3],
const float pos2[3]);
255 DS_API
void dsDrawConvex(
const float pos[3],
const float R[12],
257 unsigned int _planecount,
259 unsigned int _pointcount,
260 unsigned int *_polygons);
265 DS_API
void dsDrawBoxD (
const double pos[3],
const double R[12],
266 const double sides[3]);
267 DS_API
void dsDrawSphereD (
const double pos[3],
const double R[12],
269 DS_API
void dsDrawTriangleD (
const double pos[3],
const double R[12],
270 const double *v0,
const double *v1,
const double *v2,
int solid);
271 DS_API
void dsDrawCylinderD (
const double pos[3],
const double R[12],
272 float length,
float radius);
273 DS_API
void dsDrawCapsuleD (
const double pos[3],
const double R[12],
274 float length,
float radius);
275 DS_API
void dsDrawLineD (
const double pos1[3],
const double pos2[3]);
276 DS_API
void dsDrawConvexD(
const double pos[3],
const double R[12],
278 unsigned int _planecount,
280 unsigned int _pointcount,
281 unsigned int *_polygons);
291 DS_API
void dsSetCapsuleQuality (
int n);
301 #define dsDrawCappedCylinder dsDrawCapsule
302 #define dsDrawCappedCylinderD dsDrawCapsuleD
303 #define dsSetCappedCylinderQuality dsSetCapsuleQuality
DS_API void dsDrawSphere(const float pos[3], const float R[12], float radius)
Draw a sphere.
Definition: drawstuff.cpp:1405
DS_API void dsPrint(const char *msg,...)
print log message
Definition: osx.cpp:97
DS_API void dsDrawCylinder(const float pos[3], const float R[12], float length, float radius)
Draw a z-aligned cylinder.
Definition: drawstuff.cpp:1454
DS_API void dsDrawConvex(const float pos[3], const float R[12], float *_planes, unsigned int _planecount, float *_points, unsigned int _pointcount, unsigned int *_polygons)
Draw a convex shape.
Definition: drawstuff.cpp:1381
DS_API void dsError(const char *msg,...)
exit with error message.This function displays an error message then exit.
Definition: osx.cpp:77
DS_API void dsSetViewpoint(float xyz[3], float hpr[3])
Sets the viewpoint.
Definition: drawstuff.cpp:1299
DS_API void dsDrawCapsule(const float pos[3], const float R[12], float length, float radius)
Draw a z-aligned capsule.
Definition: drawstuff.cpp:1476
DS_API void dsDrawLine(const float pos1[3], const float pos2[3])
Draw a line.
Definition: drawstuff.cpp:1510
DS_API void dsGetViewpoint(float xyz[3], float hpr[3])
Gets the viewpoint.
Definition: drawstuff.cpp:1316
DS_API void dsDrawBox(const float pos[3], const float R[12], const float sides[3])
Draw a box.
Definition: drawstuff.cpp:1360
DS_API void dsSetDrawMode(int mode)
Set Drawmode 0=Polygon Fill,1=Wireframe). Use the DS_POLYFILL and DS_WIREFRAME macros.
Definition: drawstuff.cpp:1632
DS_API void dsSetColor(float red, float green, float blue)
Set the color with which geometry is drawn.
Definition: drawstuff.cpp:1339
DS_API void dsSetTexture(int texture_number)
Toggle the rendering of textures.It changes the way objects are drawn. these changes will apply to al...
Definition: drawstuff.cpp:1332
DS_API void dsSimulationLoop(int argc, char **argv, int window_width, int window_height, struct dsFunctions *fn)
Does the complete simulation.This function starts running the simulation, and only exits when the sim...
Definition: drawstuff.cpp:1270
DS_API void dsDebug(const char *msg,...)
exit with error message and core dump.this functions tries to dump core or start the debugger...
Definition: osx.cpp:87
DS_API void dsSetSphereQuality(int n)
Set the quality with which curved objects are rendered.Higher numbers are higher quality, but slower to draw. This must be set before the first objects are drawn to be effective. Default sphere quality is 1, default capsule quality is 3.
Definition: drawstuff.cpp:1621
DS_API double dsElapsedTime()
Get the elapsed time (on wall-clock)It returns the nr of seconds since the last call to this function...
Definition: osx.cpp:127
Set of functions to be used as callbacks by the simulation loop.
Definition: drawstuff.h:85
DS_API void dsSetColorAlpha(float red, float green, float blue, float alpha)
Set the color and transparency with which geometry is drawn.
Definition: drawstuff.cpp:1349
DS_API void dsStop()
Stop the simulation loop.Calling this from within dsSimulationLoop() will cause it to exit and return...
Definition: osx.cpp:123
DS_API void dsDrawTriangle(const float pos[3], const float R[12], const float *v0, const float *v1, const float *v2, int solid)
Draw a triangle.
Definition: drawstuff.cpp:1441