Sparkle 0.0.1
Loading...
Searching...
No Matches
spk::Lumina::Pipeline::Object Class Reference

Represents a drawable entity configured with pipeline attributes. More...

#include <spk_pipeline.hpp>

Collaboration diagram for spk::Lumina::Pipeline::Object:
Collaboration graph

Classes

class  Attribute
 Attribute instance holding shared OpenGL resources. More...

Public Member Functions

 Object ()=default
 Constructs an empty pipeline object; attributes become available after assignment from createObject().
void render (GLsizei p_instanceCount=1)
 Issues a draw call using the object's buffers and configured attributes.
std::shared_ptr< spk::OpenGL::BufferSetObject > & bufferSet ()
 Provides mutable access to the buffer set associated with this object.
const std::shared_ptr< spk::OpenGL::BufferSetObject > & bufferSet () const
 Provides read-only access to the object's buffer set.
void setBufferSet (const std::shared_ptr< spk::OpenGL::BufferSetObject > &p_bufferSet)
 Replaces the buffer set used by this object.
Attributeattribute (const std::wstring &p_name)
 Retrieves a named attribute configured on the pipeline.
const Attributeattribute (const std::wstring &p_name) const
 Retrieves a named attribute configured on the pipeline.

Friends

class Pipeline

Detailed Description

Represents a drawable entity configured with pipeline attributes.

auto object = pipeline.createObject();
object.bufferSet()->vertexBufferObject().setData(vertices);
object.render();

Member Function Documentation

◆ attribute() [1/2]

Attribute & spk::Lumina::Pipeline::Object::attribute ( const std::wstring & p_name)
inline

Retrieves a named attribute configured on the pipeline.

Parameters
p_nameAttribute name defined in the pipeline specification.
Returns
Mutable attribute wrapper exposing the underlying resource.
Exceptions
std::runtime_errorWhen the attribute is not part of the pipeline.
Here is the caller graph for this function:

◆ attribute() [2/2]

const Attribute & spk::Lumina::Pipeline::Object::attribute ( const std::wstring & p_name) const
inline

Retrieves a named attribute configured on the pipeline.

Parameters
p_nameAttribute name defined in the pipeline specification.
Returns
Constant attribute wrapper exposing the underlying resource.
Exceptions
std::runtime_errorWhen the attribute is not part of the pipeline.

◆ bufferSet() [1/2]

std::shared_ptr< spk::OpenGL::BufferSetObject > & spk::Lumina::Pipeline::Object::bufferSet ( )
inline

Provides mutable access to the buffer set associated with this object.

Returns
Buffer set storing vertex and index buffers.

◆ bufferSet() [2/2]

const std::shared_ptr< spk::OpenGL::BufferSetObject > & spk::Lumina::Pipeline::Object::bufferSet ( ) const
inline

Provides read-only access to the object's buffer set.

Returns
Constant reference to the underlying buffer collection.

◆ render()

void spk::Lumina::Pipeline::Object::render ( GLsizei p_instanceCount = 1)

Issues a draw call using the object's buffers and configured attributes.

Parameters
p_instanceCountNumber of instances to render in a single call.
Here is the call graph for this function:

◆ setBufferSet()

void spk::Lumina::Pipeline::Object::setBufferSet ( const std::shared_ptr< spk::OpenGL::BufferSetObject > & p_bufferSet)
inline

Replaces the buffer set used by this object.

Parameters
p_bufferSetShared buffer set to bind to this object.

The documentation for this class was generated from the following files:
  • includes/structure/lumina/spk_pipeline.hpp
  • srcs/structure/lumina/spk_pipeline.cpp