1 // Created on: 2013-08-25
2 // Created by: Kirill GAVRILOV
3 // Copyright (c) 2013 OPEN CASCADE SAS
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.
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.
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.
20 #ifndef _OpenGl_Caps_H__
21 #define _OpenGl_Caps_H__
23 #include <Standard_DefineHandle.hxx>
24 #include <Standard_Transient.hxx>
25 #include <Handle_Standard_Transient.hxx>
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
32 public: //! @name flags to disable particular functionality, should be used only for testing purposes!
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)
37 public: //! @name context creation parameters
40 * Request stereoscopic context (with Quad Buffer). This flag requires support in OpenGL driver.
44 Standard_Boolean contextStereo;
47 * Request debug GL context. This flag requires support in OpenGL driver.
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.
53 * OFF by default. Currently implemented only for Windows (WGL).
55 Standard_Boolean contextDebug;
58 * Disable hardware acceleration.
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.
64 * Software implementations are dramatically slower - should never be used.
66 * OFF by default. Currently implemented only for Windows (WGL) and Mac OS X (Cocoa).
68 Standard_Boolean contextNoAccel;
71 * Disables freeing CPU memory after building VBOs.
75 Standard_Boolean keepArrayData;
77 public: //! @name class methods
79 //! Default constructor - initialize with most optimal values.
80 Standard_EXPORT OpenGl_Caps();
83 Standard_EXPORT virtual ~OpenGl_Caps();
86 Standard_EXPORT OpenGl_Caps& operator= (const OpenGl_Caps& theCopy);
91 OpenGl_Caps (const OpenGl_Caps& );
95 DEFINE_STANDARD_RTTI(OpenGl_Caps) // Type definition
99 DEFINE_STANDARD_HANDLE(OpenGl_Caps, Standard_Transient)
101 #endif // _OpenGl_Caps_H__