H3D API  2.4.1
NvidiaGraphicsOptions.h
Go to the documentation of this file.
1 // Copyright 2018-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __NVIDIAGRAPHICSOPTIONS_H__
30 #define __NVIDIAGRAPHICSOPTIONS_H__
31 
32 #include <H3D/H3DApi.h>
33 #ifdef HAVE_NVAPI
34 
35 #include <H3D/X3DChildNode.h>
36 #include <H3D/SFString.h>
37 #include <H3D/SFInt32.h>
38 #include <nvapi.h>
39 #include <NvApiDriverSettings.h>
40 
41 namespace H3D {
42 
60  class H3DAPI_API NvidiaGraphicsOptions : public X3DChildNode {
61  public:
62 
64  NvidiaGraphicsOptions( Inst< SFNode > _metadata = 0,
65  Inst< SFString > _settingsApplyingStatus = 0,
66  Inst< SFString > _threadedOptimization = 0,
67  Inst< SFString > _threadedOptimizationCurrent = 0,
68  Inst< SFString > _verticalSync = 0,
69  Inst< SFString > _verticalSyncCurrent = 0,
70  Inst< SFString > _fxaa = 0,
71  Inst< SFString > _fxaaCurrent = 0,
72  Inst< SFString > _powerMode = 0,
73  Inst< SFString > _powerModeCurrent = 0,
74  Inst< SFString > _shaderCache = 0,
75  Inst< SFString > _shaderCacheCurrent = 0,
76  Inst< SFString > _tripleBuffering = 0,
77  Inst< SFString > _tripleBufferingCurrent = 0 ) ;
78 
80 
82  virtual void initialize();
83 
87  H3DUniquePtr<SFString> settingsApplyingStatus;
88 
89 
94  H3DUniquePtr <SFString> threadedOptimization;
95 
100  H3DUniquePtr <SFString> threadedOptimizationCurrent;
101 
106  H3DUniquePtr < SFString> verticalSync;
107 
112  H3DUniquePtr < SFString> verticalSyncCurrent;
113 
118  H3DUniquePtr<SFString> fxaa;
119 
124  H3DUniquePtr<SFString> fxaaCurrent;
125 
130  H3DUniquePtr<SFString> powerMode;
131 
136  H3DUniquePtr<SFString> powerModeCurrent;
137 
142  H3DUniquePtr<SFString> shaderCache;
143 
148  H3DUniquePtr<SFString> shaderCacheCurrent;
149 
154  H3DUniquePtr<SFString> tripleBuffering;
155 
160  H3DUniquePtr<SFString> tripleBufferingCurrent;
161 
164  protected:
165  void applySettings();
166 
167  string printNVAPIError( const NvAPI_Status& err, const int& line );
168  void setNVUstring( NvAPI_UnicodeString& nvStr, const wchar_t* wcStr );
169  bool setting_applied;
170  string options_applying_result;
171  };
172 }
173 
174 #endif // HAVE_NVAPI
175 
176 #endif
Base header file that handles all configuration related settings.
Contains the SFInt32 field class.
Contains the SFString field class.
Header file for X3DChildNode, X3D scene-graph node.
Specifies parameters to use for the NVIDIA graphic settings which normally can also be changed from N...
Definition: NvidiaGraphicsOptions.h:60
H3DUniquePtr< SFString > tripleBufferingCurrent
Reports the current value for the triple buffering field of NVIDIA 3d setting Access type: outputOnly...
Definition: NvidiaGraphicsOptions.h:160
H3DUniquePtr< SFString > verticalSync
Field controls the vertical sync field of NVIDIA 3d setting Access type: initializeOnly Default value...
Definition: NvidiaGraphicsOptions.h:106
H3DUniquePtr< SFString > threadedOptimizationCurrent
Reports the current value for the thread optimization field of NVIDIA 3d setting Access type: outputO...
Definition: NvidiaGraphicsOptions.h:100
H3DUniquePtr< SFString > verticalSyncCurrent
Reports the current value for the vertical sync field of NVIDIA 3d setting Access type: outputOnly De...
Definition: NvidiaGraphicsOptions.h:112
H3DUniquePtr< SFString > settingsApplyingStatus
Output only field which indicate whether the settings are applied and whether if they are applied suc...
Definition: NvidiaGraphicsOptions.h:87
H3DUniquePtr< SFString > shaderCacheCurrent
Reports the current value for the shader cache field of NVIDIA 3d setting Access type: outputOnly Def...
Definition: NvidiaGraphicsOptions.h:148
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: NvidiaGraphicsOptions.h:163
H3DUniquePtr< SFString > fxaaCurrent
Reports the current value for the fxaa field of NVIDIA 3d setting Access type: outputOnly Default val...
Definition: NvidiaGraphicsOptions.h:124
H3DUniquePtr< SFString > powerModeCurrent
Reports the current value for the power management mode of NVIDIA 3d setting Access type: outputOnly ...
Definition: NvidiaGraphicsOptions.h:136
H3DUniquePtr< SFString > fxaa
Field controls the fxaa field of NVIDIA 3d setting Access type: initializeOnly Default value: "GLOBAL...
Definition: NvidiaGraphicsOptions.h:118
H3DUniquePtr< SFString > threadedOptimization
Field controls the thread optimization field of NVIDIA 3d setting Access type: initializeOnly Default...
Definition: NvidiaGraphicsOptions.h:94
H3DUniquePtr< SFString > tripleBuffering
Field controls the triple buffering field of NVIDIA 3d setting Access type: initializeOnly Default va...
Definition: NvidiaGraphicsOptions.h:154
H3DUniquePtr< SFString > shaderCache
Field controls the shader cache field of NVIDIA 3d setting Access type: initializeOnly Default value:...
Definition: NvidiaGraphicsOptions.h:142
H3DUniquePtr< SFString > powerMode
Field controls the power management mode of NVIDIA 3d setting Access type: initializeOnly Default val...
Definition: NvidiaGraphicsOptions.h:130
This abstract node type indicates that the concrete nodes which are instantiated based on it may be u...
Definition: X3DChildNode.h:42
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194