Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.blamite
The core library for the Blamite Game Engine.
shaders.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <bgfx/bgfx.h>
4 #include <string>
5 #include <map>
6 
7 #ifndef BLAM
8 #define BLAM
9 #endif
10 
12 {
13 private:
14  std::string id;
15 
16  bgfx::ShaderHandle shader_handle;
17  bool shader_load_result = false;
18 
19 public:
20  BlamShader(std::string _id, std::string file_path);
21  ~BlamShader();
22 
23  bgfx::ShaderHandle GetShaderHandle();
24  bool GetShaderLoadResult();
25  std::string GetID();
26 };
27 
29 {
30 private:
31  std::string id;
32 
33  BlamShader* vertex_shader = nullptr;
34  BlamShader* fragment_shader = nullptr;
35 
36  bgfx::ProgramHandle program_handle;
37  bool program_load_result = false;
38 
39  void LogShaderLoadError(std::string error);
40 
41 public:
42  BlamShaderProgram(std::string _id);
44 
45  bgfx::ProgramHandle GetProgramHandle();
46  bool GetProgramLoadResult();
47  std::string GetID();
48 };
49 
56 {
60  BLAM void LoadShaderPrograms();
61 
62  BLAM BlamShaderProgram* GetShaderProgram(std::string id);
63 
65 
66  BLAM bool LoadShaderProgram(std::string id);
67 
68  BLAM void ReloadShaders();
69 
70  BLAM bool ShadersReloading();
71 }
BlamRendering::BGFX::Shaders::ClearShaderPrograms
BLAM void ClearShaderPrograms()
Definition: shaders.cpp:26
Blam::Logger::LogEvent
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:142
BlamRendering::BGFX::Shaders::ReloadShaders
BLAM void ReloadShaders()
Definition: shaders.cpp:62
BlamRendering::BGFX::Shaders::ShadersReloading
BLAM bool ShadersReloading()
Definition: shaders.cpp:72
logger.h
BlamShader::GetID
std::string GetID()
Definition: BlamShader.cpp:48
copy
ARPHIC PUBLIC LICENSE Ltd Yung Chi Taiwan All rights reserved except as specified below Everyone is permitted to copy and distribute verbatim copies of this license but changing it is forbidden Preamble The licenses for most software are designed to take away your freedom to share and change it By the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software Legal Terms Font means the TrueType fonts AR PL Mingti2L AR PL KaitiM AR PL KaitiM and the derivatives of those fonts created through any modification including modifying reordering converting changing font or adding deleting some characters in from glyph table PL means Public License Copyright Holder means whoever is named in the copyright or copyrights for the Font You means the or person redistributing or modifying the Font Freely Available means that you have the freedom to copy or modify the Font as well as redistribute copies of the Font under the same conditions you not price If you you can charge for this service Copying &Distribution You may copy and distribute verbatim copies of this Font in any without provided that you retain this license including modifying reordering converting changing font or adding deleting some characters in from glyph and copy and distribute such modifications under the terms of Section provided that the following conditions are such as by offering access to copy the modifications from a designated or distributing the modifications on a medium customarily used for software interchange c If the modified fonts normally reads commands interactively when you must cause when started running for such interactive use in the most ordinary to print or display an announcement including an appropriate copyright notice and a notice that there is no and telling the user how to view a copy of this License These requirements apply to the modified work as a whole If identifiable sections of that work are not derived from the and can be reasonably considered independent and separate works in then this License and its do not apply to those sections when you distribute them as separate works mere aggregation of another work not based on the Font with the Font on a volume of a storage or distribution medium does not bring the other work under the scope of this License Condition Subsequent You may not copy
Definition: ARPHICPL.TXT:41
BlamShaderProgram::GetID
std::string GetID()
Definition: BlamShaderProgram.cpp:128
BlamShader::GetShaderLoadResult
bool GetShaderLoadResult()
Definition: BlamShader.cpp:43
BlamShader
Definition: shaders.h:11
shaders.h
BLAM
#define BLAM
Definition: shaders.h:8
BlamShaderProgram::~BlamShaderProgram
~BlamShaderProgram()
Definition: BlamShaderProgram.cpp:103
BlamShader::GetShaderHandle
bgfx::ShaderHandle GetShaderHandle()
Definition: BlamShader.cpp:38
ENGINE_DATA_PATH
#define ENGINE_DATA_PATH(path)
Macro to quickly access a game engine data folder.
Definition: config.h:36
BlamShaderProgram::BlamShaderProgram
BlamShaderProgram(std::string _id)
Definition: BlamShaderProgram.cpp:13
BlamShader::BlamShader
BlamShader(std::string _id, std::string file_path)
Definition: BlamShader.cpp:7
BlamShaderProgram::GetProgramLoadResult
bool GetProgramLoadResult()
Definition: BlamShaderProgram.cpp:123
BlamEngineDataFolder::Resources
@ Resources
Directory containing other resources and data, usually string tables and globals. Defaults to ....
it
ARPHIC PUBLIC LICENSE Ltd Yung Chi Taiwan All rights reserved except as specified below Everyone is permitted to copy and distribute verbatim copies of this license but changing it is forbidden Preamble The licenses for most software are designed to take away your freedom to share and change it By the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software Legal Terms Font means the TrueType fonts AR PL Mingti2L AR PL KaitiM AR PL KaitiM and the derivatives of those fonts created through any modification including modifying reordering converting changing font or adding deleting some characters in from glyph table PL means Public License Copyright Holder means whoever is named in the copyright or copyrights for the Font You means the or person redistributing or modifying the Font Freely Available means that you have the freedom to copy or modify the Font as well as redistribute copies of the Font under the same conditions you not price If you you can charge for this service Copying &Distribution You may copy and distribute verbatim copies of this Font in any without provided that you retain this license including modifying reordering converting changing font or adding deleting some characters in from glyph and copy and distribute such modifications under the terms of Section provided that the following conditions are such as by offering access to copy the modifications from a designated or distributing the modifications on a medium customarily used for software interchange c If the modified fonts normally reads commands interactively when you must cause it
Definition: ARPHICPL.TXT:36
BlamShaderProgram
Definition: shaders.h:28
BlamRendering::BGFX::Shaders::LoadShaderPrograms
BLAM void LoadShaderPrograms()
Loads all shader programs that aren't tag-based.
Definition: shaders.cpp:8
BlamShader::~BlamShader
~BlamShader()
Definition: BlamShader.cpp:33
BlamRendering::BGFX::Shaders::LoadShaderProgram
BLAM bool LoadShaderProgram(std::string id)
Definition: shaders.cpp:38
shader_programs
std::map< std::string, BlamShaderProgram * > shader_programs
Definition: shaders.cpp:5
BlamRendering::BGFX::Shaders
Namespace for anything related to bgfx shaders.
Definition: shaders.h:55
config.h
shaders_reloading
bool shaders_reloading
Definition: shaders.cpp:6
BlamShaderProgram::GetProgramHandle
bgfx::ProgramHandle GetProgramHandle()
Definition: BlamShaderProgram.cpp:118
BlamRendering::BGFX::Shaders::GetShaderProgram
BLAM BlamShaderProgram * GetShaderProgram(std::string id)
Definition: shaders.cpp:16