#ifndef _FREETYPE_H_
#define _FREETYPE_H_

#include "../App/EngineH.h"

// LIB FREETYPE
#pragma comment(lib,"libfreetype.lib")

// FreeType Headers
#include <ft2build.h>
#include <freetype/freetype.h>
#include <freetype/ftglyph.h>
#include <freetype/ftoutln.h>
#include <freetype/fttrigon.h>

// OpenGL Headers  
#include <windows.h>		//(the GL headers need it)
#include <GL/gl.h>
#include <GL/glu.h>

// Some STL headers
#include <vector>
#include <string>
#include <stdexcept>

const char TEXT_NONE = 0;
const char TEXT_LEFT = 1;
const char TEXT_CENTER = 2;
const char TEXT_RIGHT = 2;

// pragma warning 4786 - znamena ze si kompilator skracuje nazvy
#pragma warning(disable: 4786) 

struct font_data 
{
	float h;			
	GLuint * textures;	
	GLuint list_base;	

	void init(const char * fname, unsigned int h);
	void clean();
};

class C_FREETYPE_0
{
private :
	font_data _ft_font;
	bool _pr_delete;
	std::string _file_name;
	unsigned int _vel;
	char _align;

public :
	C_FREETYPE_0();
	C_FREETYPE_0(std::string file_name,unsigned int vel);
	~C_FREETYPE_0();
	
public :
	int lenght[1024];
	int lines;
	int GetHeightChar() const {return _ft_font.h;}
	void LoadFont(font_data fd);
	void LoadFont(std::string file_name,unsigned int vel);
	void LoadFont();
	void Print(float x, float y, const char *fmt, ...);
	void Delete();

	// ALIGN
	void SetAlign(char alg){_align = alg;}
	char GetAlign() const {return _align;}
};

#endif //_FREETYPE_H_