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