void ofxColorStream::setup(ofPtr<openni::Device> device, bool isVerbose) { this->device = device; openni::Status rc; if (device->getSensorInfo(openni::SENSOR_COLOR) != NULL) { stream = ofPtr<openni::VideoStream>(new openni::VideoStream); rc = stream->create(*device, openni::SENSOR_COLOR); if (rc != openni::STATUS_OK) { throw ("Couldn't create color stream\n%s\n", openni::OpenNI::getExtendedError()); } } allocateBuffers(); rc = stream->start(); if (rc != openni::STATUS_OK) { throw ("Couldn't start the color stream\n%s\n", openni::OpenNI::getExtendedError()); } }