From 8afe66fc634116a654becad7d9f7f53ab199da41 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Feb 2015 12:53:08 +0100 Subject: Updated BGFX, BX and GENie to latest (nw) --- 3rdparty/bgfx/examples/common/entry/cmd.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to '3rdparty/bgfx/examples/common/entry/cmd.cpp') diff --git a/3rdparty/bgfx/examples/common/entry/cmd.cpp b/3rdparty/bgfx/examples/common/entry/cmd.cpp index 6dfcb37d874..6d58aebf077 100644 --- a/3rdparty/bgfx/examples/common/entry/cmd.cpp +++ b/3rdparty/bgfx/examples/common/entry/cmd.cpp @@ -7,11 +7,14 @@ #include #include // size_t #include // strlen + +#include #include #include #include "dbg.h" #include "cmd.h" +#include "entry_p.h" #include #include @@ -89,14 +92,24 @@ struct CmdContext CmdLookup m_lookup; }; -static CmdContext s_cmdContext; +static CmdContext* s_cmdContext; + +void cmdInit() +{ + s_cmdContext = BX_NEW(entry::getAllocator(), CmdContext); +} + +void cmdShutdown() +{ + BX_DELETE(entry::getAllocator(), s_cmdContext); +} void cmdAdd(const char* _name, ConsoleFn _fn, void* _userData) { - s_cmdContext.add(_name, _fn, _userData); + s_cmdContext->add(_name, _fn, _userData); } void cmdExec(const char* _cmd) { - s_cmdContext.exec(_cmd); + s_cmdContext->exec(_cmd); } -- cgit v1.2.3-70-g09d2