diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-12-25 13:54:09 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-12-25 13:54:09 +0000 |
commit | f949692714e72a0e2d45ebb6a5d698424ab71dee (patch) | |
tree | cfab638d8c4d35c297e981773cfee1a9af3490ee /yage/render/batch.h | |
parent | 022a4bdd81332ce67d799be6a06afb42ae45ac2e (diff) | |
download | YAGE-f949692714e72a0e2d45ebb6a5d698424ab71dee.tar.gz YAGE-f949692714e72a0e2d45ebb6a5d698424ab71dee.zip |
[Broken] Reorganising and fixing.
Diffstat (limited to 'yage/render/batch.h')
-rw-r--r-- | yage/render/batch.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/yage/render/batch.h b/yage/render/batch.h new file mode 100644 index 00000000..e301531c --- /dev/null +++ b/yage/render/batch.h @@ -0,0 +1,39 @@ +#ifndef YAGE_CORE_BATCH_H +#define YAGE_CORE_BATCH_H + +namespace yage +{ + +/** The Batch class will be the base class for all the different batching + * processes that might use different shaders and attributes. This is necessary + * because when we use a different shader, we have to bind a specific number + * of attributes, and we might not always want to have a texture, colours and + * coordinates, for example, when only using simple shapes. + * + * Batching + * ======== + * The purpose of batching is to combine all sprites that use the same textures + * so that the textures does not have to be switched out on the gpu very often. + * This produces a much more efficient rendering process. An implementation of + * this can be seen in the SpriteBatch class, as it sorts and renders the + * objects you give it. + * + * The reason this base class exists, is because it makes it easier to also + * render objects that may not need a texture, or may require multiple textures + * or different attributes. + */ +class Batch +{ +public: + virtual bool init(); + virtual void begin(); + virtual void end(); + virtual void draw(); + virtual void render(); + +protected: +}; + +} // namespace yage + +#endif |