Beispiel #1
0
	void Texture::initialise(const TextureResource* init_data /* = nullptr */)
	{
		GLenum tex_type = toTextureType(type());
		GLenum colour_fmt = toSurfaceFormat(format());

#	if defined(VCL_GL_ARB_direct_state_access)
		glCreateTextures(tex_type, 1, &_glId);
		allocImpl(colour_fmt);

		// Configure texture
		glTextureParameteri(_glId, GL_TEXTURE_BASE_LEVEL, firstMipMapLevel());
		glTextureParameteri(_glId, GL_TEXTURE_MAX_LEVEL, firstMipMapLevel() + mipMapLevels() - 1);
#	elif defined(VCL_GL_EXT_direct_state_access)
		glGenTextures(1, &_glId);
		allocImpl(colour_fmt);

		// Configure texture
		glTextureParameteriEXT(_glId, tex_type, GL_TEXTURE_BASE_LEVEL, firstMipMapLevel());
		glTextureParameteriEXT(_glId, tex_type, GL_TEXTURE_MAX_LEVEL, firstMipMapLevel() + mipMapLevels() - 1);
#	else
		glCreateTextures(tex_type, 1, &_glId);
		TextureBindPoint bp(tex_type, _glId);
		allocImpl(colour_fmt);

		// Configure texture
		glTexParameteri(tex_type, GL_TEXTURE_BASE_LEVEL, firstMipMapLevel());
		glTexParameteri(tex_type, GL_TEXTURE_MAX_LEVEL, firstMipMapLevel() + mipMapLevels() - 1);
#	endif

		if (init_data)
			updateImpl(*init_data);
	}
Beispiel #2
0
void FileChecker::update(const Files::const_iterator & begin, const Files::const_iterator & end)
{
	initialize();
	for (auto it = begin; it != end; ++it)
		updateImpl(*it);
	save();
}
Beispiel #3
0
void System::update(float elapsedTime)
{
	if (mState != SYSTEM_STATE_STARTED && mState != SYSTEM_STATE_UPDATED)
		return;

	mState = SYSTEM_STATE_UPDATING;

	if (mSystemDriver != nullptr)
		mSystemDriver->update(elapsedTime);

	updateImpl(elapsedTime);

	if (mState == SYSTEM_STATE_STOPING)
	{
		if (mSystemDriver != nullptr)
			mSystemDriver->stop();

		stopImpl();

		mState = SYSTEM_STATE_STOPED;

		if (Log::getInstance() != nullptr) Log::getInstance()->logMessage(mName, "Stoped");
	}
	else
	{
		mState = SYSTEM_STATE_UPDATED;
	}
}
bool CmdBreak::validate(DebuggerClient *client, BreakPointInfoPtr bpi,
                        int index) {
  ++index;
  if (client->arg(index, "if")) {
    bpi->setClause(client->lineRest(++index), true);
  } else if (client->arg(index, "&&")) {
    bpi->setClause(client->lineRest(++index), false);
  }

  if (bpi->valid()) {
    m_breakpoints = client->getBreakPoints();
    for (int i = 0; i < (int)m_breakpoints->size(); i++) {
      if ((*m_breakpoints)[i]->same(bpi)) {
        client->error("Breakpoint was already set previously.");
        return true;
      }
    }
    m_breakpoints->push_back(bpi);
    updateImpl(client);
    client->info("Breakpoint %d set %s", bpi->index(), bpi->desc().c_str());
    return true;
  }

  if (!bpi->m_url.empty()) {
    client->error("@{url} cannot be specified alone.");
  } else {
    client->error("Breakpoint was not set in right format.");
  }
  return false;
}
Beispiel #5
0
	void Texture::update(const TextureResource& data)
	{
#	if !defined(VCL_GL_ARB_direct_state_access) && !defined(VCL_GL_EXT_direct_state_access)
		TextureBindPoint bp(toTextureType(type()), _glId);
#	endif
		updateImpl(data);
	}
