GLuint GLHelper::generateVAO(const GLuint number) { GLuint bufferID; glGenVertexArrays(number, &bufferID); vertexArrays.push_back(bufferID); checkErrors("generateVAO"); return bufferID; }
JNIEXPORT jlong JNICALL Java_org_librealsense_Native_rs2CreateConfig (JNIEnv *env, jclass) { rs2_error *error = NULL; rs2_config* config = rs2_create_config(&error); checkErrors(env, error); return (jlong) config; }
JNIEXPORT void JNICALL Java_org_librealsense_Native_rs2PipelineStop (JNIEnv *env, jclass, jlong pipeAddr) { rs2_error *error = NULL; rs2_pipeline* pipe = (rs2_pipeline*)pipeAddr; rs2_pipeline_stop(pipe, &error); checkErrors(env, error); }
void ExprShortEdit::setExpressionString(const std::string& expression) { edit->setText(QString(expression.c_str())); controlRebuildTimer->setSingleShot(true); controlRebuildTimer->start(0); checkErrors(); emit exprChanged(); }
GLuint GLHelper::createProgram(const std::vector<GLuint> &shaderList) { GLuint program = glCreateProgram(); for (size_t iLoop = 0; iLoop < shaderList.size(); iLoop++) { glAttachShader(program, shaderList[iLoop]); } glLinkProgram(program); GLint status; glGetProgramiv(program, GL_LINK_STATUS, &status); if (status == GL_FALSE) { GLint infoLogLength; glGetProgramiv(program, GL_INFO_LOG_LENGTH, &infoLogLength); GLchar *strInfoLog = new GLchar[infoLogLength + 1]; glGetProgramInfoLog(program, infoLogLength, NULL, strInfoLog); std::cerr << "Linking failed: \n" << strInfoLog << std::endl; delete[] strInfoLog; } else { std::cout << "Program compiled successfully" << std::endl; } for (size_t iLoop = 0; iLoop < shaderList.size(); iLoop++) { glDetachShader(program, shaderList[iLoop]); } checkErrors("createProgram"); return program; }
bool KSoundManager::playSong(std::string name, float volume, float stereo, bool loop) { if(mSilent) return true; //printf("play %s, with looping = %i\n", name.c_str(), (int) loop); //stop any current song if(song) stopSong(); // don't even bother if no sound file specified if ("" == name || "data/music/ " == name) return false; result = mSystem->createSound(name.c_str(), FMOD_CREATESTREAM | FMOD_SOFTWARE | FMOD_2D, 0, &song); if (!song) { printf("FMOD Error loading %s!\n", name.c_str()); checkErrors(); return false; } //extract the important part out of the name int startPos = (int)name.find_last_of("/"); mCurrentSongName = name.substr(startPos + 1, name.size() - 4 - startPos - 1); mMusicVolume = volume; song->setMode(loop ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF); mSystem->playSound(FMOD_CHANNEL_FREE, song, false, &songChannel); songChannel->setPan(stereo); songChannel->setVolume(volume); songChannel->getFrequency(&songBaseFrequency); //get the base frequency for modulation later songChannel->setPriority(0); //the music is the top priority in SkyPaint // for now, just return true - of course this needs to be changed return true; }
void EOSAudioDevice::listenerSetOrientationAt(float atx, float aty, float atz) { _listenerOrientation[0] = atx; _listenerOrientation[1] = aty; _listenerOrientation[2] = atz; alListenerfv(AL_ORIENTATION, _listenerOrientation); checkErrors("listenerSetOrientationAt()"); }
void Connection::SendPassword() { assert(m_connection); noidle(); assert(!m_command_list_active); mpd_run_password(m_connection.get(), m_password.c_str()); checkErrors(); }
JNIEXPORT jint JNICALL Java_org_librealsense_Native_rs2SupportsDeviceInfo (JNIEnv *env, jclass, jlong deviceAddr, jint cameraInfo) { rs2_error *error = NULL; rs2_device* device = (rs2_device*) deviceAddr; int supported = rs2_supports_device_info(device, static_cast<rs2_camera_info>(cameraInfo), &error); checkErrors(env, error); return (jint) supported; }
JNIEXPORT jlong JNICALL Java_org_librealsense_Native_rs2GetStreamProfiles (JNIEnv *env, jclass, jlong sensorAddr) { rs2_error *error = NULL; rs2_sensor* sensor = (rs2_sensor*) sensorAddr; rs2_stream_profile_list* streamProfileList = rs2_get_stream_profiles(sensor, &error); checkErrors(env, error); return (jlong)streamProfileList; }
JNIEXPORT jint JNICALL Java_org_librealsense_Native_rs2IsSensorExtendableTo (JNIEnv *env, jclass, jlong sensorAddr, jint extension) { rs2_error *error = NULL; rs2_sensor* sensor = (rs2_sensor*) sensorAddr; int extendable = rs2_is_sensor_extendable_to(sensor, static_cast<rs2_extension>(extension), &error); checkErrors(env, error); return (jint)extendable; }
JNIEXPORT jlong JNICALL Java_org_librealsense_Native_rs2CreateSensor (JNIEnv *env, jclass, jlong sensorListAddr, jint index) { rs2_error *error = NULL; rs2_sensor_list *sensorList = (rs2_sensor_list*) sensorListAddr; rs2_sensor* sensor = rs2_create_sensor(sensorList, index, &error); checkErrors(env, error); return (jlong)sensor; }
JNIEXPORT jlong JNICALL Java_org_librealsense_Native_rs2GetFrameNumber (JNIEnv *env, jclass, jlong frameAddr) { rs2_error *error = NULL; rs2_frame* frame = (rs2_frame*) frameAddr; unsigned long long frameNumber = rs2_get_frame_number(frame, &error); checkErrors(env, error); return (jlong)frameNumber; }
JNIEXPORT jlong JNICALL Java_org_librealsense_Native_rs2GetFrameStreamProfile (JNIEnv *env, jclass, jlong frameAddr) { rs2_error *error = NULL; rs2_frame* frame = (rs2_frame*) frameAddr; const rs2_stream_profile* streamProfile = rs2_get_frame_stream_profile(frame, &error); checkErrors(env, error); return (jlong)streamProfile; }
JNIEXPORT jint JNICALL Java_org_librealsense_Native_rs2EmbeddedFramesCount (JNIEnv *env, jclass, jlong framesAddr) { rs2_error *error = NULL; rs2_frame* frames = (rs2_frame*) framesAddr; int frame_count = rs2_embedded_frames_count(frames, &error); checkErrors(env, error); return (jint)frame_count; }
JNIEXPORT jlong JNICALL Java_org_librealsense_Native_rs2QuerySensors (JNIEnv *env, jclass, jlong deviceAddr) { rs2_error *error = NULL; rs2_device* device = (rs2_device*) deviceAddr; rs2_sensor_list* sensorList = rs2_query_sensors(device, &error); checkErrors(env, error); return (jlong)sensorList; }
JNIEXPORT jint JNICALL Java_org_librealsense_Native_rs2GetSensorsCount (JNIEnv *env, jclass, jlong sensorListAddr) { rs2_error *error = NULL; rs2_sensor_list* sensorList = (rs2_sensor_list*)sensorListAddr; int count = rs2_get_sensors_count(sensorList, &error); checkErrors(env, error); return (jint)count; }
JNIEXPORT jint JNICALL Java_org_librealsense_Native_rs2GetFrameWidth (JNIEnv *env, jclass, jlong frameAddr) { rs2_error *error = NULL; rs2_frame* frame = (rs2_frame*)frameAddr; jint result = (jint)rs2_get_frame_width(frame, &error); checkErrors(env, error); return result; }
JNIEXPORT jint JNICALL Java_org_librealsense_Native_rs2GetDeviceCount (JNIEnv *env, jclass, jlong deviceListAddr) { rs2_error *error = NULL; rs2_device_list* device_list = (rs2_device_list*) deviceListAddr; int count = rs2_get_device_count(device_list, &error); checkErrors(env, error); return (jint) count; }
JNIEXPORT void JNICALL Java_org_librealsense_Native_rs2ProcessFrame (JNIEnv *env, jclass, jlong blockAddr, jlong frameAddr) { rs2_error *error = NULL; rs2_processing_block* block = (rs2_processing_block*)blockAddr; rs2_frame* frame = (rs2_frame*)frameAddr; rs2_process_frame(block, frame, &error); checkErrors(env, error); }
JNIEXPORT jfloat JNICALL Java_org_librealsense_Native_rs2GetDepthScale (JNIEnv *env, jclass, jlong sensorAddr) { rs2_sensor* sensor = (rs2_sensor*) sensorAddr; rs2_error *error = NULL; float depth = rs2_get_depth_scale(sensor, &error); checkErrors(env, error); return (jfloat)depth; }
JNIEXPORT jlong JNICALL Java_org_librealsense_Native_rs2CreateFrameQueue (JNIEnv *env, jclass, jint capacity) { rs2_error *error = NULL; rs2_frame_queue* queue = rs2_create_frame_queue(capacity, &error); checkErrors(env, error); return (jlong)queue; }
JNIEXPORT jlong JNICALL Java_org_librealsense_Native_rs2CreateDevice (JNIEnv *env, jclass, jlong deviceListAddr, jint deviceIndex) { rs2_error *error = NULL; rs2_device_list* device_list = (rs2_device_list*) deviceListAddr; rs2_device* device = rs2_create_device(device_list, deviceIndex, &error); checkErrors(env, error); return (jlong) device; }
JNIEXPORT jlong JNICALL Java_org_librealsense_Native_rs2QueryDevices (JNIEnv *env, jclass, jlong contextAddr) { rs2_error *error = NULL; rs2_context* context = (rs2_context*) contextAddr; rs2_device_list* device_list = rs2_query_devices(context, &error); checkErrors(env, error); return (jlong)device_list; }
JNIEXPORT jlong JNICALL Java_org_librealsense_Native_rs2CreatePipeline (JNIEnv *env, jclass, jlong contextAddr) { rs2_error *error = NULL; rs2_context* context = (rs2_context*) contextAddr; rs2_pipeline* pipeline = rs2_create_pipeline(context, &error); checkErrors(env, error); return (jlong) pipeline; }
JNIEXPORT jlong JNICALL Java_org_librealsense_Native_rs2CreateAlign (JNIEnv *env, jclass, jint stream) { rs2_error *error = NULL; rs2_processing_block* block = rs2_create_align(static_cast<rs2_stream>(stream), &error); checkErrors(env, error); return (jlong)block; }
SongIterator Connection::GetPlaylistContentNoInfo(const std::string &path) { prechecksNoCommandsList(); mpd_send_list_playlist(m_connection.get(), path.c_str()); SongIterator result(m_connection.get(), defaultFetcher<Song>(mpd_recv_song)); checkErrors(); return result; }
JNIEXPORT jlong JNICALL Java_org_librealsense_Native_rs2CreatePointCloud (JNIEnv *env, jclass) { rs2_error *error = NULL; rs2_processing_block* block = rs2_create_pointcloud(&error); checkErrors(env, error); return (jlong)block; }
void EOSAudioDevice::listenerSetOrientationUp(float upx, float upy, float upz) { _listenerOrientation[3] = upx; _listenerOrientation[4] = upy; _listenerOrientation[5] = upz; alListenerfv(AL_ORIENTATION, _listenerOrientation); checkErrors("listenerSetOrientationUp()"); }
JNIEXPORT void JNICALL Java_org_librealsense_Native_rs2StartProcessingQueue (JNIEnv *env, jclass, jlong blockAddr, jlong queueAddr) { rs2_error *error = NULL; rs2_processing_block* block = (rs2_processing_block*)blockAddr; rs2_frame_queue* queue = (rs2_frame_queue*)queueAddr; rs2_start_processing_queue(block, queue, &error); checkErrors(env, error); }