![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
00001 /******************************************************************************** 00002 * * 00003 * V i s u a l C l a s s * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 1999,2002 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU Lesser General Public * 00010 * License as published by the Free Software Foundation; either * 00011 * version 2.1 of the License, or (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * 00021 ********************************************************************************* 00022 * $Id: FXGLVisual.h,v 1.14 2002/01/18 22:42:53 jeroen Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXGLVISUAL_H 00025 #define FXGLVISUAL_H 00026 00027 #ifndef FXVISUAL_H 00028 #include "FXVisual.h" 00029 #endif 00030 00031 00032 00033 class FXFont; 00034 class FXWindow; 00035 class FXImage; 00036 class FXIcon; 00037 class FXBitmap; 00038 class FXDCWindow; 00039 class FXGLCanvas; 00040 00041 00042 /// Visual describes pixel format of a drawable 00043 class FXAPI FXGLVisual : public FXVisual { 00044 FXDECLARE(FXGLVisual) 00045 friend class FXWindow; 00046 friend class FXImage; 00047 friend class FXIcon; 00048 friend class FXBitmap; 00049 friend class FXDCWindow; 00050 friend class FXGLCanvas; 00051 protected: 00052 FXint redSize; // Desired #bits for red 00053 FXint greenSize; // Desired #bits for green 00054 FXint blueSize; // Desired #bits for blue 00055 FXint alphaSize; // Desired #bits for alpha 00056 FXint depthSize; // Desired #bits for Z 00057 FXint stencilSize; // Desired #bits for stencil 00058 FXint accumRedSize; // Desired #bits for accum red 00059 FXint accumGreenSize; // Desired #bits for accum green 00060 FXint accumBlueSize; // Desired #bits for accum blue 00061 FXint accumAlphaSize; // Desired #bits for accum alpha 00062 protected: 00063 FXGLVisual(); 00064 #ifdef WIN32 00065 void makeOpenGLPalette(); 00066 #endif 00067 private: 00068 FXGLVisual(const FXGLVisual&); 00069 FXGLVisual &operator=(const FXGLVisual&); 00070 public: 00071 00072 /// Construct default visual 00073 FXGLVisual(FXApp* a,FXuint flags); 00074 00075 /// Create visual 00076 virtual void create(); 00077 00078 /// Detach visual 00079 virtual void detach(); 00080 00081 /// Destroy visual 00082 virtual void destroy(); 00083 00084 /// Get sizes for bit-planes 00085 FXint getRedSize() const { return redSize; } 00086 FXint getGreenSize() const { return greenSize; } 00087 FXint getBlueSize() const { return blueSize; } 00088 FXint getAlphaSize() const { return alphaSize; } 00089 FXint getDepthSize() const { return depthSize; } 00090 FXint getStencilSize() const { return stencilSize; } 00091 FXint getAccumRedSize() const { return accumRedSize; } 00092 FXint getAccumGreenSize() const { return accumGreenSize; } 00093 FXint getAccumBlueSize() const { return accumBlueSize; } 00094 FXint getAccumAlphaSize() const { return accumAlphaSize; } 00095 00096 /// Set sizes for bit-planes 00097 void setRedSize(FXint rs){ redSize=rs; } 00098 void setGreenSize(FXint gs){ greenSize=gs; } 00099 void setBlueSize(FXint bs){ blueSize=bs; } 00100 void setAlphaSize(FXint as){ alphaSize=as; } 00101 void setDepthSize(FXint ds){ depthSize=ds; } 00102 void setStencilSize(FXint ss){ stencilSize=ss; } 00103 void setAccumRedSize(FXint rs){ accumRedSize=rs; } 00104 void setAccumGreenSize(FXint gs){ accumGreenSize=gs; } 00105 void setAccumBlueSize(FXint bs){ accumBlueSize=bs; } 00106 void setAccumAlphaSize(FXint as){ accumAlphaSize=as; } 00107 00108 /// Get ACTUAL sizes for bit-planes 00109 FXint getActualRedSize() const; 00110 FXint getActualGreenSize() const; 00111 FXint getActualBlueSize() const; 00112 FXint getActualAlphaSize() const; 00113 FXint getActualDepthSize() const; 00114 FXint getActualStencilSize() const; 00115 FXint getActualAccumRedSize() const; 00116 FXint getActualAccumGreenSize() const; 00117 FXint getActualAccumBlueSize() const; 00118 FXint getActualAccumAlphaSize() const; 00119 00120 /// Is it double buffered? 00121 FXbool isDoubleBuffer() const; 00122 00123 /// Is it stereo? 00124 FXbool isStereo() const; 00125 00126 /// Is it hardware-accelerated? 00127 FXbool isAccelerated() const; 00128 00129 /// Save visual info to a stream 00130 virtual void save(FXStream& store) const; 00131 00132 /// Load visual info to a stream 00133 virtual void load(FXStream& store); 00134 00135 /// Destructor 00136 virtual ~FXGLVisual(); 00137 }; 00138 00139 00140 /// Create a display list of bitmaps from font glyphs in a font 00141 extern FXAPI void glUseFXFont(FXFont* font,int first,int count,int list); 00142 00143 00144 00145 #endif