void TrackerStateEstimator::update( std::vector<ConfidenceMap>& confidenceMaps )
{
  if( confidenceMaps.empty() )
    return;

  return updateImpl( confidenceMaps );

}
 void RenderableSource::update(int flags, const Listener& sceneListener) 
     throw()
 {
     try {
         updateImpl(flags, sceneListener);
     } catch(Exception e) {
         fprintf(stderr, "Ignoring exception in renderable update: %s", e.what());
     }
 }
status_t CameraMetadata::update(const camera_metadata_ro_entry &entry) {
    status_t res;
    if (mLocked) {
        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
        return INVALID_OPERATION;
    }
    if ( (res = checkType(entry.tag, entry.type)) != OK) {
        return res;
    }
    return updateImpl(entry.tag, (const void*)entry.data.u8, entry.count);
}
Beispiel #9
0
    //-----------------------------------------------------------------------
    void RenderTarget::update(bool swap)
    {
        // call implementation
        updateImpl();


		if (swap)
		{
			// Swap buffers
    	    swapBuffers(Root::getSingleton().getRenderSystem()->getWaitForVerticalBlank());
		}
    }
status_t CameraMetadata::update(uint32_t tag,
        const camera_metadata_rational_t *data, size_t data_count) {
    status_t res;
    if (mLocked) {
        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
        return INVALID_OPERATION;
    }
    if ( (res = checkType(tag, TYPE_RATIONAL)) != OK) {
        return res;
    }
    return updateImpl(tag, (const void*)data, data_count);
}
status_t CameraMetadata::update(uint32_t tag,
        const String8 &string) {
    status_t res;
    if (mLocked) {
        ALOGE("%s: CameraMetadata is locked", __FUNCTION__);
        return INVALID_OPERATION;
    }
    if ( (res = checkType(tag, TYPE_BYTE)) != OK) {
        return res;
    }
    // string.size() doesn't count the null termination character.
    return updateImpl(tag, (const void*)string.string(), string.size() + 1);
}
Beispiel #12
0
bool Tracker::update( const Mat& image, Rect2d& boundingBox )
{

  if( !isInit )
  {
    return false;
  }

  if( image.empty() )
    return false;

  return updateImpl( image, boundingBox );
}
Beispiel #13
0
    //-----------------------------------------------------------------------
    void RenderTarget::update(bool swap)
    {
        OgreProfileBeginGPUEvent("RenderTarget: " + getName());
        // call implementation
        updateImpl();


        if (swap)
        {
            // Swap buffers
            swapBuffers();
        }
        OgreProfileEndGPUEvent("RenderTarget: " + getName());
    }
Beispiel #14
0
            inline void start(unsigned short mPort)
            {
                if(listener.listen(mPort) != sf::Socket::Done)
                {
                    ssvu::lo("Server") << "Error initalizing listener\n";
                    return;
                }
                else
                    ssvu::lo("Server") << "Listener initialized\n";

                running = true;
                updateFuture = std::async(std::launch::async, [this]
                    {
                        updateImpl();
                    });
            }
