示例#1
0
/*---------------------------------------------------------------------------
   Tests the selected input texture and changes configuration if the 
   resolutions do not match. The function does nothing for identical 
   configurations.
  ---------------------------------------------------------------------------*/
void Filter::Change(Buffers &Buffer)
   {
   vector2u Res[2];
   Texture::TexType Type[2];

   switch (Select)
      {
      case Filter::SelectVideo : 
         Res[0] = Buffer.GetVideoResolution();
         Res[1] = Video.Resolution();
         Type[0] = Buffer.GetVideoDataType();
         Type[1] = Video.DataType();
         break;

      case Filter::SelectDepth : 
         Res[0] = Buffer.GetDepthResolution();
         Res[1] = Depth.Resolution();
         Type[0] = Buffer.GetDepthDataType();
         Type[1] = Depth.DataType();
         break;

      default : throw dexception("Invalid Select enumeration.");
      }

   if (Res[0].U < 1 || Res[0].V < 1) {return;}
   
   if (Res[0].U != Res[1].U || Res[0].V != Res[1].V || Type[0] != Type[1])
      {
      Setup(Buffer);
      Assets(Buffer);
      }
   }
示例#2
0
const cxStr *cxUtil::Content(cchars file)
{
    CX_ASSERT(cxStr::IsOK(file), "args error");
    const cxStr *data = Document(file);
    if(cxStr::IsOK(data)){
        return data;
    }
    return Assets(file);
}