![]() |
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.16 2002/03/12 07:11:30 fox Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXGLVISUAL_H 00025 #define FXGLVISUAL_H 00026 00027 #ifndef FXVISUAL_H 00028 #include "FXVisual.h" 00029 #endif 00030 00031 namespace FX { 00032 00033 00034 class FXFont; 00035 class FXWindow; 00036 class FXImage; 00037 class FXIcon; 00038 class FXBitmap; 00039 class FXDCWindow; 00040 class FXGLCanvas; 00041 00042 00043 /// Visual describes pixel format of a drawable 00044 class FXAPI FXGLVisual : public FXVisual { 00045 FXDECLARE(FXGLVisual) 00046 friend class FXWindow; 00047 friend class FXImage; 00048 friend class FXIcon; 00049 friend class FXBitmap; 00050 friend class FXDCWindow; 00051 friend class FXGLCanvas; 00052 protected: 00053 FXint redSize; // Desired #bits for red 00054 FXint greenSize; // Desired #bits for green 00055 FXint blueSize; // Desired #bits for blue 00056 FXint alphaSize; // Desired #bits for alpha 00057 FXint depthSize; // Desired #bits for Z 00058 FXint stencilSize; // Desired #bits for stencil 00059 FXint accumRedSize; // Desired #bits for accum red 00060 FXint accumGreenSize; // Desired #bits for accum green 00061 FXint accumBlueSize; // Desired #bits for accum blue 00062 FXint accumAlphaSize; // Desired #bits for accum alpha 00063 protected: 00064 FXGLVisual(); 00065 #ifdef WIN32 00066 void makeOpenGLPalette(); 00067 #endif 00068 private: 00069 FXGLVisual(const FXGLVisual&); 00070 FXGLVisual &operator=(const FXGLVisual&); 00071 public: 00072 00073 /// Construct default visual 00074 FXGLVisual(FXApp* a,FXuint flags); 00075 00076 /// Create visual 00077 virtual void create(); 00078 00079 /// Detach visual 00080 virtual void detach(); 00081 00082 /// Destroy visual 00083 virtual void destroy(); 00084 00085 /// Get sizes for bit-planes 00086 FXint getRedSize() const { return redSize; } 00087 FXint getGreenSize() const { return greenSize; } 00088 FXint getBlueSize() const { return blueSize; } 00089 FXint getAlphaSize() const { return alphaSize; } 00090 FXint getDepthSize() const { return depthSize; } 00091 FXint getStencilSize() const { return stencilSize; } 00092 FXint getAccumRedSize() const { return accumRedSize; } 00093 FXint getAccumGreenSize() const { return accumGreenSize; } 00094 FXint getAccumBlueSize() const { return accumBlueSize; } 00095 FXint getAccumAlphaSize() const { return accumAlphaSize; } 00096 00097 /// Set sizes for bit-planes 00098 void setRedSize(FXint rs){ redSize=rs; } 00099 void setGreenSize(FXint gs){ greenSize=gs; } 00100 void setBlueSize(FXint bs){ blueSize=bs; } 00101 void setAlphaSize(FXint as){ alphaSize=as; } 00102 void setDepthSize(FXint ds){ depthSize=ds; } 00103 void setStencilSize(FXint ss){ stencilSize=ss; } 00104 void setAccumRedSize(FXint rs){ accumRedSize=rs; } 00105 void setAccumGreenSize(FXint gs){ accumGreenSize=gs; } 00106 void setAccumBlueSize(FXint bs){ accumBlueSize=bs; } 00107 void setAccumAlphaSize(FXint as){ accumAlphaSize=as; } 00108 00109 /// Get ACTUAL sizes for bit-planes 00110 FXint getActualRedSize() const; 00111 FXint getActualGreenSize() const; 00112 FXint getActualBlueSize() const; 00113 FXint getActualAlphaSize() const; 00114 FXint getActualDepthSize() const; 00115 FXint getActualStencilSize() const; 00116 FXint getActualAccumRedSize() const; 00117 FXint getActualAccumGreenSize() const; 00118 FXint getActualAccumBlueSize() const; 00119 FXint getActualAccumAlphaSize() const; 00120 00121 /// Is it double buffered? 00122 FXbool isDoubleBuffer() const; 00123 00124 /// Is it stereo? 00125 FXbool isStereo() const; 00126 00127 /// Is it hardware-accelerated? 00128 FXbool isAccelerated() const; 00129 00130 /// Save visual info to a stream 00131 virtual void save(FXStream& store) const; 00132 00133 /// Load visual info to a stream 00134 virtual void load(FXStream& store); 00135 00136 /// Destructor 00137 virtual ~FXGLVisual(); 00138 }; 00139 00140 00141 /// Create a display list of bitmaps from font glyphs in a font 00142 extern FXAPI void glUseFXFont(FXFont* font,int first,int count,int list); 00143 00144 } 00145 00146 #endif