Hola, para empezar, tengo que declararme un aprendiz (muy verde aún) en programación y gambas. Es un hobby y una pasión.
Bueno, el caso es que estoy introduciéndome en el mundo de Arduino y después de modificar una aplicación de "San Jsbsan" manejando 2 Arduinos desde gambas (gracias a sus enseñanzas fue muy fácil). Me he animado y estoy pensando en introducirme un poco más en ese mundo.
He leÃdo a tururu y su CONTROLES C++ (Uso de librerÃas C/C++ en gambas), pero después de ver la web de OpenNI y leer lo que añado abajo, me surge la idea que quizás este sdk, se podrÃa usar con gambas... ¿Me podrÃais confirmar esto?
Saludos y gracias a todos los que hacéis que gente como yo nos creamos que sabemos hacer algo con el teclado de nuestro ordenador...
extraido de file:///home/celtilander/Descargas/OpenNI/Documentation/getting_started.html
GCC / GNU Make
In the following section, refers to the directory to where OpenNI SDK was extracted. Note that the installation does not define such an environment variable. Either define it yourself or use the full path.
Add the SDK Include directory, $OPENNI_DIR/Include, to your include path (-I)
Copy the files from the Redist directory, $OPENNI_DIR/Redist, to your execution directory
Add the execution directory to your lib path (-L)
Add libOpenNI2 to your library list (-l)
It is highly suggested to also add the "-Wl,-rpath ./" to your linkage command. Otherwise, the runtime linker will not find the libOpenNI.so file when you run your application. (default Linux behavior is to look for shared objects only in /lib and /usr/lib).
Writing an Application
Your code should include OpenNI.h header file.
The entire C++ API is available under the openni namespace.
Be sure to call openni::OpenNI::initialize(), to make sure all drivers are loaded If no drivers are found, this function will fail. If it does, you can get some basic log by calling openni::OpenNI::getExtendedError() (which returns a string) Note that usually this method fails because OpenNI redist files weren't copied to the working directory.
When closing your application, call openni::OpenNI::shutdown(), to allow OpenNI to close properly (unload drivers and such).
Open a device using its URI. You can get a list of available devices using openni::OpenNI::enumerateDevices(). Enumeration returns an array of openni::DeviceInfo objects, which include (among other things) the device URI. If you don't care which device to use, you can specify openni::ANY_DEVICE as the URI. (to work with .oni files, use the path to the file as its URI)
Create a video stream by specifying the device and the sensor.
Be sure to destroy the stream and close the device when you're done.