bitmapFont.h

00001 
00002 /* Copyright (c) 2008-2009, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #ifndef EQUTIL_BITMAPFONT_H
00019 #define EQUTIL_BITMAPFONT_H
00020 
00021 #include <eq/base/base.h>
00022 #include <eq/client/os.h>           // GL prototypes
00023 #include <eq/client/windowSystem.h> // enum used
00024 
00025 #include <string>
00026 
00027 namespace eq
00028 {
00029     class Window;
00030 namespace util
00031 {
00032     template< typename T > class ObjectManager;
00033 
00035     template< typename OMT > class BitmapFont
00036     {
00037     public:
00039         EQ_EXPORT BitmapFont( ObjectManager< OMT >& gl, const OMT& key );
00040         EQ_EXPORT ~BitmapFont();
00041 
00042         // needs current context or XGetCurrentDisplay()
00043         EQ_EXPORT bool init( const WindowSystem ws, const std::string& name,
00044                              const uint32_t size = 12 );
00045         EQ_EXPORT void exit();
00046         EQ_EXPORT void draw( const std::string& text ) const;
00047 
00048     private:
00049         ObjectManager< OMT > _gl;
00050         const OMT            _key;
00051 
00052         bool _initGLX( const std::string& name, const uint32_t size );
00053         bool _initWGL( const std::string& name, const uint32_t size );
00054         bool _initAGL( const std::string& name, const uint32_t size );
00055 
00056         GLuint _setupLists( const GLsizei num );
00057     };
00058 }
00059 }
00060 #endif  // EQUTIL_BITMAPFONT_H
Generated on Sat Feb 6 12:59:42 2010 for Equalizer 0.9.1 by  doxygen 1.6.1