Beispiel #15
0
void Renderable::update(void)
{
  if (!read_write_lock_.tryLockForRead())
    return;

  if (!expired_)
  {
    read_write_lock_.unlock();
    return;
  }

  expired_ = false;
  content_root_->removeChildren(0, content_root_->getNumChildren());

  if (!hidden_)
    updateImpl();

  read_write_lock_.unlock();
  return;
}
bool CmdBreak::processUpdate(DebuggerClient *client) {
  m_breakpoints = client->getBreakPoints();
  if (m_breakpoints->empty()) {
    client->error("There is no breakpoint to clear or toggle.");
    client->tutorial(
      "Use '[b]reak ?|[h]elp' to read how to set breakpoints. "
    );
    return true;
  }

  if (client->argCount() == 1) {
    BreakPointInfoPtrVec *matched = client->getMatchedBreakPoints();
    BreakPointInfoPtrVec *bps = client->getBreakPoints();
    bool found = false;
    for (unsigned int i = 0; i < matched->size(); i++) {
      BreakPointInfoPtr bpm = (*matched)[i];
      BreakPointInfoPtr bp;
      int index = 0;
      for (; index < (int)bps->size(); index++) {
        if (bpm->same((*bps)[index])) {
          bp = (*bps)[index];
          break;
        }
      }
      if (bp) {
        const char *action;
        if (hasClearArg(client)) {
          action = "cleared";
          bps->erase(bps->begin() + index);
        } else if (hasEnableArg(client)) {
          action = "updated";
          bp->setState(BreakPointInfo::Always);
        } else if (hasDisableArg(client)) {
          action = "updated";
          bp->setState(BreakPointInfo::Disabled);
        } else {
          assert(hasToggleArg(client));
          action = "updated";
          bp->toggle();
        }
        client->info("Breakpoint %d is %s %s", bp->index(),
                     action, bp->site().c_str());
        found = true;
      }
    }
    if (found) {
      updateImpl(client);
      return true;
    }

    client->error("There is no current breakpoint to clear or toggle.");
    return true;
  }

  if (client->arg(2, "all")) {
    if (hasClearArg(client)) {
      m_breakpoints->clear();
      updateImpl(client);
      client->info("All breakpoints are cleared.");
      return true;
    }

    for (unsigned int i = 0; i < m_breakpoints->size(); i++) {
      BreakPointInfoPtr bpi = (*m_breakpoints)[i];
      if (hasEnableArg(client)) {
        bpi->setState(BreakPointInfo::Always);
      }
      else if (hasDisableArg(client)) {
        bpi->setState(BreakPointInfo::Disabled);
      }
      else {
        assert(hasToggleArg(client));
        bpi->toggle();
      }
    }

    updateImpl(client);
    return processList(client);
  }

  string snum = client->argValue(2);
  if (!DebuggerClient::IsValidNumber(snum)) {
    client->error("'[b]reak [c]lear|[t]oggle' needs an {index} argument.");
    client->tutorial(
      "You will have to run '[b]reak [l]ist' first to see a list of valid "
      "numbers or indices to specify."
    );
    return true;
  }

  int index = -1;
  int num = atoi(snum.c_str());
  for (unsigned int i = 0; i < m_breakpoints->size(); i++) {
    if (m_breakpoints->at(i)->index() == num) {
      index = i;
      break;
    }
  }
  if (index < 0) {
    client->error("\"%s\" is not a valid breakpoint index. Choose one from "
                  "this list:", snum.c_str());
    processList(client);
    return true;
  }

  BreakPointInfoPtr bpi = (*m_breakpoints)[index];
  if (hasClearArg(client)) {
    m_breakpoints->erase(m_breakpoints->begin() + index);
    updateImpl(client);
    client->info("Breakpoint %d cleared %s", bpi->index(),
                 bpi->desc().c_str());
  } else if (hasEnableArg(client)) {
    bpi->setState(BreakPointInfo::Always);
    updateImpl(client);
    client->info("Breakpoint %d's state is changed to %s.", bpi->index(),
                 bpi->state(false).c_str());
  } else if (hasDisableArg(client)) {
    bpi->setState(BreakPointInfo::Disabled);
    updateImpl(client);
    client->info("Breakpoint %d's state is changed to %s.", bpi->index(),
                 bpi->state(false).c_str());
  } else {
    assert(hasToggleArg(client));
    bpi->toggle();
    updateImpl(client);
    client->info("Breakpoint %d's state is changed to %s.", bpi->index(),
                 bpi->state(false).c_str());
  }

  return true;
}
Beispiel #17
0
bool LODNode::update(std::shared_ptr<Renderer> renderer){
	renderer->clearLights();
	return updateImpl(glm::mat4(1), renderer);
}
Beispiel #18
0
 void update(void) { updateImpl(); }
Beispiel #19
0
 virtual void update(ExprNode<matrix, T_element>& previous, ExprNode<matrix, T_element>& next)
 {
   updateImpl(previous, next);
 }
Beispiel #20
0
void FileChecker::update(const Poco::File & file)
{
	initialize();
	updateImpl(file);
	save();
}
bool CmdBreak::update(DebuggerClient *client) {
  m_breakpoints = client->getBreakPoints();
  return updateImpl(client);
}