.. index:: pair: class; EE::Graphics::VertexBufferVBO .. _doxid-class_e_e_1_1_graphics_1_1_vertex_buffer_v_b_o: class EE::Graphics::VertexBufferVBO =================================== .. toctree:: :hidden: Overview ~~~~~~~~ The Vertex Buffer VBO class is the implementation of a Vertex Buffer using the OpenGL VBOs. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class VertexBufferVBO: public :ref:`EE::Graphics::VertexBuffer` { public: // construction :target:`VertexBufferVBO`(const :ref:`Uint32`& vertexFlags = :ref:`VERTEX_FLAGS_DEFAULT`, :ref:`PrimitiveType` drawType = :ref:`PRIMITIVE_QUADS`, const :ref:`Int32`& reserveVertexSize = 0, const :ref:`Int32`& reserveIndexSize = 0, :ref:`VertexBufferUsageType` usageType = :ref:`VertexBufferUsageType::Static`); virtual :target:`~VertexBufferVBO`(); // methods virtual void :ref:`bind`(); virtual void :ref:`draw`(); virtual bool :ref:`compile`(); virtual void :ref:`update`(const :ref:`Uint32`& types, bool indices); virtual void :ref:`reload`(); virtual void :ref:`unbind`(); virtual void :ref:`clear`(); }; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // methods static :ref:`VertexBuffer`* :ref:`New`(const :ref:`Uint32`& vertexFlags = :ref:`VERTEX_FLAGS_DEFAULT`, :ref:`PrimitiveType` drawType = :ref:`PRIMITIVE_QUADS`, const :ref:`Int32`& reserveVertexSize = 0, const :ref:`Int32`& reserveIndexSize = 0, :ref:`VertexBufferUsageType` usageType = :ref:`VertexBufferUsageType::Static`); static :ref:`VertexBuffer`* :ref:`NewVertexArray`(const :ref:`Uint32`& vertexFlags = :ref:`VERTEX_FLAGS_DEFAULT`, :ref:`PrimitiveType` drawType = :ref:`PRIMITIVE_QUADS`, const :ref:`Int32`& reserveVertexSize = 0, const :ref:`Int32`& reserveIndexSize = 0, :ref:`VertexBufferUsageType` usageType = :ref:`VertexBufferUsageType::Static`); void :ref:`addVertex`(const :ref:`Uint32`& type, const :ref:`Vector2f`& vertex); void :ref:`addVertex`(const :ref:`Vector2f`& vertex); void :ref:`addTextureCoord`(const :ref:`Vector2f`& vertexCoord, const :ref:`Uint32`& textureLevel = 0); void :ref:`addColor`(const :ref:`Color`& color); void :ref:`addIndex`(const :ref:`Uint32`& indexValue); void :ref:`setVertex`(const :ref:`Uint32`& index, const :ref:`Uint32`& type, const :ref:`Vector2f`& vertex); void :ref:`setVertex`(const :ref:`Uint32`& index, const :ref:`Vector2f`& vertex); void :ref:`setTextureCoord`(const :ref:`Uint32`& index, const :ref:`Vector2f`& vertexCoord, const :ref:`Uint32`& textureLevel = 0); void :ref:`setColor`(const :ref:`Uint32`& index, const :ref:`Color`& color); void :ref:`setIndex`(const :ref:`Uint32`& index, const :ref:`Uint32`& indexValue); void :ref:`resizeArray`(const :ref:`Uint32`& type, const :ref:`Uint32`& size); void :ref:`resizeIndices`(const :ref:`Uint32`& size); void :ref:`addQuad`(const :ref:`Vector2f`& pos, const :ref:`Sizef`& size, const :ref:`Color`& color); void :ref:`setQuad`(const :ref:`Vector2u`& gridPos, const :ref:`Vector2f`& pos, const :ref:`Sizef`& size, const :ref:`Color`& color); void :ref:`setQuadColor`(const :ref:`Vector2u`& gridPos, const :ref:`Color`& color); void :ref:`setQuadFree`(const :ref:`Vector2u`& gridPos, const :ref:`Vector2f`& pos0, const :ref:`Vector2f`& pos1, const :ref:`Vector2f`& pos2, const :ref:`Vector2f`& pos3, const :ref:`Color`& color); void :ref:`setQuadTexCoords`(const :ref:`Vector2u`& gridPos, const :ref:`Rectf`& coords, const :ref:`Uint32`& textureLevel); void :ref:`setGridSize`(const :ref:`Sizei`& size); std::vector<:ref:`Vector2f`>& :ref:`getPositionArray`(); std::vector<:ref:`Color`>& :ref:`getColorArray`(); std::vector<:ref:`Uint32`>& :ref:`getIndices`(); std::vector<:ref:`Vector2f`>& :ref:`getTextureCoordArray`(const :ref:`Uint32`& textureLevel); :ref:`Uint32` :ref:`getVertexCount`(); :ref:`Uint32` :ref:`getIndexCount`(); :ref:`Color` :ref:`getColor`(const :ref:`Uint32`& index); :ref:`Uint32` :ref:`getIndex`(const :ref:`Uint32`& index); void :ref:`setElementNum`(:ref:`Int32` num); const :ref:`Int32`& :ref:`getElementNum`() const; virtual void :ref:`bind`() = 0; virtual void :ref:`unbind`() = 0; virtual void :ref:`draw`() = 0; virtual bool :ref:`compile`() = 0; virtual void :ref:`update`(const :ref:`Uint32`& types, bool indices) = 0; virtual void :ref:`reload`() = 0; virtual void :ref:`clear`(); .. _details-class_e_e_1_1_graphics_1_1_vertex_buffer_v_b_o: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ The Vertex Buffer VBO class is the implementation of a Vertex Buffer using the OpenGL VBOs. .. rubric:: See also: :ref:`VertexBuffer ` More information in `http://en.wikipedia.org/wiki/Vertex_Buffer_Object `__ Methods ------- .. index:: pair: function; bind .. _doxid-class_e_e_1_1_graphics_1_1_vertex_buffer_v_b_o_1a84e8cc9230e9149bf7d61abf18242297: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void bind() Activates the vertex buffer. .. index:: pair: function; draw .. _doxid-class_e_e_1_1_graphics_1_1_vertex_buffer_v_b_o_1a476e62e03fa004c51fb6c90d8629b2b5: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void draw() Draw the vertex buffer. .. index:: pair: function; compile .. _doxid-class_e_e_1_1_graphics_1_1_vertex_buffer_v_b_o_1a2ce04bbbc813df53db9bc0e48c386957: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool compile() Compile the vertex buffer. After adding all the vertex buffer data Compile() must be called to upload the data to the GPU. .. index:: pair: function; update .. _doxid-class_e_e_1_1_graphics_1_1_vertex_buffer_v_b_o_1a7b602832714f39e50652609fc0483f46: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void update(const :ref:`Uint32`& types, bool indices) Update is used in the case of some data is modified and need to be reuploaded to the GPU. .. index:: pair: function; reload .. _doxid-class_e_e_1_1_graphics_1_1_vertex_buffer_v_b_o_1a56effcefb3309bfc917cefc0bd454050: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void reload() Reupload all the data to the GPU. .. index:: pair: function; unbind .. _doxid-class_e_e_1_1_graphics_1_1_vertex_buffer_v_b_o_1ac19ffa2b6be9ed27fcdccfc5b5efed7b: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void unbind() Deactivates the vertex buffer. .. index:: pair: function; clear .. _doxid-class_e_e_1_1_graphics_1_1_vertex_buffer_v_b_o_1a940708a1001dbd2077e47abf18cd82c6: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void clear() Clear the cached data and destroy the buffers