lxgui
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 
10 namespace lxgui::gui::sfml {
11 
28 class vertex_cache final : public gui::vertex_cache {
29 public:
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 
60 private:
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.
void update(const vertex *vertex_data, std::size_t num_vertex) override
Update the data stored in the cache to form new triangles.
const sf::VertexBuffer & get_impl() const
Returns the SFML vertex buffer object.
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.
Definition: gui_vertex.hpp:12