All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Luminous::VertexArray Class Reference

This class abstracts OpenGL VertexArrayObjects. More...

#include <Luminous/VertexArray.hpp>

Inheritance diagram for Luminous::VertexArray:
Luminous::RenderResource Patterns::NotCopyable

Classes

struct  Binding
 Stores vertex description and id of buffer containing vertices. More...
 

Public Member Functions

LUMINOUS_API void addBinding (const Luminous::Buffer &vertexBuffer, const Luminous::VertexDescription &description)
 Adds binding for the given vertex buffer. More...
 
LUMINOUS_API const Bindingbinding (size_t index) const
 Returns binding according based on their ordering (first added binding has index 0, second 1, etc) More...
 
LUMINOUS_API size_t bindingCount () const
 How many bindings is stored in this object. More...
 
LUMINOUS_API void clear ()
 Removes all bindings.
 
LUMINOUS_API RenderResource::Id indexBuffer () const
 Returns index buffer of this vertex array. More...
 
LUMINOUS_API VertexArrayoperator= (VertexArray &&b)
 Move assignment operator. More...
 
LUMINOUS_API void removeBinding (const Luminous::Buffer &buffer)
 Removes binding for the given buffer. More...
 
LUMINOUS_API void setIndexBuffer (const Luminous::Buffer &indexBuffer)
 Sets index buffer for this vertex array. More...
 
LUMINOUS_API VertexArray ()
 Constructor of VertexArray.
 
LUMINOUS_API VertexArray (VertexArray &&b)
 Move constructor. More...
 
LUMINOUS_API ~VertexArray ()
 Destroctor of VertexArray, doesn't destroy any buffers attached.
 
- Public Member Functions inherited from Luminous::RenderResource
unsigned int expiration () const
 Returns resource expiration time. More...
 
int generation () const
 Returns generation of this resource. More...
 
void invalidate ()
 Invalidates correspondent GPU objects and forces uploading of data to GPU.
 
RenderResourceoperator= (RenderResource &&rr)
 Move assignment operator. More...
 
 RenderResource (Type type)
 Constructor of RenderResource. More...
 
 RenderResource (RenderResource &&rr)
 Move constructor. More...
 
Id resourceId () const
 Returns identifier of resource. More...
 
Type resourceType () const
 Returns type of the resource. More...
 
void setExpiration (unsigned int seconds)
 Set resource expiration time. More...
 
void setGeneration (int generation)
 Sets generation for this resource. More...
 
virtual ~RenderResource ()
 Destructor of RenderResource.
 

Additional Inherited Members

- Public Types inherited from Luminous::RenderResource
typedef uint64_t Id
 Id of a resource.
 
enum  Type {
  VertexArray, Buffer, Program, Texture,
  RenderBuffer, FrameBuffer
}
 Different types of render resources. More...
 
- Protected Member Functions inherited from Luminous::RenderResource
RenderResourceoperator= (const RenderResource &rr)
 Assignment operator. More...
 
 RenderResource (const RenderResource &rr)
 Copy constructor. More...
 

Detailed Description

This class abstracts OpenGL VertexArrayObjects.

GPU correspondent of this class is VertexArrayGL

Examples:
Widget3DExample.cpp.

Constructor & Destructor Documentation

LUMINOUS_API Luminous::VertexArray::VertexArray ( VertexArray &&  b)

Move constructor.

Parameters
bVertexArray to move

Member Function Documentation

LUMINOUS_API void Luminous::VertexArray::addBinding ( const Luminous::Buffer vertexBuffer,
const Luminous::VertexDescription description 
)

Adds binding for the given vertex buffer.

Parameters
vertexBufferVertex buffer which contains vertex data conforming to description
descriptionDescription of vertex data in vertexBuffer
LUMINOUS_API const Binding& Luminous::VertexArray::binding ( size_t  index) const

Returns binding according based on their ordering (first added binding has index 0, second 1, etc)

Parameters
indexIndex for the binding
Returns
Binding corresponding the given index
LUMINOUS_API size_t Luminous::VertexArray::bindingCount ( ) const

How many bindings is stored in this object.

Returns
Number of bindings
LUMINOUS_API RenderResource::Id Luminous::VertexArray::indexBuffer ( ) const

Returns index buffer of this vertex array.

Returns
Id of the index buffer
LUMINOUS_API VertexArray& Luminous::VertexArray::operator= ( VertexArray &&  b)

Move assignment operator.

Parameters
bVertexArrau to move
Returns
Reference to this
LUMINOUS_API void Luminous::VertexArray::removeBinding ( const Luminous::Buffer buffer)

Removes binding for the given buffer.

Parameters
bufferBuffer to remove
LUMINOUS_API void Luminous::VertexArray::setIndexBuffer ( const Luminous::Buffer indexBuffer)

Sets index buffer for this vertex array.

Parameters
indexBufferBuffer storing indices