sculpto
Main Page
Namespaces
Classes
Files
File List
File Members
core
render
primitives
texture.cpp
Go to the documentation of this file.
1
/*!****************************************************************/
/*!*
2
* \file texture.cpp
3
* \brief Texture interface implementation module.
4
*
5
* \author Sabitov Kirill
6
* \date 28 June 2022
7
*********************************************************************/
8
9
#include "
sclpch.h
"
10
#include "../render_context.h"
11
#include "
texture.h
"
12
#include "
platform/opengl/gl_texture.h
"
13
14
scl::shared<scl::texture_2d>
scl::texture_2d::Create
(
const
image
&Image,
texture_type
Type)
15
{
16
switch
(
render_context::GetApi
())
17
{
18
case
scl::render_context_api::OpenGL
:
return
CreateShared<gl_texture_2d>(Image, Type);
19
case
scl::render_context_api::DirectX
:
SCL_CORE_ASSERT
(0,
"This API is currently unsupported."
);
return
nullptr
;
20
}
21
22
SCL_CORE_ASSERT
(0,
"Unknown render API was selected."
);
23
return
nullptr
;
24
}
SCL_CORE_ASSERT
#define SCL_CORE_ASSERT(expr,...)
Definition:
assert.h:69
scl::image
Definition:
image.h:19
scl::render_context::GetApi
static render_context_api GetApi()
Definition:
render_context.h:61
scl::texture_2d::Create
static shared< texture_2d > Create(const image &Image, texture_type Type=texture_type::COLOR)
Definition:
texture.cpp:14
gl_texture.h
OpenGL texture 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
scl::texture_type
texture_type
Definition:
texture.h:18
sclpch.h
Sculpto library prehompiled header. Defines common definitions, includes commonly used modules.
texture.h
Texture interface definition module.
Generated by
1.9.4