<commit_before>/* ---------------------------------------------------------------- *
   Author: Kuumies <<EMAIL>>
   Desc:   Definition of kuu::opengl::Quad class.
 * ---------------------------------------------------------------- */

#pragma once

#include <memory>

class QMatrix4x4;

namespace kuu
{
namespace opengl
{

/* ---------------------------------------------------------------- *
   A quad mesh.
 * ---------------------------------------------------------------- */
class Quad
{
public:
    // Defines a shared pointer of quad.
    using Ptr = std::shared_ptr<Quad>;

    // Constructs the quad.
    Quad(float width = 1.0f, float height = 1.0f);

    // Updates the quad
    void update(float elapsed);

    // Renders the quad
    void render(const QMatrix4x4& view,
                const QMatrix4x4& projection);

private:
    struct Data;
    std::shared_ptr<Data> d;
};

} // namespace opengl
} // namespace kuu
<commit_msg>Added comments into quad class.<commit_after>/* ---------------------------------------------------------------- *
   Author: Kuumies <<EMAIL>>
   Desc:   Definition of kuu::opengl::Quad class.
 * ---------------------------------------------------------------- */

#pragma once

#include <memory>

class QMatrix4x4;

namespace kuu
{
namespace opengl
{

/* ---------------------------------------------------------------- *
   A quad mesh.

   The mesh is built so that the center of the quad is at the origo.
   Rendering is done with GLSL 3.3 core version. The OpenGL context
   must be valid when the Quad instance is constructed. If the con-
   struction fails then all the errors are printed into standard er-
   ror stream.

   Example:

    // Create quad
    Quad::Ptr quad = std::make_shared<Quad>(3.0f, 4.0f);
    ...
    // update the quad rotation
    quad.update(10); // 10 milliseconds
    ...
    // render the quad into currently bound framebuffer.
    QMatrix4x4 cameraViewMatrix       = getCameraViewMatrix();
    QMatrix4x4 cameraProjectionMatrix = getCameraProjectionMatrix();
    quad.render(cameraViewMatrix, cameraProjectionMatrix);

 * ---------------------------------------------------------------- */
class Quad
{
public:
    // Defines a shared pointer of quad.
    using Ptr = std::shared_ptr<Quad>;

    // Constructs the quad. OpenGL context must be valid.
    Quad(float width = 1.0f, float height = 1.0f);

    // Updates the quad rotation.
    void update(float elapsed);

    // Renders the quad
    void render(const QMatrix4x4& view,
                const QMatrix4x4& projection);

private:
    struct Data;
    std::shared_ptr<Data> d;
};

} // namespace opengl
} // namespace kuu

{'fraction_non_alphanumeric': 0.2763800225309801, 'fraction_numerical': 0.012767555388659407, 'mean_word_length': 1.4240218380345768, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3780583', 'n_tokens_mistral': 723, 'n_tokens_neox': 693, 'n_words': 226}