Please help me!!

Blitz3D Forums/Blitz3D Userlibs/Please help me!!

bulat(Posted 2008) [#1]
> how make wrapper for blitz3d from this file
>
> header file: .h
> =======================
> ;==TuioDump.h
> =======================
> #ifndef INCLUDED_TUIODUMP_H
> #define INCLUDED_TUIODUMP_H
>
> #include "TuioListener.h"
> #include "TuioClient.h"
> #include <math.h>
>
> class TuioDump : public TuioListener {
>
> public:
> void addTuioObject(TuioObject *tobj);
> void updateTuioObject(TuioObject *tobj);
> void removeTuioObject(TuioObject *tobj);
>
> void addTuioCursor(TuioCursor *tcur);
> void updateTuioCursor(TuioCursor *tcur);
> void removeTuioCursor(TuioCursor *tcur);
>
> void refresh(long timestamp) {}
> };
>
> #endif /* INCLUDED_TUIODUMP_H */
>
>
> source file : .cpp
> ;===============================
> ;TuioDump.cpp
> ;===============================
>
> #include "TuioDump.h"
>
> void TuioDump::addTuioObject(TuioObject *tobj) {
> std::cout << "add obj " << tobj->getFiducialID() << " (" <<
> tobj->getSessionID() << ") "<< tobj->getX() << " " << tobj->getY() <<
" "
> << tobj->getAngle() << std::endl;
> }
>
> void TuioDump::updateTuioObject(TuioObject *tobj) {
> std::cout << "set obj " << tobj->getFiducialID() << " (" <<
> tobj->getSessionID() << ") "<< tobj->getX() << " " << tobj->getY() <<
" "
> << tobj->getAngle()
> << " " << tobj->getMotionSpeed() << " " << tobj->getRotationSpeed()
<< " "
> << tobj->getMotionAccel() << " " << tobj->getRotationAccel() <<
std::endl;
> }
>
> void TuioDump::removeTuioObject(TuioObject *tobj) {
> std::cout << "del obj " << tobj->getFiducialID() << " (" <<
> tobj->getSessionID() << ")" << std::endl;
> }
>
> void TuioDump::addTuioCursor(TuioCursor *tcur) {
> std::cout << "add cur " << tcur->getFingerID() << " (" <<
> tcur->getSessionID() << ") " << tcur->getX() << " " << tcur->getY()
<<
> std::endl;
> }
>
> void TuioDump::updateTuioCursor(TuioCursor *tcur) {
> std::cout << "set cur " << tcur->getFingerID() << " (" <<
> tcur->getSessionID() << ") " << tcur->getX() << " " << tcur->getY()
> << " " << tcur->getMotionSpeed() << " " << tcur->getMotionAccel() <<
" "
> << std::endl;
> }
>
> void TuioDump::removeTuioCursor(TuioCursor *tcur) {
> std::cout << "del cur " << tcur->getFingerID() << " (" <<
> tcur->getSessionID() << ")" << std::endl;
> }
>
> int main(int argc, char* argv[])
> {
> if( argc >= 2 && strcmp( argv[1], "-h" ) == 0 ){
> std::cout << "usage: TuioDump [port]\n";
> return 0;
> }
>
> int port = 3333;
> if( argc >= 2 ) port = atoi( argv[1] );
>
> TuioDump dump;
> TuioClient client(port);
> client.addTuioListener(&dump);
> client.start(true);
>
> return 0;
> }
>
> =========================
> this file link:
>
>
http://sourceforge.net/project/downloading.php?group_id=153998&use_mirror=transact&filename=TUIO_CPP-1.4pre2.zip&61385688
>
> please Help me!..


markcw(Posted 2008) [#2]
To make a dll you declare functions you want to be 'dll functions' ie. functions accessible by other programs. Then for Blitz create a .decls file listing these 'dll functions'.

In the case of a class you need to have an instance to work with. This is usually done with a new set of functions, the wrapper part. You'll probably have to do this yourself of course...

See here for creating dlls for Blitz and if you're using MS Visual Studio then see here for a tutorial on dlls.