Elaztek Developer Hub
Blamite Game Engine - blam!  00453.06.08.26.0624.blamite
The core library for the Blamite Game Engine.
viewport_mode.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../console.h"
5 
7 {
14  {
15  public:
17  {
18  name = "viewport_mode";
19  syntax = "viewport_mode <3d|2d>";
20  description = "sets viewport render mode";
21 
23  }
24 
25  BlamResult Execute(std::vector<std::string> arguments)
26  {
27  if (arguments.size() != 1)
28  {
29  return BlamResult::Error_Command_WrongArgumentCount;
30  }
31 
32  if (arguments.at(0) == "3d")
33  {
35  Blam::Logger::LogEventForce("viewport mode set to 3d");
36  }
37  else if (arguments.at(0) == "2d")
38  {
40  Blam::Logger::LogEventForce("viewport mode set to 2d");
41  }
42  else
43  {
44  return BlamResult::Error_Command_InvalidArguments;
45  }
46 
47  return BlamResult::Success_OK;
48  }
49  };
50 }
BlamConsoleCommand::description
std::string description
An optional description of the command. Shown when using the classify command.
Definition: console.h:36
BlamConsoleCommand
Class used to represent a console command.
Definition: console.h:33
director.h
Blam::Resources::Console::ViewportModeCommand::ViewportModeCommand
ViewportModeCommand()
Definition: viewport_mode.hpp:16
BlamConsoleCommand::name
std::string name
The name of the console command.
Definition: console.h:35
BlamConsoleCommand::syntax
std::string syntax
The syntax information for the command. Shown to the user when using the help command with an argumen...
Definition: console.h:37
BlamConsoleCommand::type
BlamCommandType type
The type of command this is. See #Blam::Resources::Console::BlamCommandType for more information.
Definition: console.h:40
Blam::Logger::LogEventForce
BLAM void LogEventForce(std::string message)
Forcibly logs a message to the log and/or console.
Definition: aliases.cpp:262
Blam::Resources::Console::ViewportModeCommand
Class for the viewport_mode command.
Definition: viewport_mode.hpp:13
Blam::Director::SetCamera2DMode
BLAM void SetCamera2DMode(bool use_2d, bool copy_from_last=false)
Definition: director.cpp:41
Blam::Resources::Console::ViewportModeCommand::Execute
BlamResult Execute(std::vector< std::string > arguments)
Called upon command execution.
Definition: viewport_mode.hpp:25
Blam::Resources::Console
Namespace for things relating to the debug console.
Definition: abort.hpp:5
BlamCommandType::Builtin
@ Builtin
A command that is hard-coded into the engine.