本文整理汇总了C++中DataStream::getData方法的典型用法代码示例。如果您正苦于以下问题:C++ DataStream::getData方法的具体用法?C++ DataStream::getData怎么用?C++ DataStream::getData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataStream
的用法示例。
在下文中一共展示了DataStream::getData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool D3DCodePath::loadGeometryShader(DataStream& stream)
{
if ( stream.getDataSize() > 0 )
{
HRESULT hr = mDevice.getDevice().CreateGeometryShader(stream.getData(), stream.getDataSize(), NULL, &mpGeometryShader);
if ( FAILED(hr) )
{
return false;
}
}
return true;
}
示例2: getVertexLayout
bool D3DCodePath::createInputLayout(const DataStream& stream)
{
const VertexLayout& layout = getVertexLayout();
D3D11_INPUT_ELEMENT_DESC* pdescs = new D3D11_INPUT_ELEMENT_DESC[layout.getSize()];
for ( int index = 0; index < layout.getSize(); ++index )
{
const VertexLayoutElement& element = layout[index];
D3D11_INPUT_ELEMENT_DESC& desc = pdescs[index];
memset(&desc, 0, sizeof(D3D11_INPUT_ELEMENT_DESC));
desc.SemanticName = _strdup(element.semantic.toUtf8().c_str());
switch ( element.size )
{
case 1:
desc.Format = DXGI_FORMAT_R32_FLOAT;
break;
case 2:
desc.Format = DXGI_FORMAT_R32G32_FLOAT;
break;
case 3:
desc.Format = DXGI_FORMAT_R32G32B32_FLOAT;
break;
case 4:
desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
break;
default:
return false;
}
desc.AlignedByteOffset = element.pos;
desc.InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
}
HRESULT hr = mDevice.getDevice().CreateInputLayout(pdescs, layout.getSize(), stream.getData(), stream.getDataSize(), &mpInputLayout);
for ( int index = 0; index < layout.getSize(); ++index )
{
D3D11_INPUT_ELEMENT_DESC& desc = pdescs[index];
delete[] desc.SemanticName;
}
delete[] pdescs;
if ( FAILED(hr) )
{
return false;
}
return true;
}
示例3: importSceneDOM
void SceneSerializer::importSceneDOM(DataStream & stream, SceneNode* node) {
Document doc;
doc.Parse<0>(stream.getData());
assert(doc.IsObject() && "Error: Invalid scene description file found. Please check the correctness of the syntax.\n");
handleNode(doc, node);
}
示例4: write
void DataStream::write(const DataStream& that)
{
writeInt(that.getDataSize());
writeBytes(that.getData(), that.getDataSize());
}