Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
GraphicsInfo.h
1/*
2 * Gamedev Framework (gf)
3 * Copyright (C) 2016-2022 Julien Bernard
4 *
5 * This software is provided 'as-is', without any express or implied
6 * warranty. In no event will the authors be held liable for any damages
7 * arising from the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software
15 * in a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 * 2. Altered source versions must be plainly marked as such, and must not be
18 * misrepresented as being the original software.
19 * 3. This notice may not be removed or altered from any source distribution.
20 */
21#ifndef GF_GRAPHICS_INFO_H
22#define GF_GRAPHICS_INFO_H
23
24#include <string>
25#include <vector>
26
27#include "GraphicsApi.h"
28#include "Vector.h"
29
30namespace gf {
31#ifndef DOXYGEN_SHOULD_SKIP_THIS
32inline namespace v1 {
33#endif
34
46 class GF_GRAPHICS_API GraphicsInfo {
47 public:
51 GraphicsInfo() = delete;
52
58 static std::string getVendor();
59
65 static std::string getRenderer();
66
72 static std::string getVersion();
73
79 static std::string getShadingLanguageVersion();
80
86 static std::vector<std::string> getExtensions();
87
91 struct Format {
92 int symbol;
93 std::string name;
94 };
95
101 static std::vector<Format> getCompressedTextureFormats();
102
108 static std::vector<Format> getShaderBinaryFormats();
109
116
123
131
138
145
151 static int getMaxTextureSize();
152
160
168
175
183
190
196 static int getSubpixelBits();
197
198 };
199
200#ifndef DOXYGEN_SHOULD_SKIP_THIS
201}
202#endif
203}
204
205#endif // GF_GRAPHICS_INFO_H
A class for graphics info.
Definition: GraphicsInfo.h:46
static int getMaxVertexUniformVectors()
Get the maximum number of four-element vectors that can be held in uniform variable storage for a ver...
static int getMaxVertexTextureImageUnits()
Get the maximum supported texture image units in a vertex shader.
static std::string getShadingLanguageVersion()
Get OpenGL GLSL version string.
static std::string getRenderer()
Get OpenGL renderer string.
static int getMaxCombinedTextureImageUnits()
Get the maximum supported texture image units.
static Vector2i getMaxViewportDims()
Get the maximum supported width and height of the viewport.
static int getMaxTextureImageUnits()
Get the maximum supported texture image units in a fragment shader.
static int getMaxTextureSize()
Get a rough estimate of the largest texture.
GraphicsInfo()=delete
Deleted default constructor.
static std::vector< Format > getShaderBinaryFormats()
Get a list of supported shader binary formats.
static int getMaxVaryingVectors()
Get the maximum number four-element vectors available for varying variables used by vertex and fragme...
static std::string getVendor()
Get OpenGL vendor string.
static int getMaxCubeMapTextureSize()
Get a rough estimate of the largest cube-map texture.
static std::string getVersion()
Get OpenGL version string.
static int getMaxFragmentUniformVectors()
Get the maximum number of four-element vectors that can be held in uniform variable storage for a fra...
static int getMaxVertexAttribs()
Get the maximum number of 4-component generic vertex attributes accessible to a vertex shader.
static int getSubpixelBits()
Get an estimate of the number of bits of subpixel resolution.
static std::vector< Format > getCompressedTextureFormats()
Get a list of supported compressed texture formats.
static std::vector< std::string > getExtensions()
Get available OpenGL extensions.
static int getMaxRenderbufferSize()
Get the largest renderbuffer width and height.
The namespace for gf classes.
An OpenGL format.
Definition: GraphicsInfo.h:91
std::string name
Name of the constant for the format or "UNKNOWN".
Definition: GraphicsInfo.h:93
int symbol
Symbolic constant to represent the format.
Definition: GraphicsInfo.h:92