Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoGLExtension.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2017 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Rodolphe ALBOU (Oct 2001)
22**=======================================================================*/
23
24#ifndef _SO_GL_EXTENSION_H_
25#define _SO_GL_EXTENSION_H_
26
27#include <Inventor/SbBasic.h>
28#include <Inventor/SbString.h>
29#include <Inventor/STL/list>
30#include <Inventor/threads/SbThreadSpinlock.h>
31
32class SoGLWindow;
33class SbPList;
34
35#if defined (_WIN32)
36// Prototype declarations for Win32 specific context handling
37typedef int (WINAPI * PFNWGLCHOOSEPIXELFORMATPROC) (HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd);
38typedef int (WINAPI * PFNWGLDESCRIBEPIXELFORMATPROC) (HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd);
39typedef int (WINAPI * PFNWGLSETPIXELFORMATPROC) (HDC hDC, int pf, const PIXELFORMATDESCRIPTOR* pfd);
40typedef int (WINAPI * PFNWGLSWAPBUFFERSPROC) (HDC hdc);
41
42#define wglChoosePixelFormat SoGLExtension::m_wglChoosePixelFormat
43#define wglSetPixelFormat SoGLExtension::m_wglSetPixelFormat
44#define wglDescribePixelFormat SoGLExtension::m_wglDescribePixelFormat
45#define wglSwapBuffers SoGLExtension::m_wglSwapBuffers
46
47#endif // _WIN32
48
49#ifdef _MSC_VER
50#pragma warning( push )
51#pragma warning(disable:4251)
52#endif
53
669
670public:
674 static SbBool isAvailable( const char* extension );
675
679 static SbBool isAvailable( const SbString& extension );
680
689 static void disableExtension(const SbString& extension);
690
691private:
698 static int getExtID(const char *str);
699
701 static SbBool extSupported(int contextID, int ext);
702
703private:
708 static SbBool initClass();
709
713 static void exitClass();
714
718 static SbBool isInitialized();
719
720#if defined(_WIN32)
721 static PFNWGLCHOOSEPIXELFORMATPROC m_wglChoosePixelFormat;
722 static PFNWGLSETPIXELFORMATPROC m_wglSetPixelFormat;
723 static PFNWGLDESCRIBEPIXELFORMATPROC m_wglDescribePixelFormat;
724 static PFNWGLSWAPBUFFERSPROC m_wglSwapBuffers;
725#endif // _WIN32
726
732 static SbBool hasFullFloat32TextureSupport();
733
734private:
736 static SoGLWindow* createAndEnableFakeContext();
737
738 static std::list<char*> s_disabledList;
739 static SbBool s_initialized;
740
742 static SbThreadSpinlock s_extensionListMutex;
743 static SbPList* s_extensionList;
744
745 static int s_checkContext;
746};
747
748#ifdef _MSC_VER
749#pragma warning( pop )
750#endif
751
752#endif // _SO_GL_EXTENSION_H_
753
754
List of generic (void *) pointers.
Definition SbPList.h:77
Class for smart character strings.
Definition SbString.h:202
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Portable spinloc...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Contains methods...
static SbBool isAvailable(const char *extension)
Returns true if the extension is available.
static SbBool isAvailable(const SbString &extension)
Returns true if the extension is available.
static void disableExtension(const SbString &extension)
Disable a specific extension in software.
int SbBool
Boolean type.
Definition SbBase.h:87