int __api__getPipeline( struct soap *soap, // request parameters: api__getPipeline* api__getPipeline_, // response parameters: api__getPipelineResponse* api__getPipelineResponse_ ) { api__getPipelineResponse_->return_ = soap_new_api__Response(soap, 1); std::string pipelineId = api__getPipeline_->pipelineId; Pipeline pipeline = Pipeline(&config); bool is_success = pipeline.request(soap, pipelineId.c_str()); if(is_success) { api__getPipelineResponse_->return_->statusCode = 0; api__getPipelineResponse_->return_->__union_Response = 1; api__getPipelineResponse_->return_->union_Response.returnedValuePipeline = pipeline.m_pPipeline; }else{ api__getPipelineResponse_->return_->statusCode = 1; api__getPipelineResponse_->return_->errorMessage = (soap_new_std__string(soap, 1)); (*api__getPipelineResponse_->return_->errorMessage) = pipeline.m_error_message; } return SOAP_OK; }
Pipeline GraphicsPipelineBuilder::build(vk::PipelineCache cache) { auto info = parse(); vk::Pipeline pipeline; vk::createGraphicsPipelines(shader.device(), cache, 1, info, nullptr, pipeline); return Pipeline(shader.device(), pipeline); }
void Pipeline_Run_Test::test_exit_logical_not () { int status = -1; int correct_status[] = { EXIT_SUCCESS, EXIT_FAILURE }; size_t errorc = 0; Argument *a[][1] = { { new Argument ("exit succes") }, { new Argument ("exit failure") }, }; Filter *f[][1] = { { new Filter ("echo", "/bin/echo", a[0], 1) }, { new Filter ("echo", "/bin/echo", a[1], 1) } }; Pipeline p[] = { Pipeline (f[0], 1), /// return EXIT_SUCCESS Pipeline (f[1], 1, true), /// return logical not of EXIT_SUCCESS }; for (uint idx = 0; idx < 2; idx++) { try { status = p[idx].execute (); ASSERT_IDX (status == correct_status[idx]); } CATCH_ERROR_PCHAR; } ASSERT_NO_ERROR; }
void createPipelines(pipeline_map& pipelines, const glm::vec4& viewport) { // Create pipelines pipelines.emplace("main", Pipeline(viewport[2], viewport[3])); pipelines.emplace("ar", Pipeline(viewport[2], viewport[3])); setOpenGLOptions(pipelines); Pipeline& mainPipeline = pipelines["main"]; Pipeline& arPipeline = pipelines["ar"]; mainPipeline.setUpGLProjection(); arPipeline.getProjectionLocationFrom(mainPipeline); mainPipeline.createProjectionMatrices(); mainPipeline.getCamera().setViewport(viewport); arPipeline = mainPipeline; arPipeline.getCamera().useFixedRadius(); // By convention, 'g_pipelines["main"]' has a variable radius, by changing 'sphereCamRelativePosition[2]'. // For 'g_pipelines["ar"]' the radius is fixed, regardless. }
void Scene::Update(const ObjectList& objList, float dt) { UNREFERENCED_PARAMETER(objList); //Refresh the screen glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClearColor(m_bgColor.x, m_bgColor.y, m_bgColor.z, m_bgColor.w); // Set mouse position GetPerspPosition(); GetOrthoPosition(); //Todo: Lambda loop expression //std::for_each(m_DrawList.begin(), m_DrawList.end(), [&](DrawList::iterator& it) //{ for (auto it = m_DrawList.begin(); it != m_DrawList.end(); ++it) { if ((*it)->GetType() != PARTICLE) { //Update pipeline Pipeline((*it), dt); vec4 sptColor = (*it)->GetColor(); glUniform4f(m_GSM->GetGLManager()->GetUnifrom(COLOR), sptColor.x, sptColor.y, sptColor.z, sptColor.w); glUniform1i(m_GSM->GetGLManager()->GetUnifrom(TYPE), (*it)->GetType()); glUniform1f(m_GSM->GetGLManager()->GetUnifrom(TIME), Timer::GetInstance().GetElapsedTime()); //Todo: high quality? //glUniformMatrix4fv(); // Draw Texts if ((*it)->GetType() == TEXT) DrawTexts(static_cast<Text*>(*it)); else if ((*it)->GetType() == LIGHT) DrawLights(static_cast<Light*>(*it)); // Draw Sprites else if ((*it)->GetType() == SPRITE || (*it)->GetType() == DARKNESS) DrawSprites(*it); } // Draw Particles else DrawParticle(static_cast<Emitter*>(*it), dt); } }
/////////////////////////////////////////////////////////////////////////////////////////////////// /// SenderPipeline::SenderPipeline() /// /// Constructor. Create the pipeline from the static string representation. /////////////////////////////////////////////////////////////////////////////////////////////////// SenderPipeline::SenderPipeline(IPictureParameterNotifySink* pNotifySink) : PipelineBase(gst_parse_launch(PIPELINE_STRING, NULL)) , m_pVideoEncoder(gst_bin_get_by_name(GST_BIN(Pipeline()), "venc")) , m_pVideoRtpSink(gst_bin_get_by_name(GST_BIN(Pipeline()), "vsink")) , m_pVideoRtcpSink(gst_bin_get_by_name(GST_BIN(Pipeline()), "vcsink")) , m_pAudioRtpSink(gst_bin_get_by_name(GST_BIN(Pipeline()), "asink")) , m_pAudioRtcpSink(gst_bin_get_by_name(GST_BIN(Pipeline()), "acsink")) , m_vDestinations() , m_pNotifySink(pNotifySink) , m_pSpropParameterSets(NULL) { assert(m_pVideoEncoder != NULL); assert(m_pVideoRtpSink != NULL); assert(m_pVideoRtcpSink != NULL); assert(m_pAudioRtpSink != NULL); assert(m_pAudioRtcpSink != NULL); // Receive a callback when the caps property of the vsink:sink pad changes GstPad* pad = gst_element_get_static_pad(m_pVideoRtpSink, "sink"); assert(pad != NULL); g_signal_connect(pad, "notify::caps", G_CALLBACK(StaticPadNotifyCaps), this); gst_object_unref(pad); }
Pipeline* GFXDevice::newPipeline(const PipelineDescriptor& descriptor) const { // Pipeline with not shader is no pipeline at all DIVIDE_ASSERT(descriptor._shaderProgramHandle != 0, "Missing shader handle during pipeline creation!"); size_t hash = descriptor.getHash(); UniqueLock lock(_pipelineCacheLock); hashMap<size_t, Pipeline>::iterator it = _pipelineCache.find(hash); if (it == std::cend(_pipelineCache)) { return &hashAlg::insert(_pipelineCache, hash, Pipeline(descriptor)).first->second; } return &it->second; }
void ZmqMux::Run() { for (;;) { std::this_thread::sleep_for(std::chrono::milliseconds(50)); if (!_poller->poll()) break; if (ProcessExit()) break; Pipeline(_from, _to); } }
void Scene::DrawParticle(Emitter* emitter, float dt) { // Simulate all particles glBlendFunc(GL_SRC_ALPHA, GL_ONE); // Get info from emitter and send them to shader //vec3 centreColor = emitter->GetColor(); //vec3 edgeColor = emitter->GetEdgeColor(); //vec3 direction = emitter->GetDirection(); glUniform1i(m_GSM->GetGLManager()->GetUnifrom(TYPE), emitter->GetType()); //glUniform3f(m_GSM->GetGLManager()->GetUnifrom(EMITTER_COLOR), centreColor.x, centreColor.y, centreColor.z); //glUniform3f(m_GSM->GetGLManager()->GetUnifrom(EMITTER_EDGE), edgeColor.x, edgeColor.y, edgeColor.z); //glUniform3f(m_GSM->GetGLManager()->GetUnifrom(EMITTER_DIR), direction.x, direction.y, direction.z); //glUniform1d(m_GSM->GetGLManager()->GetUnifrom(EMITTER_RNDSCL), emitter->GetRandomScaleToggle()); //glUniform1d(m_GSM->GetGLManager()->GetUnifrom(EMITTER_EXPLO), emitter->GetExplosionToggle()); //glUniform1f(m_GSM->GetGLManager()->GetUnifrom(EMITTER_BOUND), emitter->GetBoundary()); //glUniform1i(m_GSM->GetGLManager()->GetUnifrom(EMITTER_TYPE), emitter->GetMode()); for (auto it = emitter->GetParticleContainer().begin(); it != emitter->GetParticleContainer().end(); ++it) { // Update pipeline Pipeline(*it, dt); vec3 centreColor = emitter->GetColor(); glUniform4f(m_GSM->GetGLManager()->GetUnifrom(COLOR), centreColor.x, centreColor.y, centreColor.z, (*it)->m_life); glUniformMatrix4fv(m_GSM->GetGLManager()->GetUnifrom(UV), 1, GL_FALSE, &m_animation.m_member[0][0]); UpdateParticle((*it)); //Refresh the buffer data glBufferData(GL_ARRAY_BUFFER, sizeof(m_vertex_buffer_data), m_vertex_buffer_data, GL_STATIC_DRAW); // Bind our texture in Texture Unit 0 glBindTexture(GL_TEXTURE_2D, emitter->GetTexture()->GetTexId()); // Draw the quad glDrawArrays(GL_QUADS, 0, 4); } }
bool World::tick(float gameTime) { bool playing = true; this->gameTime = gameTime; long gravityTick = trunc((gameTime * gameSpeed) / 128); Pipeline pipeline = Pipeline(activeTet); pipeline.addCollidable(this); pipeline.addCollidable(heap); pipeline.addTransformation(new Rotation(activeTet->getPivotPoint(), activeTet->getRotation())); if (gravityTick > lastGravityUpdate) { lastGravityUpdate = gravityTick; pipeline.addTransformation(new Translation(gravityDirection)); } pipeline.addTransformations(&inputTransforms); inputTransforms.clear(); PipelineResult* result = pipeline.execute(); activeTet->setRotation(result->getNetRotation()); activeTet->setCoords(result->getNetOffset()); bool dead = result->isDead(); delete result; if (dead) { int rows = heap->addTet(activeTet); switch (rows) { case 1: score += 50; break; case 2: score += 100; break; case 3: score += 200; break; case 4: score += 500; break; default: break; } if (!resetTet(nullptr)) { playing = false || mode == INFINITY_MODE; delete heap; heap = new QuadHeap(); } } return playing; }