Skip to content

Commit acc131b

Browse files
committed
clang format
1 parent 49cd77f commit acc131b

9 files changed

Lines changed: 541 additions & 572 deletions

File tree

src/libprojectM/Renderer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ add_library(Renderer OBJECT
6767
VertexBufferUsage.hpp
6868
VertexIndexArray.cpp
6969
VertexIndexArray.hpp
70-
)
70+
)
7171

7272
target_include_directories(Renderer
7373
PRIVATE

src/libprojectM/Renderer/Platform/DynamicLibrary.cpp

Lines changed: 350 additions & 353 deletions
Large diffs are not rendered by default.

src/libprojectM/Renderer/Platform/DynamicLibrary.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ constexpr std::array<const char*, 3> kNativeEglNames = {
6565
"EGL.dll",
6666
nullptr};
6767

68-
constexpr std::array<const char*, 2> kNativeGlNames = {
68+
constexpr std::array<const char*, 2> kNativeGlNames = {
6969
"opengl32.dll",
7070
nullptr};
7171

@@ -134,8 +134,7 @@ constexpr std::array<const char*, 3> kNativeGlesNames = {
134134
constexpr std::array<const char*, 3> kNativeEglNames = {
135135
"libEGL.so.1",
136136
"libEGL.so",
137-
nullptr
138-
};
137+
nullptr};
139138

140139
/**
141140
* Linux / GLES:

src/libprojectM/Renderer/Platform/GLProbe.cpp

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ namespace {
2424
*/
2525
enum : std::uint16_t
2626
{
27-
PM_GL_MAJOR_VERSION = 0x821B,
28-
PM_GL_MINOR_VERSION = 0x821C,
29-
PM_GL_CONTEXT_FLAGS = 0x821E
27+
PM_GL_MAJOR_VERSION = 0x821B,
28+
PM_GL_MINOR_VERSION = 0x821C,
29+
PM_GL_CONTEXT_FLAGS = 0x821E
3030
#ifndef USE_GLES
31-
,PM_GL_CONTEXT_PROFILE_MASK = 0x9126
31+
,
32+
PM_GL_CONTEXT_PROFILE_MASK = 0x9126
3233
#endif
3334
};
3435

@@ -39,7 +40,7 @@ enum : std::uint16_t
3940
*/
4041
enum : std::uint32_t
4142
{
42-
PM_GL_CONTEXT_CORE_PROFILE_BIT = 0x00000001u,
43+
PM_GL_CONTEXT_CORE_PROFILE_BIT = 0x00000001u,
4344
PM_GL_CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002u
4445
};
4546

@@ -51,8 +52,8 @@ enum : std::uint32_t
5152
enum : std::uint32_t
5253
{
5354
PM_GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x00000001u,
54-
PM_GL_CONTEXT_FLAG_DEBUG_BIT = 0x00000002u,
55-
PM_GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT = 0x00000004u
55+
PM_GL_CONTEXT_FLAG_DEBUG_BIT = 0x00000002u,
56+
PM_GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT = 0x00000004u
5657
};
5758

5859
/**
@@ -64,15 +65,14 @@ enum : std::uint32_t
6465
* - glGetIntegerv is optional; when unavailable, version probing can fall back to parsing
6566
* `GL_VERSION`.
6667
*/
67-
struct ResolvedGLFunctions
68-
{
69-
using GetStringFn = decltype(+glGetString);
70-
using GetErrorFn = decltype(+glGetError);
68+
struct ResolvedGLFunctions {
69+
using GetStringFn = decltype(+glGetString);
70+
using GetErrorFn = decltype(+glGetError);
7171
using GetIntegervFn = decltype(+glGetIntegerv);
7272

73-
GetStringFn getString{}; //!< Typed pointer to glGetString (required).
74-
GetErrorFn getError{}; //!< Typed pointer to glGetError (required).
75-
GetIntegervFn getIntegerv{}; //!< Typed pointer to glGetIntegerv (optional).
73+
GetStringFn getString{}; //!< Typed pointer to glGetString (required).
74+
GetErrorFn getError{}; //!< Typed pointer to glGetError (required).
75+
GetIntegervFn getIntegerv{}; //!< Typed pointer to glGetIntegerv (optional).
7676
};
7777

7878
/**
@@ -117,8 +117,8 @@ auto ResolveGLFunctions(const GLProbe::GLFunctions& handles,
117117
}
118118

119119
// Convert opaque procedure addresses into typed function pointers.
120-
out.getString = SymbolToFunction<ResolvedGLFunctions::GetStringFn>(getString);
121-
out.getError = SymbolToFunction<ResolvedGLFunctions::GetErrorFn>(getError);
120+
out.getString = SymbolToFunction<ResolvedGLFunctions::GetStringFn>(getString);
121+
out.getError = SymbolToFunction<ResolvedGLFunctions::GetErrorFn>(getError);
122122
out.getIntegerv = SymbolToFunction<ResolvedGLFunctions::GetIntegervFn>(getIntegerv);
123123

124124
if (out.getString == nullptr || out.getError == nullptr)
@@ -236,16 +236,13 @@ auto ApiString(GLApi api) -> const char*
236236
{
237237
switch (api)
238238
{
239-
case GLApi::OpenGLES:
240-
{
239+
case GLApi::OpenGLES: {
241240
return "GLES";
242241
}
243-
case GLApi::OpenGL:
244-
{
242+
case GLApi::OpenGL: {
245243
return "GL";
246244
}
247-
default:
248-
{
245+
default: {
249246
return "Any";
250247
}
251248
}

src/libprojectM/Renderer/Platform/GLProbe.hpp

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,41 +20,38 @@ enum class GLApi : std::uint8_t
2020
/**
2121
* @brief Requirements to validate against the current GL context.
2222
*/
23-
struct GLRequirements
24-
{
25-
GLApi api{GLApi::Any}; //!< Required API (Any/OpenGL/OpenGLES)
26-
int minMajor{}; //!< Minimum major version
27-
int minMinor{}; //!< Minimum minor version
28-
bool requireCoreProfile{false}; //!< Desktop GL only; ignored for GLES
29-
int minShaderMajor{}; //!< Minimum shading language major version (GLSL/ESSL)
30-
int minShaderMinor{}; //!< Minimum shading language minor version (GLSL/ESSL)
23+
struct GLRequirements {
24+
GLApi api{GLApi::Any}; //!< Required API (Any/OpenGL/OpenGLES)
25+
int minMajor{}; //!< Minimum major version
26+
int minMinor{}; //!< Minimum minor version
27+
bool requireCoreProfile{false}; //!< Desktop GL only; ignored for GLES
28+
int minShaderMajor{}; //!< Minimum shading language major version (GLSL/ESSL)
29+
int minShaderMinor{}; //!< Minimum shading language minor version (GLSL/ESSL)
3130
};
3231

3332
/**
3433
* @brief Compact information about the current GL context.
3534
*/
36-
struct GLInfo
37-
{
38-
GLApi api{GLApi::Any}; //!< Detected API (WebGL is treated as GLES-like on Emscripten)
39-
int major{}; //!< Detected major version
40-
int minor{}; //!< Detected minor version
41-
std::string versionStr; //!< GL_VERSION
42-
std::string glslStr; //!< GL_SHADING_LANGUAGE_VERSION
43-
std::string vendor; //!< GL_VENDOR
44-
std::string renderer; //!< GL_RENDERER
45-
std::string profile; //!< "core", "compat", "unknown", "n/a"
46-
std::string flags; //!< "debug,fwd,robust", "none", "n/a"
35+
struct GLInfo {
36+
GLApi api{GLApi::Any}; //!< Detected API (WebGL is treated as GLES-like on Emscripten)
37+
int major{}; //!< Detected major version
38+
int minor{}; //!< Detected minor version
39+
std::string versionStr; //!< GL_VERSION
40+
std::string glslStr; //!< GL_SHADING_LANGUAGE_VERSION
41+
std::string vendor; //!< GL_VENDOR
42+
std::string renderer; //!< GL_RENDERER
43+
std::string profile; //!< "core", "compat", "unknown", "n/a"
44+
std::string flags; //!< "debug,fwd,robust", "none", "n/a"
4745
};
4846

4947
/**
5048
* @brief Result of a GL context check.
5149
*/
52-
struct GLProbeResult
53-
{
54-
bool success{false}; //!< True if requirements are met
55-
std::string reason; //!< Failure reason (empty on success)
56-
GLRequirements req; //!< Requirements used
57-
GLInfo info; //!< Detected context info
50+
struct GLProbeResult {
51+
bool success{false}; //!< True if requirements are met
52+
std::string reason; //!< Failure reason (empty on success)
53+
GLRequirements req; //!< Requirements used
54+
GLInfo info; //!< Detected context info
5855
};
5956

6057
/**
@@ -68,16 +65,15 @@ class GLProbe final
6865
/**
6966
* @brief GL function pointer parameter type.
7067
*/
71-
struct GLFunctions
72-
{
68+
struct GLFunctions {
7369
/**
7470
* Opaque procedure address.
7571
*/
7672
using ProcAddress = void*;
7773

78-
ProcAddress getString{}; //!< glGetString
79-
ProcAddress getError{}; //!< glGetError
80-
ProcAddress getIntegerv{}; //!< glGetIntegerv
74+
ProcAddress getString{}; //!< glGetString
75+
ProcAddress getError{}; //!< glGetError
76+
ProcAddress getIntegerv{}; //!< glGetIntegerv
8177
};
8278

8379
/**
@@ -104,7 +100,7 @@ class GLProbe final
104100
auto Build(GLInfo& info, std::string& reason) -> bool;
105101

106102
private:
107-
GLFunctions m_gl; //!< GL functions used for checks.
103+
GLFunctions m_gl; //!< GL functions used for checks.
108104
};
109105

110106
/**
@@ -164,7 +160,6 @@ class GLProbe final
164160
* @brief Formats GL context info as a compact summary string.
165161
*/
166162
[[nodiscard]] static auto FormatCompactLine(const GLInfo& info) -> std::string;
167-
168163
};
169164

170165
} // namespace Platform

0 commit comments

Comments
 (0)