Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/OgreMain/include/OgreFontManager.h @ 1

Last change on this file since 1 was 1, checked in by landauf, 17 years ago
File size: 3.6 KB
Line 
1/*-------------------------------------------------------------------------
2This source file is a part of OGRE
3(Object-oriented Graphics Rendering Engine)
4
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2006 Torus Knot Software Ltd
8Also see acknowledgements in Readme.html
9
10This library is free software; you can redistribute it and/or modify it
11under the terms of the GNU Lesser General Public License (LGPL) as
12published by the Free Software Foundation; either version 2.1 of the
13License, or (at your option) any later version.
14
15This library is distributed in the hope that it will be useful, but
16WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
18License for more details.
19
20You should have received a copy of the GNU Lesser General Public License
21along with this library; if not, write to the Free Software Foundation,
22Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
23http://www.gnu.org/copyleft/lesser.txt
24-------------------------------------------------------------------------*/
25
26#ifndef _FontManager_H__
27#define _FontManager_H__
28
29#include "OgrePrerequisites.h"
30#include "OgreSingleton.h"
31#include "OgreResourceManager.h"
32#include "OgreFont.h"
33
34namespace Ogre
35{
36    /** Manages Font resources, parsing .fontdef files and generally organising them.*/
37    class _OgreExport FontManager : public ResourceManager, public Singleton< FontManager >
38    {
39    public:
40
41                FontManager();
42                ~FontManager();
43
44        /** @copydoc ScriptLoader::parseScript */
45        void parseScript(DataStreamPtr& stream, const String& groupName);
46        /** Override standard Singleton retrieval.
47        @remarks
48        Why do we do this? Well, it's because the Singleton
49        implementation is in a .h file, which means it gets compiled
50        into anybody who includes it. This is needed for the
51        Singleton template to work, but we actually only want it
52        compiled into the implementation of the class based on the
53        Singleton, not all of them. If we don't change this, we get
54        link errors when trying to use the Singleton-based class from
55        an outside dll.
56        @par
57        This method just delegates to the template version anyway,
58        but the implementation stays in this single compilation unit,
59        preventing link errors.
60        */
61        static FontManager& getSingleton(void);
62        /** Override standard Singleton retrieval.
63        @remarks
64        Why do we do this? Well, it's because the Singleton
65        implementation is in a .h file, which means it gets compiled
66        into anybody who includes it. This is needed for the
67        Singleton template to work, but we actually only want it
68        compiled into the implementation of the class based on the
69        Singleton, not all of them. If we don't change this, we get
70        link errors when trying to use the Singleton-based class from
71        an outside dll.
72        @par
73        This method just delegates to the template version anyway,
74        but the implementation stays in this single compilation unit,
75        preventing link errors.
76        */
77        static FontManager* getSingletonPtr(void);
78
79    protected:
80
81        /// Internal methods
82                Resource* createImpl(const String& name, ResourceHandle handle, 
83                        const String& group, bool isManual, ManualResourceLoader* loader, 
84            const NameValuePairList* params);
85                void parseAttribute(const String& line, FontPtr& pFont);
86
87        void logBadAttrib(const String& line, FontPtr& pFont);
88
89
90    };
91}
92
93#endif
Note: See TracBrowser for help on using the repository browser.