dcbd011582
Quite a bit going on in here. - Messing with shaders - Move ShaderProgram to std::unique_ptr These are part of efforts to clean up the ShaderProgram class to have a better interface. - Working on shell-ing out commands. This is pointless but getting me in the state of thinking about the system as a whole - e.g. "stop" at the "prompt" should "stop the server," so the prompt thread will need to communicate with the main thread. We already have event signalling in place for this. - Triangle strip cube Performance testing reasons. Not being used for now. - Remove TCP stuff from UDPbase. It only does UDP now.
37 lines
692 B
C++
37 lines
692 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <map>
|
|
|
|
class
|
|
Command
|
|
{
|
|
std::string m_name;
|
|
|
|
Command (const std::string& name)
|
|
: m_name (name)
|
|
{
|
|
}
|
|
};
|
|
|
|
/*
|
|
* Function pointer type that returns true if we should stop processing input,
|
|
* false otherwise.
|
|
*/
|
|
#define COMMANDHELPERFUNC(x) bool x (const std::string&)
|
|
|
|
typedef COMMANDHELPERFUNC((*CommandHelperFunc));
|
|
|
|
COMMANDHELPERFUNC(command_Quit);
|
|
COMMANDHELPERFUNC(command_Help);
|
|
COMMANDHELPERFUNC(command_Echo);
|
|
COMMANDHELPERFUNC(command_Shell);
|
|
|
|
const std::map <const std::string, CommandHelperFunc> CommandFunctionList =
|
|
{
|
|
{ "quit", command_Quit, },
|
|
{ "help", command_Help, },
|
|
{ "echo", command_Echo, },
|
|
{ "shell", command_Shell, },
|
|
};
|