bool CommandBuffer::HasCommand()
{
  if(!(pStream && pStream->available()))
    return false;

    char ch;
    while(pStream->available())
    {
      ch = pStream->read();
      if(ch == '\r' || ch == '\n')
      {
        return strBuff.length() > 0; // вдруг лишние управляющие символы придут в начале строки?
      } // if

      strBuff += ch;
      // не даём вычитать больше символов, чем надо - иначе нас можно заспамить
      if(strBuff.length() >= MAX_RECEIVE_BUFFER_LENGTH)
      {
         ClearCommand();
         return false;
      } // if
    } // while

    return false;
}
Esempio n. 2
0
ClearCommand ClearCommand::Depth(float depthClearValue)
{
	const bool bDoClearColor = false;
	const bool bDoClearDepth = true;
	const bool bDoClearStencil = false;
	return ClearCommand (
		bDoClearColor, bDoClearDepth, bDoClearStencil,
		{ 0, 0, 0, 0 }, depthClearValue, 0
	);
}
Esempio n. 3
0
ClearCommand ClearCommand::Color(const std::array<float, 4>& clearColorValues)
{
	const bool bDoClearColor = true;
	const bool bDoClearDepth = false;
	const bool bDoClearStencil = false;
	return ClearCommand(
		bDoClearColor, bDoClearDepth, bDoClearStencil,
		clearColorValues, 0, 0
	);
}
Esempio n. 4
0
void ClearWindows(void) {
    ClearMap();
    ClearUserSelection();
    ClearStatus();
    ClearCommand();
}