Euphoria
spritebatch.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "base/rect.h"
4 #include "base/size2.h"
5 #include "base/vec2.h"
6 #include "base/angle.h"
7 #include "base/rgb.h"
8 
9 
10 namespace eu::render
11 {
12  // texture & shader will be handled by 2d world and sprite
13  struct SpriteBatch
14  {
15  public:
16  SpriteBatch();
18 
19  SpriteBatch(const SpriteBatch& other) = delete;
20  void operator=(const SpriteBatch&) = delete;
21  SpriteBatch(SpriteBatch&& other) = delete;
22  void operator=(SpriteBatch&&) = delete;
23 
24  void
25  begin();
26 
27  void
29  (
30  const vec2f& pos,
31  const size2f& quad,
32  const Rectf& uv,
33  const Scale2f& center,
34  const Angle& rotation,
35  const Rgba& color
36  );
37 
38  void
39  end();
40 
41  void
42  flush();
43 
44  private:
45  bool is_inside;
46  int current_quad_count;
47  int number_of_render_calls;
48  std::vector<float> vertex_data;
49  std::vector<int> quad_indices;
50  };
51 
52 }
Definition: rect.h:27
Definition: rgb.h:143
void operator=(const SpriteBatch &)=delete
SpriteBatch(const SpriteBatch &other)=delete
void render_quad(const vec2f &pos, const size2f &quad, const Rectf &uv, const Scale2f &center, const Angle &rotation, const Rgba &color)
Definition: spritebatch.cc:34
void operator=(SpriteBatch &&)=delete
SpriteBatch(SpriteBatch &&other)=delete
Definition: vec2.h:33