00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Joe Drew 00008 * Side Effects Software Inc 00009 * 123 Front Street West, Suite 1401 00010 * Toronto, Ontario 00011 * Canada M5J 2M2 00012 * 416-504-9876 00013 * 00014 * NAME: RE_OGLFont.h (RE Library, C++) 00015 * 00016 * COMMENTS: 00017 */ 00018 00019 #ifndef __RE_OGLFont__ 00020 #define __RE_OGLFont__ 00021 00022 #include "RE_API.h" 00023 00024 #include "RE_Font.h" 00025 00026 class RE_OGLFontCache; 00027 class RE_Render; 00028 00029 class RE_API RE_OGLFont : public RE_Font 00030 { 00031 public: 00032 RE_OGLFont(const char *name, float size, RE_OGLFontCache *cache); 00033 00034 ~RE_OGLFont(); 00035 00036 /// Get whether this font has deferred its creation of display lists. 00037 /// The cache can, for example, call loadCache at a more convenient 00038 /// time when this is true. 00039 bool getListsRequested() 00040 { return myListsRequested; } 00041 00042 /// Load this font and generate its display lists. This should be called 00043 /// only when getListsRequested returns false. 00044 void loadCache(RE_Render *r); 00045 00046 protected: // methods 00047 00048 /// Generate display lists for this font. Override this in subclasses, 00049 /// and set myListsCreated to true when they have been. 00050 virtual void genDisplayLists(RE_Render *r) = 0; 00051 00052 protected: // variables 00053 00054 // The font cache that created us. 00055 RE_OGLFontCache *myFontCache; 00056 00057 // Whether myDisplayListBase is valid - that is, whether we've successfully 00058 // created our display lists. 00059 bool myListsCreated; 00060 00061 // The base number for our display lists. Used in glCallLists. 00062 unsigned int myDisplayListBase; 00063 00064 // The following flag is set when the display lists for this font needed 00065 // to be loaded but were unable to. 00066 bool myListsRequested; 00067 }; 00068 #endif
1.5.9