lxgui
Loading...
Searching...
No Matches
gui_sfml_vertex_cache.hpp
1#ifndef LXGUI_GUI_SFML_VERTEX_CACHE_HPP
2#define LXGUI_GUI_SFML_VERTEX_CACHE_HPP
3
4#include "lxgui/gui_vertex_cache.hpp"
5#include "lxgui/utils.hpp"
6
7#include <SFML/Graphics/VertexBuffer.hpp>
8#include <memory>
9
10namespace lxgui::gui::sfml {
11
28class vertex_cache final : public gui::vertex_cache {
29public:
37 explicit vertex_cache(type t);
38
46 void update(const vertex* vertex_data, std::size_t num_vertex) override;
47
52 std::size_t get_vertex_count() const;
53
58 const sf::VertexBuffer& get_impl() const;
59
60private:
61 sf::VertexBuffer buffer_;
62};
63
64} // namespace lxgui::gui::sfml
65
66#endif
An object representing cached vertex data on the GPU.
vertex_cache(type t)
Constructor.
const sf::VertexBuffer & get_impl() const
Returns the SFML vertex buffer object.
void update(const vertex *vertex_data, std::size_t num_vertex) override
Update the data stored in the cache to form new triangles.
std::size_t get_vertex_count() const
Returns the number of vertices currently stored in the cache.
An object representing cached vertex data on the GPU.
type
The type of vertex data contained in a vertex_cache.
Holds position, texture coordinate, and color information for drawing.