.. index:: pair: class; EE::Graphics::VertexBufferOGL .. _doxid-class_e_e_1_1_graphics_1_1_vertex_buffer_o_g_l: class EE::Graphics::VertexBufferOGL =================================== .. toctree:: :hidden: Overview ~~~~~~~~ The Vertex Buffer OGL is the implementation of a Vertex Buffer without using the specific VBOs extensions from OpenGL. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class VertexBufferOGL: public :ref:`EE::Graphics::VertexBuffer` { public: // construction :target:`VertexBufferOGL`(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`); // 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`(); }; 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_o_g_l: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ The Vertex Buffer OGL is the implementation of a Vertex Buffer without using the specific VBOs extensions from OpenGL. .. rubric:: See also: :ref:`VertexBuffer ` Methods ------- .. index:: pair: function; bind .. _doxid-class_e_e_1_1_graphics_1_1_vertex_buffer_o_g_l_1a876ca6ea03d2f194139d900bb830894b: .. 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_o_g_l_1ae34fca53a436681b2168a27899a16f6c: .. 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_o_g_l_1ae5dffc897ccf386feb763f1a27b3fffa: .. 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_o_g_l_1a0724eb856668dca1e98e721b9f932db5: .. 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_o_g_l_1a40d816a59ecb977273a9cf5bf05ab0c6: .. 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_o_g_l_1a3c6b6f3d8b06228379fa5baa1656c7d4: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void unbind() Deactivates the vertex buffer.