From b5627dc1b5b3d105cfa7d82ebf7e9ed49054b425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 19 Aug 2014 20:23:46 -0700 Subject: [PATCH] Made VertexDecl not appear as POD type to compiler. --- include/bgfx.h | 2 ++ src/vertexdecl.cpp | 6 ++++++ 2 files changed, 8 insertions(+) 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.