Elaztek Developer Hub
Blamite Game Engine - blam!  00453.06.08.26.0624.blamite
The core library for the Blamite Game Engine.
reload_shader.hpp
Go to the documentation of this file.
1 #include "../console.h"
2 
6 #include "core.h"
7 
9 {
16  {
17  public:
19  {
20  name = "reload_shader";
21  description = "Reloads a specified shader by name or tag path";
22  syntax = "reload_shader <name>";
23 
25  }
26 
27  BlamResult Execute(std::vector<std::string> args)
28  {
29  if (args.size() == 0)
30  {
31  return BlamResult::Error_Command_InvalidArguments;
32  }
33 
34  if (!UsingBgfx())
35  {
36  Blam::Logger::LogEvent("this command is only supported when using bgfx renderer");
37  return BlamResult::Success_OK;
38  }
39 
41  {
42  Blam::Logger::LogEvent("shader '" + args.at(0) + "' reloaded");
43  }
44  else
45  {
46  Blam::Logger::LogEvent("failed to reload shader '" + args.at(0)
47  + "': ReloadShader() returned false, see output for details", WSV_ERROR);
48  }
49 
50  return BlamResult::Success_OK;
51  }
52  };
53 }
ui.h
Blam::Logger::LogEvent
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:130
Blam::Resources::Console::ReloadShaderCommand::Execute
BlamResult Execute(std::vector< std::string > args)
Called upon command execution.
Definition: reload_shader.hpp:27
BlamConsoleCommand::description
std::string description
An optional description of the command. Shown when using the classify command.
Definition: console.h:36
logger.h
BlamConsoleCommand
Class used to represent a console command.
Definition: console.h:33
Blam::Resources::Console::ReloadShaderCommand::ReloadShaderCommand
ReloadShaderCommand()
Definition: reload_shader.hpp:18
UsingBgfx
bool UsingBgfx()
Definition: bgfx.cpp:63
rendering.h
Blam::RenderingBGFX::Shaders::ReloadShader
BLAM bool ReloadShader(std::string name)
Definition: shaders.cpp:79
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::Resources::Console::ReloadShaderCommand
Class for the reload_shader command.
Definition: reload_shader.hpp:15
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.