
.. _program_listing_file_Src_GraphicsEngineOpenGL_scene_Mesh.ixx:

Program Listing for File Mesh.ixx
=================================

|exhale_lsh| :ref:`Return to documentation for file <file_Src_GraphicsEngineOpenGL_scene_Mesh.ixx>` (``Src/GraphicsEngineOpenGL/scene/Mesh.ixx``)

.. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS

.. code-block:: cpp

   module;
   
   #include <glad/glad.h>
   #include <glm/glm.hpp>
   #include <vector>
   
   #include "hostDevice/GlobalValues.hpp"
   
   export module kataglyphis.opengl.mesh;
   
   import kataglyphis.opengl.vertex;
   
   export class Mesh
   {
     public:
       Mesh(std::vector<Vertex> &vertices, std::vector<unsigned int> &indices);
   
       Mesh();
   
       void render() const;
   
       std::vector<Vertex> getVertices() const { return this->vertices; }
       std::vector<unsigned int> getIndices() const { return this->indices; }
   
       ~Mesh();
   
     private:
       //  render data
       // unsigned int VAO, VBO, EBO;
       enum {
           POSITION = 0,
           NORMAL = 1,
           COLOR = 2,
           TEXTURECOORD = 3
   
       };
   
       enum { POSITION_VB, NUM_BUFFERS };
   
       // Vertex Array Object
       GLuint m_vao{}, m_ibo{};
       // Vertex array buffer
       GLuint m_vab[NUM_BUFFERS]{};
   
       uint32_t m_drawCount;
       std::vector<Vertex> vertices;
       std::vector<uint32_t> indices;
   };
