00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2019 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : VSG (MMM YYYY) 00022 **=======================================================================*/ 00023 #ifndef _SO_GL_GRAPHIC_DEVICE_H_ 00024 #define _SO_GL_GRAPHIC_DEVICE_H_ 00025 00026 #if defined(_WIN32) 00027 # include <windows.h> // for HDC def 00028 # ifdef _SO_QT_ 00029 # include <wingdi.h> 00030 # else 00031 # include <Inventor/Win/SoWinDef.h> 00032 # endif 00033 #else 00034 # include <Inventor/helpers/SbGlContextHelper.h> 00035 #endif 00036 #include <Inventor/sys/port.h> 00037 00038 #include <Inventor/components/SoGraphicDevice.h> 00039 #include <Inventor/components/SoGraphicConfig.h> 00040 #include <Inventor/components/SoGLGraphicConfig.h> 00041 #include <Inventor/components/SoGraphicConfigTemplate.h> 00042 #include <Inventor/components/SoGLGraphicConfigTemplate.h> 00043 00044 class SoGLGraphicDevicePeer; 00045 00069 class SoGLGraphicDevice : public SoGraphicDevice { 00070 00071 public: 00072 00074 enum DeviceType { 00076 WINDOW = 0, 00078 PBUFFER, 00080 BITMAP 00081 }; 00082 00086 SoGLGraphicDevice(SbGlContextHelper::Display display, DeviceType dt = SoGLGraphicDevice::WINDOW); 00087 00091 virtual ~SoGLGraphicDevice(); 00092 00096 SoGLGraphicDevice &operator()(SbGlContextHelper::Display display); 00097 00102 SoGraphicConfig *getBestGraphicConfig(const SoGraphicConfigTemplate &temp); 00103 00108 SoGraphicConfig *getDefaultGraphicConfig(); 00109 00137 SoGLGraphicConfigTemplate getGraphicConfigTemplate(SoGLGraphicConfig *graphicConfig); 00138 00143 size_t getNum(); 00144 00149 SoGraphicConfig *getGraphicConfig(size_t n); 00150 00155 size_t getNum(const SoGraphicConfigTemplate &temp); 00156 00161 SoGraphicConfig *getGraphicConfig(const SoGraphicConfigTemplate &temp, size_t n); 00162 00166 SbGlContextHelper::Display getDisplay(); 00167 00168 private: 00169 00170 size_t getNumSamplesAvailable(); 00174 int getNumSamples(size_t n); 00175 int findSampleIndex(int findInt); 00176 00177 private: 00178 00179 SoGLGraphicDevicePeer *m_devicePeer; 00180 void *m_sortedGraphicConfigs; 00181 SoGLGraphicConfigTemplate m_template; 00182 }; 00183 00184 #endif /* _SO_GL_GRAPHIC_DEVICE_H_ */ 00185 00186