sculpto
Main Page
Namespaces
Classes
Files
File List
File Members
core
render
primitives
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
"
11
#include "
platform/opengl/gl_shader.h
"
12
13
scl::shader_program::shader_program
(
const
std::string &DebugName) :
14
DebugName(DebugName) {}
15
16
scl::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
}
SCL_CORE_ASSERT
#define SCL_CORE_ASSERT(expr,...)
Definition:
assert.h:69
scl::render_context::GetApi
static render_context_api GetApi()
Definition:
render_context.h:61
scl::shader_program::Create
static shared< shader_program > Create(const std::vector< shader_props > &Shaders, const std::string &DebugName)
Definition:
shader.cpp:16
scl::shader_program::shader_program
shader_program(const std::string &DebugName)
Definition:
shader.cpp:13
gl_shader.h
OpenGL shader program class definition module.
scl::shared
std::shared_ptr< T > shared
Definition:
smart_ptr.h:15
scl::render_context_api::DirectX
@ DirectX
scl::render_context_api::OpenGL
@ OpenGL
sclpch.h
Sculpto library prehompiled header. Defines common definitions, includes commonly used modules.
shader.h
Shader program interface definition module.
Generated by
1.9.4