sculpto
shader.cpp
Go to the documentation of this file.
1/*!****************************************************************//*!*
2 * \file shader.cpp
3 * \brief Shader program interface definition module.
4 *
5 * \author Sabitov Kirill
6 * \date 27 June 2022
7 *********************************************************************/
8
9#include "sclpch.h"
10#include "shader.h"
12
13scl::shader_program::shader_program(const std::string &DebugName) :
14 DebugName(DebugName) {}
15
16scl::shared<scl::shader_program> scl::shader_program::Create(const std::vector<shader_props> &Shaders, const std::string &DebugName)
17{
18 switch (render_context::GetApi())
19 {
20 case scl::render_context_api::OpenGL: return CreateShared<gl_shader_program>(Shaders, DebugName);
21 case scl::render_context_api::DirectX: SCL_CORE_ASSERT(0, "This API is currently unsupported."); return nullptr;
22 }
23
24 SCL_CORE_ASSERT(0, "Unknown render API was selected.");
25 return nullptr;
26}
#define SCL_CORE_ASSERT(expr,...)
Definition: assert.h:69
static render_context_api GetApi()
static shared< shader_program > Create(const std::vector< shader_props > &Shaders, const std::string &DebugName)
Definition: shader.cpp:16
shader_program(const std::string &DebugName)
Definition: shader.cpp:13
OpenGL shader program class definition module.
std::shared_ptr< T > shared
Definition: smart_ptr.h:15
Sculpto library prehompiled header. Defines common definitions, includes commonly used modules.
Shader program interface definition module.