SuperTuxKart
central_settings.hpp
1 // SuperTuxKart - a fun racing game with go-kart
2 // Copyright (C) 2014-2015 SuperTuxKart-Team
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 3
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 
18 #ifndef CENTRAL_SETTINGS_HPP
19 #define CENTRAL_SETTINGS_HPP
20 
21 #include <string>
22 
24 {
25 private:
27  bool m_glsl;
28 
29  int m_gl_major_version, m_gl_minor_version, m_gl_mem;
30  bool hasBufferStorage;
31  bool hasComputeShaders;
32  bool hasArraysOfArrays;
33  bool hasTextureStorage;
34  bool hasTextureView;
35  bool hasUBO;
36  bool hasExplicitAttribLocation;
37  bool hasGS;
38  bool hasTextureCompression;
39  bool hasTextureCompressionSRGB;
40  bool hasAtomics;
41  bool hasSSBO;
42  bool hasImageLoadStore;
43  bool hasTextureFilterAnisotropic;
44  bool hasTextureSwizzle;
45  bool hasPixelBufferObject;
46  bool hasSamplerObjects;
47  bool hasVertexType2101010Rev;
48  bool hasInstancedArrays;
49  bool hasBGRA;
50  bool hasColorBufferFloat;
51  bool hasTextureBufferObject;
52  bool m_need_vertex_id_workaround;
53 public:
54  static bool m_supports_sp;
55 
56  void init();
57  bool isGLSL() const;
58  unsigned getGLSLVersion() const;
59 
60  // Needs special handle ?
61  bool needsVertexIdWorkaround() const;
62 
63  // Extension is available and safe to use
64  bool isARBUniformBufferObjectUsable() const;
65  bool isEXTTextureCompressionS3TCUsable() const;
66  bool isEXTTextureCompressionS3TCSRGBUsable() const;
67  bool isARBTextureViewUsable() const;
68  bool isARBGeometryShadersUsable() const;
69  bool isARBTextureStorageUsable() const;
70  bool isARBComputeShaderUsable() const;
71  bool isARBArraysOfArraysUsable() const;
72  bool isARBBufferStorageUsable() const;
73  bool isARBShaderAtomicCountersUsable() const;
74  bool isARBShaderStorageBufferObjectUsable() const;
75  bool isARBImageLoadStoreUsable() const;
76  bool isARBExplicitAttribLocationUsable() const;
77  bool isEXTTextureFilterAnisotropicUsable() const;
78  bool isARBTextureSwizzleUsable() const;
79  bool isARBPixelBufferObjectUsable() const;
80  bool isARBSamplerObjectsUsable() const;
81  bool isARBVertexType2101010RevUsable() const;
82  bool isARBInstancedArraysUsable() const;
83  bool isEXTTextureFormatBGRA8888Usable() const;
84  bool isEXTColorBufferFloatUsable() const;
85  bool isARBTextureBufferObjectUsable() const;
86 
87  // Are all required extensions available for feature support
88  bool supportsComputeShadersFiltering() const;
89  bool supportsHardwareSkinning() const;
90  bool supportsTextureCompression() const;
91 
92  // "Macro" around feature support and user config
93  bool isShadowEnabled() const;
94  bool isTextureCompressionEnabled() const;
95  bool isDeferredEnabled() const;
96  bool supportsColorization() const;
97 };
98 
99 extern CentralVideoSettings* CVS;
100 
101 #endif
Definition: central_settings.hpp:24
bool m_glsl
Supports GLSL.
Definition: central_settings.hpp:27