Made VertexDecl not appear as POD type to compiler.

This commit is contained in:
Branimir Karadžić 2014-08-19 20:23:46 -07:00
parent 484efd9b77
commit b5627dc1b5
2 changed files with 8 additions and 0 deletions

View file

@ -311,6 +311,8 @@ namespace bgfx
/// Vertex declaration. /// Vertex declaration.
struct VertexDecl struct VertexDecl
{ {
VertexDecl();
/// Start VertexDecl. /// Start VertexDecl.
VertexDecl& begin(RendererType::Enum _renderer = RendererType::Null); VertexDecl& begin(RendererType::Enum _renderer = RendererType::Null);

View file

@ -83,6 +83,12 @@ namespace bgfx
va_end(argList); va_end(argList);
} }
VertexDecl::VertexDecl()
{
// BK - struct need to have ctor to qualify as non-POD data.
// Need this to catch programming errors when serializing struct.
}
VertexDecl& VertexDecl::begin(RendererType::Enum _renderer) VertexDecl& VertexDecl::begin(RendererType::Enum _renderer)
{ {
m_hash = _renderer; // use hash to store renderer type while building VertexDecl. m_hash = _renderer; // use hash to store renderer type while building VertexDecl.