ParameterBox TechParams_SetGeo(const Metal::InputLayout& inputLayout) { ParameterBox result; if (HasElement(inputLayout, "NORMAL")) result.SetParameter((const utf8*)"GEO_HAS_NORMAL", 1); if (HasElement(inputLayout, "TEXCOORD")) result.SetParameter((const utf8*)"GEO_HAS_TEXCOORD", 1); if (HasElement(inputLayout, "TEXTANGENT")) result.SetParameter((const utf8*)"GEO_HAS_TANGENT_FRAME", 1); if (HasElement(inputLayout, "TEXBITANGENT")) result.SetParameter((const utf8*)"GEO_HAS_BITANGENT", 1); if (HasElement(inputLayout, "COLOR")) result.SetParameter((const utf8*)"GEO_HAS_COLOUR", 1); return std::move(result); }
TechniqueMaterial::TechniqueMaterial( const Metal::InputLayout& inputLayout, const std::initializer_list<uint64>& objectCBs, ParameterBox materialParameters) : _materialParameters(std::move(materialParameters)) , _techniqueInterface(MakeTechInterface(inputLayout, objectCBs)) { if (HasElement(inputLayout, "NORMAL")) _geometryParameters.SetParameter((const utf8*)"GEO_HAS_NORMAL", 1); if (HasElement(inputLayout, "TEXCOORD")) _geometryParameters.SetParameter((const utf8*)"GEO_HAS_TEXCOORD", 1); if (HasElement(inputLayout, "TEXTANGENT")) _geometryParameters.SetParameter((const utf8*)"GEO_HAS_TANGENT_FRAME", 1); if (HasElement(inputLayout, "TEXBITANGENT")) _geometryParameters.SetParameter((const utf8*)"GEO_HAS_BITANGENT", 1); if (HasElement(inputLayout, "COLOR")) _geometryParameters.SetParameter((const utf8*)"GEO_HAS_COLOUR", 1); }
// ---------------------------------------------------------------------------- // wxHIDDevice::IsActive // // Returns true if a cookie of the device is active - for example if a key is // held down, joystick button pressed, caps lock active, etc.. // ---------------------------------------------------------------------------- bool wxHIDDevice::IsActive(int nIndex) { if(!HasElement(nIndex)) { //cookie at index does not exist - getElementValue //could return true which would be incorrect so we //check here return false; } IOHIDEventStruct Event; (*m_ppDevice)->getElementValue(m_ppDevice, m_pCookies[nIndex], &Event); return !!Event.value; }
DXUIElement* CDXUIManager::AddElement(UINT id) { bool bAlreadyExists = HasElement(id); if (!bAlreadyExists) { DXUIElement* pNewElement = new DXUIElement(); pNewElement->uiID = id; m_vecpUIElements.push_back(pNewElement); UpdateVectorIterators(); return pNewElement; } return (DXUIElement*)nullptr; }
// ---------------------------------------------------------------------------- // wxHIDKeyboard::AddCookie // // Overloaded version of wxHIDDevice::AddCookie that simply does not // add a cookie if a duplicate is found // ---------------------------------------------------------------------------- void wxHIDKeyboard::AddCookie(CFTypeRef Data, int i) { if(!HasElement(i)) wxHIDDevice::AddCookie(Data, i); }