#pragma once
#include "../../stdafx.h"
#include "../glLibError.h"

class glLibInternal_mesh {
	public:
		unsigned long face_type, numof_faces;

		unsigned long numof_indices;
		GLuint*   vindices;
		GLuint*   nindices;
		GLuint*   tindices;
		GLuint* tanindices;

		//Used to store data from glLibObject, indexed by the indices in theis class
		//Needed for drawing with arrays and VBOs
		GLfloat *array_vertices, *array_normals, *array_texcoords, *array_tangents;
		bool has_arrays;
		GLuint vbo_vertices, vbo_normals, vbo_texcoords, vbo_tangents;
		bool has_vbos;

		bool has_texcoords;
		bool   has_normals;
		bool  has_tangents;

		string requested_material_name;

		char verts_per_face;

	public:
		glLibInternal_mesh(void);
		~glLibInternal_mesh(void);

		//Set the face type and allocate space for the index data
		void init(void);

	protected:
		//prevent us from copying the data
		glLibInternal_mesh(const glLibInternal_mesh& copy_tex) {
			throw glLibError("A mesh's copy constructor was somehow used!");
		}
		glLibInternal_mesh& operator=(glLibInternal_mesh const &assign_tex) {
			throw glLibError("A mesh's assignment operator was somehow used!");
			return *this;
		}
};