H3D API  2.4.1
GraphicsHardwareInfo.h
Go to the documentation of this file.
1 // Copyright 2004-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 __GRAPHICSHARDWAREINFO_H__
30 #define __GRAPHICSHARDWAREINFO_H__
31 
32 #include <H3D/X3DChildNode.h>
33 #include <H3D/SFBool.h>
34 #include <H3D/SFString.h>
35 #include <H3D/SFInt32.h>
36 
37 namespace H3D {
38 
56  class H3DAPI_API GraphicsHardwareInfo : public X3DChildNode {
57  public:
58 
60  GraphicsHardwareInfo( Inst< SFNode > _metadata = 0,
61  Inst< SFBool > _initialized = 0,
62  Inst< SFString > _vendor = 0,
63  Inst< SFString > _renderer = 0,
64  Inst< SFString > _version = 0,
65  Inst< SFString > _shadingLanguageVersion = 0,
66  Inst< SFString > _extensions = 0,
67  Inst< SFInt32 > _max3dTextureSize = 0,
68  Inst< SFInt32 > _maxClientAttribStackDepth = 0,
69  Inst< SFInt32 > _maxAttribStackDepth = 0,
70  Inst< SFInt32 > _maxClipPlanes = 0,
71  Inst< SFInt32 > _maxColorMatrixStackDepth = 0,
72  Inst< SFInt32 > _maxCombinedTextureImageUnits = 0,
73  Inst< SFInt32 > _maxCubeMapTextureSize = 0,
74  Inst< SFInt32 > _maxDrawBuffers = 0,
75  Inst< SFInt32 > _maxElementsIndices = 0,
76  Inst< SFInt32 > _maxElementsVertices = 0,
77  Inst< SFInt32 > _maxEvalOrder = 0,
78  Inst< SFInt32 > _maxFragmentUniformComponents = 0,
79  Inst< SFInt32 > _maxLights = 0,
80  Inst< SFInt32 > _maxListNesting = 0,
81  Inst< SFInt32 > _maxModelviewStackDepth = 0,
82  Inst< SFInt32 > _maxNameStackDepth = 0,
83  Inst< SFInt32 > _maxPixelMapTable = 0,
84  Inst< SFInt32 > _maxProjectionStackDepth = 0,
85  Inst< SFInt32 > _maxTextureCoords = 0,
86  Inst< SFInt32 > _maxTextureImageUnits = 0,
87  Inst< SFInt32 > _maxTextureLODBias = 0,
88  Inst< SFInt32 > _maxTextureSize = 0,
89  Inst< SFInt32 > _maxTextureStackDepth = 0,
90  Inst< SFInt32 > _maxTextureUnits = 0,
91  Inst< SFInt32 > _maxVaryingFloats = 0,
92  Inst< SFInt32 > _maxVertexAttribs = 0,
93  Inst< SFInt32 > _maxVertexTextureImageUnits = 0,
94  Inst< SFInt32 > _maxVertexUniformComponents = 0,
95  Inst< SFInt32 > _maxViewportWidth = 0,
96  Inst< SFInt32 > _maxViewportHeight = 0 );
97 
99  virtual ~GraphicsHardwareInfo() {}
100 
102  struct Info {
103  string vendor;
104  string renderer;
105  string version;
106  string shading_language_version;
107  string extensions;
108  H3DInt32 max_3d_texture_size;
109  H3DInt32 max_client_attrib_stack_depth;
110  H3DInt32 max_attrib_stack_depth;
111  H3DInt32 max_clip_planes;
112  H3DInt32 max_color_matrix_stack_depth;
113  H3DInt32 max_combined_texture_image_units;
114  H3DInt32 max_cube_map_texture_size;
115  H3DInt32 max_draw_buffers;
116  H3DInt32 max_elements_indices;
117  H3DInt32 max_elements_vertices;
118  H3DInt32 max_eval_order;
119  H3DInt32 max_fragment_uniform_components;
120  H3DInt32 max_lights;
121  H3DInt32 max_list_nesting;
122  H3DInt32 max_modelview_stack_depth;
123  H3DInt32 max_name_stack_depth;
124  H3DInt32 max_pixel_map_table;
125  H3DInt32 max_projection_stack_depth;
126  H3DInt32 max_texture_coords;
127  H3DInt32 max_texture_image_units;
128  H3DInt32 max_texture_lod_bias;
129  H3DInt32 max_texture_size;
130  H3DInt32 max_texture_stack_depth;
131  H3DInt32 max_texture_units;
132  H3DInt32 max_image_units;
133  H3DInt32 max_varying_floats;
134  H3DInt32 max_vertex_attribs;
135  H3DInt32 max_vertex_texture_image_units;
136  H3DInt32 max_vertex_uniform_components;
137  H3DInt32 max_viewport_width;
138  H3DInt32 max_viewport_height;
139  H3DInt32 max_color_attachments;
140  H3DInt32 max_samples;
141  H3DInt32 max_shader_storage_buffer_bindings;
142  H3DInt64 max_shader_storage_block_size;
143  bool support_ARB_texture_float;
144  bool support_ARB_depth_buffer_float;
145  bool support_EXT_packed_depth_stencil;
146  };
147 
149  virtual void initialize();
150 
154  static bool initializeInfo();
155 
158  static bool infoIsInitialized() {
159  return info_initialized;
160  }
161 
164  static const Info &getInfo() {
165  return info;
166  }
167 
173  H3DUniquePtr< SFBool > initialized;
174 
180  H3DUniquePtr< SFString > vendor;
181 
188  H3DUniquePtr< SFString > renderer;
189 
194  H3DUniquePtr< SFString > version;
195 
200  H3DUniquePtr< SFString > shadingLanguageVersion;
201 
206  H3DUniquePtr< SFString > extensions;
207 
212  H3DUniquePtr< SFInt32 > max3dTextureSize;
213 
219  H3DUniquePtr< SFInt32 > maxClientAttribStackDepth;
220 
225  H3DUniquePtr< SFInt32 > maxAttribStackDepth;
226 
231  H3DUniquePtr< SFInt32 > maxClipPlanes;
232 
237  H3DUniquePtr< SFInt32 > maxColorMatrixStackDepth;
238 
247  H3DUniquePtr< SFInt32 > maxCombinedTextureImageUnits;
248 
254  H3DUniquePtr< SFInt32 > maxCubeMapTextureSize;
255 
261  H3DUniquePtr< SFInt32 > maxDrawBuffers;
262 
267  H3DUniquePtr< SFInt32 > maxElementsIndices;
268 
273  H3DUniquePtr< SFInt32 > maxElementsVertices;
274 
279  H3DUniquePtr< SFInt32 > maxEvalOrder;
280 
287  H3DUniquePtr< SFInt32 > maxFragmentUniformComponents;
288 
293  H3DUniquePtr< SFInt32 > maxLights;
294 
299  H3DUniquePtr< SFInt32 > maxListNesting;
300 
305  H3DUniquePtr< SFInt32 > maxModelviewStackDepth;
306 
311  H3DUniquePtr< SFInt32 > maxNameStackDepth;
312 
317  H3DUniquePtr< SFInt32 > maxPixelMapTable;
318 
323  H3DUniquePtr< SFInt32 > maxProjectionStackDepth;
324 
330  H3DUniquePtr< SFInt32 > maxTextureCoords;
331 
337  H3DUniquePtr< SFInt32 > maxTextureImageUnits;
338 
343  H3DUniquePtr< SFInt32 > maxTextureLODBias;
344 
350  H3DUniquePtr< SFInt32 > maxTextureSize;
351 
356  H3DUniquePtr< SFInt32 > maxTextureStackDepth;
357 
365  H3DUniquePtr< SFInt32 > maxTextureUnits;
366 
375  H3DUniquePtr< SFInt32 > maxVaryingFloats;
376 
381  H3DUniquePtr< SFInt32 > maxVertexAttribs;
382 
388  H3DUniquePtr< SFInt32 > maxVertexTextureImageUnits;
389 
396  H3DUniquePtr< SFInt32 > maxVertexUniformComponents;
397 
402  H3DUniquePtr< SFInt32 > maxViewportWidth;
403 
408  H3DUniquePtr< SFInt32 > maxViewportHeight;
409 
412  protected:
414  static bool info_initialized;
415 
417  static Info info;
418 
419  };
420 }
421 
422 #endif
Contains the SFBool field class.
Contains the SFInt32 field class.
Contains the SFString field class.
Header file for X3DChildNode, X3D scene-graph node.
The GraphicsHardwareInfo class provides information about the graphics hardware the program is being ...
Definition: GraphicsHardwareInfo.h:56
H3DUniquePtr< SFInt32 > maxModelviewStackDepth
The maximum supported depth of the modelview matrix stack.
Definition: GraphicsHardwareInfo.h:305
H3DUniquePtr< SFString > extensions
A space-separated list of supported extensions to GL.
Definition: GraphicsHardwareInfo.h:206
H3DUniquePtr< SFInt32 > maxLights
The maximum number of lights.
Definition: GraphicsHardwareInfo.h:293
H3DUniquePtr< SFInt32 > maxColorMatrixStackDepth
The maximum supported depth of the color matrix stack.
Definition: GraphicsHardwareInfo.h:237
H3DUniquePtr< SFString > version
A version or release number.
Definition: GraphicsHardwareInfo.h:194
H3DUniquePtr< SFInt32 > maxVertexTextureImageUnits
The maximum supported texture image units that can be used to access texture maps from the vertex sha...
Definition: GraphicsHardwareInfo.h:388
H3DUniquePtr< SFInt32 > maxTextureStackDepth
The maximum supported depth of the texture matrix stack.
Definition: GraphicsHardwareInfo.h:356
H3DUniquePtr< SFInt32 > maxEvalOrder
The maximum equation order supported by 1D and 2D evaluators.
Definition: GraphicsHardwareInfo.h:279
H3DUniquePtr< SFInt32 > maxTextureSize
The value gives a rough estimate of the largest texture that the GL can handle.
Definition: GraphicsHardwareInfo.h:350
H3DUniquePtr< SFInt32 > maxElementsIndices
The recommended maximum number of vertex array indices.
Definition: GraphicsHardwareInfo.h:267
H3DUniquePtr< SFInt32 > maxAttribStackDepth
The maximum supported depth of the attribute stack.
Definition: GraphicsHardwareInfo.h:225
H3DUniquePtr< SFInt32 > maxProjectionStackDepth
The maximum supported depth of the projection matrix stack.
Definition: GraphicsHardwareInfo.h:323
H3DUniquePtr< SFInt32 > max3dTextureSize
A rough estimate of the largest 3D texture that the GL can handle.
Definition: GraphicsHardwareInfo.h:212
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: GraphicsHardwareInfo.h:411
H3DUniquePtr< SFInt32 > maxElementsVertices
The recommended maximum number of vertex array vertices.
Definition: GraphicsHardwareInfo.h:273
static bool infoIsInitialized()
Returns true if the static info member has been initialized or not.
Definition: GraphicsHardwareInfo.h:158
H3DUniquePtr< SFInt32 > maxTextureCoords
The maximum number of texture coordinate sets available to vertex and fragment shaders.
Definition: GraphicsHardwareInfo.h:330
H3DUniquePtr< SFInt32 > maxVaryingFloats
The maximum number of interpolators available for processing varying variables used by vertex and fra...
Definition: GraphicsHardwareInfo.h:375
H3DUniquePtr< SFInt32 > maxListNesting
The maximum recursion depth allowed during display-list traversal.
Definition: GraphicsHardwareInfo.h:299
H3DUniquePtr< SFInt32 > maxTextureImageUnits
The maximum supported texture image units that can be used to access texture maps from the fragment s...
Definition: GraphicsHardwareInfo.h:337
H3DUniquePtr< SFString > renderer
The name of the renderer.
Definition: GraphicsHardwareInfo.h:188
H3DUniquePtr< SFInt32 > maxDrawBuffers
The maximum number of simultaneous output colors allowed from a fragment shader using the gl_FragData...
Definition: GraphicsHardwareInfo.h:261
static bool info_initialized
Flag indicating if the info member has been initialized or not.
Definition: GraphicsHardwareInfo.h:414
H3DUniquePtr< SFBool > initialized
If true the information in all the other fields are valid.
Definition: GraphicsHardwareInfo.h:173
H3DUniquePtr< SFInt32 > maxPixelMapTable
The maximum supported size of a glPixelMap lookup table.
Definition: GraphicsHardwareInfo.h:317
H3DUniquePtr< SFInt32 > maxCubeMapTextureSize
The value gives a rough estimate of the largest cube-map texture that the GL can handle.
Definition: GraphicsHardwareInfo.h:254
H3DUniquePtr< SFInt32 > maxFragmentUniformComponents
The maximum number of individual floating-point, integer, or boolean values that can be held in unifo...
Definition: GraphicsHardwareInfo.h:287
H3DUniquePtr< SFInt32 > maxClipPlanes
The maximum number of application-defined clipping planes.
Definition: GraphicsHardwareInfo.h:231
H3DUniquePtr< SFInt32 > maxVertexUniformComponents
The maximum number of individual floating-point, integer, or boolean values that can be held in unifo...
Definition: GraphicsHardwareInfo.h:396
static const Info & getInfo()
Returns info about the current graphics hardware.
Definition: GraphicsHardwareInfo.h:164
virtual ~GraphicsHardwareInfo()
Destructor.
Definition: GraphicsHardwareInfo.h:99
H3DUniquePtr< SFInt32 > maxViewportHeight
The maximum supported height of the viewport.
Definition: GraphicsHardwareInfo.h:408
H3DUniquePtr< SFInt32 > maxClientAttribStackDepth
A value indicating the maximum supported depth of the client attribute stack.
Definition: GraphicsHardwareInfo.h:219
H3DUniquePtr< SFInt32 > maxTextureUnits
A value indicating the number of conventional texture units supported.
Definition: GraphicsHardwareInfo.h:365
static Info info
The graphics card info for the current system.
Definition: GraphicsHardwareInfo.h:417
H3DUniquePtr< SFString > shadingLanguageVersion
A version or release number for the shading language.
Definition: GraphicsHardwareInfo.h:200
H3DUniquePtr< SFInt32 > maxViewportWidth
The maximum supported width of the viewport.
Definition: GraphicsHardwareInfo.h:402
H3DUniquePtr< SFInt32 > maxTextureLODBias
The maximum, absolute value of the texture level-of-detail bias.
Definition: GraphicsHardwareInfo.h:343
H3DUniquePtr< SFString > vendor
The company responsible for this GL implementation.
Definition: GraphicsHardwareInfo.h:180
H3DUniquePtr< SFInt32 > maxVertexAttribs
The maximum number of 4-component generic vertex attributes accessible to a vertex shader.
Definition: GraphicsHardwareInfo.h:381
H3DUniquePtr< SFInt32 > maxCombinedTextureImageUnits
The maximum supported texture image units that can be used to access texture maps from the vertex sha...
Definition: GraphicsHardwareInfo.h:247
H3DUniquePtr< SFInt32 > maxNameStackDepth
The maximum supported depth of the selection name stack.
Definition: GraphicsHardwareInfo.h:311
This abstract node type indicates that the concrete nodes which are instantiated based on it may be u...
Definition: X3DChildNode.h:42
H3DUTIL_INT64 H3DInt64
int H3DInt32
H3D API namespace.
Definition: Anchor.h:38
The Info class holds information about the current graphics hardware.
Definition: GraphicsHardwareInfo.h:102
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194