summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/entry/cmd.cpp
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2015-02-14 12:53:08 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2015-02-14 12:53:08 +0100
commit8afe66fc634116a654becad7d9f7f53ab199da41 (patch)
tree8c3b7889cba36cbcd2b9d6d8d6b3df87dd495cb2 /3rdparty/bgfx/examples/common/entry/cmd.cpp
parent20b68364f7fa3bf692e50504fecf9bc5825eada3 (diff)
Updated BGFX, BX and GENie to latest (nw)
Diffstat (limited to '3rdparty/bgfx/examples/common/entry/cmd.cpp')
-rw-r--r--3rdparty/bgfx/examples/common/entry/cmd.cpp19
1 files changed, 16 insertions, 3 deletions
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 <stdint.h>
#include <stdlib.h> // size_t
#include <string.h> // strlen
+
+#include <bx/allocator.h>
#include <bx/hash.h>
#include <bx/tokenizecmd.h>
#include "dbg.h"
#include "cmd.h"
+#include "entry_p.h"
#include <tinystl/allocator.h>
#include <tinystl/string.h>
@@ -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);
}