25 #ifndef SFML_VERTEXBUFFER_HPP
26 #define SFML_VERTEXBUFFER_HPP
31 #include <SFML/Graphics/Export.hpp>
32 #include <SFML/Graphics/PrimitiveType.hpp>
33 #include <SFML/Graphics/Drawable.hpp>
34 #include <SFML/Window/GlResource.hpp>
198 bool update(
const Vertex* vertices, std::size_t vertexCount,
unsigned int offset);
337 unsigned int m_buffer;
346 #endif // SFML_VERTEXBUFFER_HPP
std::size_t getVertexCount() const
Return the vertex count.
bool create(std::size_t vertexCount)
Create the vertex buffer.
void setUsage(Usage usage)
Set the usage specifier of this vertex buffer.
Vertex buffer storage for one or more 2D primitives.
VertexBuffer()
Default constructor.
unsigned int getNativeHandle() const
Get the underlying OpenGL handle of the vertex buffer.
VertexBuffer(const VertexBuffer ©)
Copy constructor.
~VertexBuffer()
Destructor.
Abstract base class for objects that can be drawn to a render target.
PrimitiveType getPrimitiveType() const
Get the type of primitives drawn by the vertex buffer.
Base class for classes that require an OpenGL context.
void swap(VertexBuffer &right)
Swap the contents of this vertex buffer with those of another.
VertexBuffer(PrimitiveType type, Usage usage)
Construct a VertexBuffer with a specific PrimitiveType and usage specifier.
Define the states used for drawing to a RenderTarget.
bool update(const VertexBuffer &vertexBuffer)
Copy the contents of another buffer into this buffer.
static bool isAvailable()
Tell whether or not the system supports vertex buffers.
@ Stream
Constantly changing data.
bool update(const Vertex *vertices)
Update the whole buffer from an array of vertices.
void setPrimitiveType(PrimitiveType type)
Set the type of primitives to draw.
static void bind(const VertexBuffer *vertexBuffer)
Bind a vertex buffer for rendering.
@ Dynamic
Occasionally changing data.
Base class for all render targets (window, texture, ...)
Define a point with color and texture coordinates.
VertexBuffer(PrimitiveType type)
Construct a VertexBuffer with a specific PrimitiveType.
VertexBuffer(Usage usage)
Construct a VertexBuffer with a specific usage specifier.
bool update(const Vertex *vertices, std::size_t vertexCount, unsigned int offset)
Update a part of the buffer from an array of vertices.
PrimitiveType
Types of primitives that a sf::VertexArray can render.
Usage getUsage() const
Get the usage specifier of this vertex buffer.