<commit_before>/* ************************************************************************** */
/*                                                                            */
/*                                                                            */
/*    StaticSpriteBatch.hpp                          oooooo       oooooo      */
/*                                                 oooooooooo   oooooooooo    */
/*                                                         o%%%%%o            */
/*                                                         %:::::%            */
/*                                                        %:::::::%           */
/*    This file is part of the                             %:::::%            */
/*    Lums library.                                         %%%%%             */
/*                                                                            */
/* ************************************************************************** */

#ifndef LUMS_STATIC_SPRITE_BATCH_HPP
#define LUMS_STATIC_SPRITE_BATCH_HPP

#include <LumsInclude/Graphics/VertexBuffer.hpp>
#include <LumsInclude/Graphics/Texture.hpp>
#include <LumsInclude/Graphics/Sprite.hpp>
#include <LumsInclude/Graphics/Font.hpp>
#include <LumsInclude/ExportDll.hpp>

namespace lm
{
    /**
     * @brief A class representing a static batch of bidimensional graphical elements
     */
    class StaticSpriteBatch
    {
    public:
        /**
         * Create a static sprite batch
         */
        StaticSpriteBatch();

        /**
         * Draw a texture into the batch
         * @param texture The texture to be drawn
         * @param atlas The atlas
         * @param pos The screen position
         * @param scale The scale
         * @param color The color
         * @param flip The flip values
         */
        LUMS_EXPORTED void              draw(const Texture& texture,
                                             int atlas = 0,
                                             Vector2f pos = {0.f, 0.f},
                                             Vector2f scale = {1.f, 1.f},
                                             Vector4f color = {1.f, 1.f, 1.f, 1.f},
                                             Vector2b flip = {false, false});

        /**
         * Draw a sprite into the batch
         * @param sprite The sprite
         */
        LUMS_EXPORTED void              draw(const Sprite& sprite);

        /**
         * Draw text into the batch
         * @param font The font
         * @param text The text to be rendererd
         * @param pos The text position
         * @param color The text color
         */
        LUMS_EXPORTED void              draw(const Font& font,
                                             const char* text,
                                             Vector2f pos = {0.f, 0.f},
                                             Vector4f color = {1.f, 1.f, 1.f, 1.f});

        /**
         * Set the batch texture
         * @param texture The texture
         */
        LUMS_EXPORTED void              setTexture(const Texture* texture);

        /**
         * Send the batch to the GPU
         */
        LUMS_EXPORTED void              send();

        /**
         * Flush the batch
         */
        LUMS_EXPORTED void              flush();

        /**
         * Render the batch
         */
        LUMS_EXPORTED void              render();

        /**
         * Sprite batch dtor
         */
        ~StaticSpriteBatch();

    protected:
        /**<commit_msg>bugfix #2<commit_after>/* ************************************************************************** */
/*                                                                            */
/*                                                                            */
/*    StaticSpriteBatch.hpp                          oooooo       oooooo      */
/*                                                 oooooooooo   oooooooooo    */
/*                                                         o%%%%%o            */
/*                                                         %:::::%            */
/*                                                        %:::::::%           */
/*    This file is part of the                             %:::::%            */
/*    Lums library.                                         %%%%%             */
/*                                                                            */
/* ************************************************************************** */

#ifndef LUMS_STATIC_SPRITE_BATCH_HPP
#define LUMS_STATIC_SPRITE_BATCH_HPP

#include <LumsInclude/Graphics/VertexBuffer.hpp>
#include <LumsInclude/Graphics/Texture.hpp>
#include <LumsInclude/Graphics/Sprite.hpp>
#include <LumsInclude/Graphics/Font.hpp>
#include <LumsInclude/ExportDll.hpp>

namespace lm
{
    /**
     * @brief A class representing a static batch of bidimensional graphical elements
     */
    class StaticSpriteBatch
    {
    public:
        /**
         * Create a static sprite batch
         */
        StaticSpriteBatch();

        /**
         * Draw a texture into the batch
         * @param texture The texture to be drawn
         * @param atlas The atlas
         * @param pos The screen position
         * @param scale The scale
         * @param color The color
         * @param flip The flip values
         */
        LUMS_EXPORTED void              draw(const Texture& texture,
                                             int atlas = 0,
                                             Vector2f pos = {0.f, 0.f},
                                             Vector2f scale = {1.f, 1.f},
                                             Vector4f color = {1.f, 1.f, 1.f, 1.f},
                                             Vector2b flip = {false, false});

        /**
         * Draw a sprite into the batch
         * @param sprite The sprite
         */
        LUMS_EXPORTED void              draw(const Sprite& sprite);

        /**
         * Draw text into the batch
         * @param font The font
         * @param text The text to be rendererd
         * @param pos The text position
         * @param color The text color
         */
        LUMS_EXPORTED void              draw(const Font& font,
                                             const char* text,
                                             Vector2f pos = {0.f, 0.f},
                                             Vector4f color = {1.f, 1.f, 1.f, 1.f});

        /**
         * Set the batch texture
         * @param texture The texture
         */
        LUMS_EXPORTED virtual void      setTexture(const Texture* texture);

        /**
         * Send the batch to the GPU
         */
        LUMS_EXPORTED void              send();

        /**
         * Flush the batch
         */
        LUMS_EXPORTED void              flush();

        /**
         * Render the batch
         */
        LUMS_EXPORTED void              render();

        /**
         * Sprite batch dtor
         */
        ~StaticSpriteBatch();

    protected:
        /**
{'fraction_non_alphanumeric': 0.12440123978585517, 'fraction_numerical': 0.006058044519582981, 'mean_word_length': 0.8775456228510976, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 72, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3220322', 'n_tokens_mistral': 1579, 'n_tokens_neox': 1466, 'n_words': 422}