Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

/home/jeroen/FOX/fox/fox-1.7.33/include/FXGLVisual.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                            V i s u a l   C l a s s                            *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1999,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (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                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXGLVISUAL_H
00022 #define FXGLVISUAL_H
00023 
00024 #ifndef FXVISUAL_H
00025 #include "FXVisual.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 class FXFont;
00032 class FXWindow;
00033 class FXImage;
00034 class FXIcon;
00035 class FXBitmap;
00036 class FXDCWindow;
00037 
00038 
00040 class FXAPI FXGLVisual : public FXVisual {
00041   FXDECLARE(FXGLVisual)
00042   friend class FXWindow;
00043   friend class FXImage;
00044   friend class FXIcon;
00045   friend class FXBitmap;
00046   friend class FXDCWindow;
00047 protected:
00048   struct FXGLSpecs;
00049 protected:
00050   FXuchar redSize;              // Red bits
00051   FXuchar greenSize;            // Green depth
00052   FXuchar blueSize;             // Blue bits
00053   FXuchar alphaSize;            // Alpha bits
00054   FXuchar depthSize;            // Depth bits
00055   FXuchar stencilSize;          // Stencil bits
00056   FXuchar multiSamples;         // Multi-sampling
00057   FXuchar accumRedSize;         // Red accu buffer bits
00058   FXuchar accumGreenSize;       // Green accu buffer bits
00059   FXuchar accumBlueSize;        // Blue accu buffer bits
00060   FXuchar accumAlphaSize;       // Alpha accu buffer bits
00061   FXuchar actualRedSize;        // Actual Red bits
00062   FXuchar actualGreenSize;      // Actual Green depth
00063   FXuchar actualBlueSize;       // Actual Blue bits
00064   FXuchar actualAlphaSize;      // Actual Alpha bits
00065   FXuchar actualDepthSize;      // Actual Depth bits
00066   FXuchar actualStencilSize;    // Actual Stencil bits
00067   FXuchar actualMultiSamples;   // Actual multi-sampling
00068   FXuchar actualAccumRedSize;   // Actual Red accu buffer bits
00069   FXuchar actualAccumGreenSize; // Actual Green accu buffer bits
00070   FXuchar actualAccumBlueSize;  // Actual Blue accu buffer bits
00071   FXuchar actualAccumAlphaSize; // Actual Alpha accu buffer bits
00072   FXbool  doubleBuffer;
00073   FXbool  stereoBuffer;
00074   FXbool  accelerated;
00075   FXbool  copying;
00076 protected:
00077   FXGLVisual();
00078 private:
00079   FXGLVisual(const FXGLVisual&);
00080   FXGLVisual &operator=(const FXGLVisual&);
00081   FXint matchSpecs(const FXGLSpecs& s);
00082 public:
00083 
00085   FXGLVisual(FXApp* a,FXuint flgs=VISUAL_DOUBLE_BUFFER);
00086 
00088   virtual void create();
00089 
00091   virtual void detach();
00092 
00094   virtual void destroy();
00095 
00097   FXint getRedSize() const { return redSize; }
00098   FXint getGreenSize() const { return greenSize; }
00099   FXint getBlueSize() const { return blueSize; }
00100   FXint getAlphaSize() const { return alphaSize; }
00101   FXint getDepthSize() const { return depthSize; }
00102   FXint getStencilSize() const { return stencilSize; }
00103   FXint getMultiSamples() const { return multiSamples; }
00104   FXint getAccumRedSize() const { return accumRedSize; }
00105   FXint getAccumGreenSize() const { return accumGreenSize; }
00106   FXint getAccumBlueSize() const { return accumBlueSize; }
00107   FXint getAccumAlphaSize() const { return accumAlphaSize; }
00108 
00110   void setRedSize(FXint rs){ redSize=rs; }
00111   void setGreenSize(FXint gs){ greenSize=gs; }
00112   void setBlueSize(FXint bs){ blueSize=bs; }
00113   void setAlphaSize(FXint as){ alphaSize=as; }
00114   void setDepthSize(FXint ds){ depthSize=ds; }
00115   void setStencilSize(FXint ss){ stencilSize=ss; }
00116   void setMultiSamples(FXint ms){ multiSamples=ms; }
00117   void setAccumRedSize(FXint rs){ accumRedSize=rs; }
00118   void setAccumGreenSize(FXint gs){ accumGreenSize=gs; }
00119   void setAccumBlueSize(FXint bs){ accumBlueSize=bs; }
00120   void setAccumAlphaSize(FXint as){ accumAlphaSize=as; }
00121 
00123   FXint getActualRedSize() const { return actualRedSize; }
00124   FXint getActualGreenSize() const { return actualGreenSize; }
00125   FXint getActualBlueSize() const { return actualBlueSize; }
00126   FXint getActualAlphaSize() const { return actualAlphaSize; }
00127   FXint getActualDepthSize() const { return actualDepthSize; }
00128   FXint getActualStencilSize() const { return actualStencilSize; }
00129   FXint getActualMultiSamples() const { return actualMultiSamples; }
00130   FXint getActualAccumRedSize() const { return actualAccumRedSize; }
00131   FXint getActualAccumGreenSize() const { return actualAccumGreenSize; }
00132   FXint getActualAccumBlueSize() const { return actualAccumBlueSize; }
00133   FXint getActualAccumAlphaSize() const { return actualAccumAlphaSize; }
00134 
00136   FXbool isDoubleBuffer() const { return doubleBuffer; }
00137 
00139   FXbool isStereo() const { return stereoBuffer; }
00140 
00142   FXbool isAccelerated() const { return accelerated; }
00143 
00145   FXbool isBufferSwapCopy() const { return copying; }
00146 
00148   static FXbool hasOpenGL(FXApp* application);
00149 
00151   virtual void save(FXStream& store) const;
00152 
00154   virtual void load(FXStream& store);
00155 
00157   virtual ~FXGLVisual();
00158   };
00159 
00160 }
00161 
00162 #endif

Copyright © 1997-2011 Jeroen van der Zijp