diff --git a/include/bgfx.h b/include/bgfx.h index 124f67c9..7eee30a2 100644 --- a/include/bgfx.h +++ b/include/bgfx.h @@ -311,6 +311,8 @@ namespace bgfx /// Vertex declaration. struct VertexDecl { + VertexDecl(); + /// Start VertexDecl. VertexDecl& begin(RendererType::Enum _renderer = RendererType::Null); diff --git a/src/vertexdecl.cpp b/src/vertexdecl.cpp index abdee998..dd00ce3c 100644 --- a/src/vertexdecl.cpp +++ b/src/vertexdecl.cpp @@ -83,6 +83,12 @@ namespace bgfx 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) { m_hash = _renderer; // use hash to store renderer type while building VertexDecl.