00001 /***************************************************************************** 00002 * SGL: A Scene Graph Library 00003 * 00004 * Copyright (C) 1997-2001 Scott McMillan All Rights Reserved. 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public 00017 * License along with this library; if not, write to the Free 00018 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 ***************************************************************************** 00020 * File: sglBitmapFontWGL.hpp 00021 * Created: 13 April 2001 (separated from sglBitmapFont.hpp) 00022 * Summary: Windows bitmap font class. To reduce dependency of sgl.h on 00023 * windows.h (through sglBitmapFont.hpp) 00024 *****************************************************************************/ 00025 00026 #ifndef __SGL_BITMAP_FONT_WGL_HPP 00027 #define __SGL_BITMAP_FONT_WGL_HPP 00028 00029 #if defined(WIN32) 00030 00031 #include <windows.h> 00032 #include <sglBitMapFont.hpp> 00033 #include <string> 00034 00035 //============================================================================ 00036 00038 00039 class SGL_DLL_API sglBitmapFontWGL : public sglBitmapFont 00040 { 00041 public: 00046 sglBitmapFontWGL(HFONT font); 00047 00049 ~sglBitmapFontWGL(); 00050 00055 virtual sglBitmapFont* clone() const; 00056 00063 virtual void rasterString(const char *str, int len = -1) const; 00064 00068 virtual unsigned int getHeight() const; 00069 00073 virtual unsigned int getDescent() const; 00074 00079 virtual unsigned int getCharWidth(char c) const; 00080 00081 private: // not implemented 00082 sglBitmapFontWGL(); 00083 sglBitmapFontWGL(const sglBitmapFontWGL &); 00084 sglBitmapFontWGL &operator=(const sglBitmapFontWGL &); 00085 00086 private: 00087 HFONT m_font; 00088 GLuint m_list_base; 00089 unsigned int m_height; 00090 unsigned int m_descent; 00091 unsigned int m_widths[128]; 00092 }; 00093 00094 #endif // WIN32 00095 #endif