sculpto
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"
13
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}
#define SCL_CORE_ASSERT(expr,...)
Definition: assert.h:69
static render_context_api GetApi()
static shared< texture_2d > Create(const image &Image, texture_type Type=texture_type::COLOR)
Definition: texture.cpp:14
OpenGL texture class definition module.
std::shared_ptr< T > shared
Definition: smart_ptr.h:15
texture_type
Definition: texture.h:18
Sculpto library prehompiled header. Defines common definitions, includes commonly used modules.
Texture interface definition module.