sculpto
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
scl::vertex_array Class Referenceabstract

#include <vertex_array.h>

Inheritance diagram for scl::vertex_array:
scl::gl_vertex_array

Public Member Functions

mesh_type GetType () const
 
const shared< vertex_buffer > & GetVertexBuffer () const
 
const shared< index_buffer > & GetIndexBuffer () const
 
virtual void SetVertexBuffer (const shared< vertex_buffer > &VertexBuffer)=0
 
virtual void SetIndexBuffer (const shared< index_buffer > &IndexBuffer)=0
 
 vertex_array (mesh_type MeshType)
 
virtual ~vertex_array ()=default
 
virtual void Bind () const =0
 
virtual void Unbind () const =0
 

Static Public Member Functions

static shared< vertex_arrayCreate (mesh_type Mesh_type)
 

Protected Attributes

mesh_type Type {}
 
shared< vertex_bufferVertexBuffer {}
 
shared< index_bufferIndexBuffer {}
 

Detailed Description

Mesh interface.

Definition at line 27 of file vertex_array.h.

Constructor & Destructor Documentation

◆ vertex_array()

scl::vertex_array::vertex_array ( mesh_type  MeshType)

Vertex array default constructor.

Definition at line 14 of file vertex_array.cpp.

14 :
15 Type(MeshType) {}

◆ ~vertex_array()

virtual scl::vertex_array::~vertex_array ( )
virtualdefault

Vertex array default destructor.

Member Function Documentation

◆ Bind()

virtual void scl::vertex_array::Bind ( ) const
pure virtual
  • Bind vertex array to current render stage function.
Parameters
None.
Returns
None.

Implemented in scl::gl_vertex_array.

◆ Create()

scl::shared< scl::vertex_array > scl::vertex_array::Create ( mesh_type  Mesh_type)
static
  • Create vertex array function.
Parameters
Type- creating mesh type.
VertexBuffer- vertex buffer to link to vertex array.
IndexBuffer- vartex indicies buffer to be linked to vertex array.
Returns
pointer to created vertex array.

Definition at line 17 of file vertex_array.cpp.

18{
19 switch (render_context::GetApi())
20 {
21 case scl::render_context_api::OpenGL: return CreateShared<gl_vertex_array>(Mesh_type);
22 case scl::render_context_api::DirectX: SCL_CORE_ASSERT(0, "This API is currently unsupported."); return nullptr;
23 }
24
25 SCL_CORE_ASSERT(0, "Unknown render API was selected.");
26 return nullptr;
27}
#define SCL_CORE_ASSERT(expr,...)
Definition: assert.h:69
static render_context_api GetApi()

◆ GetIndexBuffer()

const shared< index_buffer > & scl::vertex_array::GetIndexBuffer ( ) const
inline

Index buffer, linked to vertex array getter function.

Definition at line 40 of file vertex_array.h.

40{ return IndexBuffer; }
shared< index_buffer > IndexBuffer
Definition: vertex_array.h:32

◆ GetType()

mesh_type scl::vertex_array::GetType ( ) const
inline

Vertex array getter/setter functions.

Mesh type getter function.

Definition at line 36 of file vertex_array.h.

36{ return Type; }

◆ GetVertexBuffer()

const shared< vertex_buffer > & scl::vertex_array::GetVertexBuffer ( ) const
inline

Vertex buffer, linked to vertex array getter function.

Definition at line 38 of file vertex_array.h.

38{ return VertexBuffer; }
shared< vertex_buffer > VertexBuffer
Definition: vertex_array.h:31

◆ SetIndexBuffer()

virtual void scl::vertex_array::SetIndexBuffer ( const shared< index_buffer > &  IndexBuffer)
pure virtual

Link index buffer to vertex array function.

Implemented in scl::gl_vertex_array.

◆ SetVertexBuffer()

virtual void scl::vertex_array::SetVertexBuffer ( const shared< vertex_buffer > &  VertexBuffer)
pure virtual

Link vertex buffer to vertex array function.

Implemented in scl::gl_vertex_array.

◆ Unbind()

virtual void scl::vertex_array::Unbind ( ) const
pure virtual
  • Unbind vertex array from current render stage function.
Parameters
None.
Returns
None.

Implemented in scl::gl_vertex_array.

Member Data Documentation

◆ IndexBuffer

shared<index_buffer> scl::vertex_array::IndexBuffer {}
protected

Definition at line 32 of file vertex_array.h.

◆ Type

mesh_type scl::vertex_array::Type {}
protected

Vertex array data.

Definition at line 30 of file vertex_array.h.

◆ VertexBuffer

shared<vertex_buffer> scl::vertex_array::VertexBuffer {}
protected

Definition at line 31 of file vertex_array.h.


The documentation for this class was generated from the following files: