Click here to Skip to main content
15,893,668 members
Articles / Mobile Apps / iPhone

FreeType on OpenGL ES (iPhone)

Rate me:
Please Sign up or sign in to vote.
4.75/5 (10 votes)
24 Nov 2010CPOL4 min read 86.9K   3K   27  
Faster, smarter and better looking fonts rendered with OpenGL ES
#ifndef _RESMANAGER_H_INCLUDED_
#define _RESMANAGER_H_INCLUDED_

#include "GLCallBatcher.h"

class FontAtlas;
class FTBitmapFont;


class ResManager
{
public:
	ResManager();
	~ResManager();
	const string& GetDirResources() const
	{
		return m_dirResources;
	}
	int GetScreenHeight() const
	{
		return m_screenHeight;
	}
	int GetScreenWidth() const
	{
		return m_screenWidth;
	}
	bool IsInitalised() const
	{
		return m_initialised;
	}
	void Init(const string& dirResources, const string& dirUser, 
		int width, int height);
	void Release();
	GLCallBatcher& GetBatcher() 
	{
		return m_batcher;
	}
	const string& GetDirUser() const
	{
		return m_dirUser;
	}
	FTBitmapFont* GetFTFont(int index);
	FontAtlas* GetFontAtlas() const
	{
		return m_pFontAtlas;
	}
private:
	int m_screenWidth;
	int m_screenHeight;

	string m_dirResources;
	bool m_initialised;
	GLCallBatcher m_batcher;
	string m_dirUser;
	FontAtlas* m_pFontAtlas;
};

extern ResManager g_resManager;



#endif // _RESMANAGER_H_INCLUDED_

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Astronautz
Spain Spain
After working in the software industry for many years, I've started my own games company that specialises in strategy games for mobile platforms.

Comments and Discussions