0024130: Implementing ray tracing visualization core
[occt.git] / src / OpenGl / OpenGl_Caps.hxx
1 // Created on: 2013-08-25
2 // Created by: Kirill GAVRILOV
3 // Copyright (c) 2013 OPEN CASCADE SAS
4 //
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
9 //
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 //
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
19
20 #ifndef _OpenGl_Caps_H__
21 #define _OpenGl_Caps_H__
22
23 #include <Standard_DefineHandle.hxx>
24 #include <Standard_Transient.hxx>
25 #include <Handle_Standard_Transient.hxx>
26
27 //! Class to define graphich driver capabilities.
28 //! Notice that these options will be ignored if particular functionality does not provided by GL driver
29 class OpenGl_Caps : public Standard_Transient
30 {
31
32 public: //! @name flags to disable particular functionality, should be used only for testing purposes!
33
34   Standard_Boolean vboDisable;        //!< flag permits VBO usage, will significantly affect performance (OFF by default)
35   Standard_Boolean pntSpritesDisable; //!< flag permits Point Sprites usage, will significantly affect performance (OFF by default)
36
37 public: //! @name context creation parameters
38
39   /**
40    * Request stereoscopic context (with Quad Buffer). This flag requires support in OpenGL driver.
41    *
42    * OFF by default.
43    */
44   Standard_Boolean contextStereo;
45
46   /**
47    * Request debug GL context. This flag requires support in OpenGL driver.
48    *
49    * When turned on OpenGL driver emits error and warning messages to provided callback
50    * (see OpenGl_Context - messages will be printed to standard output).
51    * Affects performance - thus should not be turned on by products in released state.
52    *
53    * OFF by default. Currently implemented only for Windows (WGL).
54    */
55   Standard_Boolean contextDebug;
56
57   /**
58    * Disable hardware acceleration.
59    *
60    * This flag overrides default behavior, when accelerated context always preferred over software ones:
61    * - on Windows will force Microsoft software implementation;
62    * - on Mac OS X, forces Apple software implementation.
63    *
64    * Software implementations are dramatically slower - should never be used.
65    *
66    * OFF by default. Currently implemented only for Windows (WGL) and Mac OS X (Cocoa).
67    */
68   Standard_Boolean contextNoAccel;
69
70   /**
71    * Disables freeing CPU memory after building VBOs.
72    *
73    * OFF by default.
74    */
75   Standard_Boolean keepArrayData;
76
77 public: //! @name class methods
78
79   //! Default constructor - initialize with most optimal values.
80   Standard_EXPORT OpenGl_Caps();
81
82   //! Destructor.
83   Standard_EXPORT virtual ~OpenGl_Caps();
84
85   //! Copy maker.
86   Standard_EXPORT OpenGl_Caps& operator= (const OpenGl_Caps& theCopy);
87
88 private:
89
90   //! Not implemented
91   OpenGl_Caps (const OpenGl_Caps& );
92
93 public:
94
95   DEFINE_STANDARD_RTTI(OpenGl_Caps) // Type definition
96
97 };
98
99 DEFINE_STANDARD_HANDLE(OpenGl_Caps, Standard_Transient)
100
101 #endif // _OpenGl_Caps_H__