Skip to content

Commit 049dfe5

Browse files
committed
nit fixes
1 parent 5730277 commit 049dfe5

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/libprojectM/Renderer/PlatformGLResolver.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ void GLResolver::ResolveProviderFunctions()
187187
}
188188

189189
{
190-
char buf[256];
191-
std::snprintf(buf, sizeof(buf), "[GLResolver] Library handles: egl=%p gl=%p",
190+
std::array<char, 256> buf{};
191+
std::snprintf(buf.data(), buf.size(), "[GLResolver] Library handles: egl=%p gl=%p",
192192
reinterpret_cast<void*>(m_eglLib.Handle()),
193193
reinterpret_cast<void*>(m_glLib.Handle()));
194-
LOG_DEBUG(buf);
194+
LOG_DEBUG(std::string(buf.data()));
195195
}
196196

197197
}
@@ -211,28 +211,28 @@ void GLResolver::DetectBackend()
211211

212212
if (usingEgl)
213213
{
214-
LOG_DEBUG("[GLResolver] current context: EGL");
214+
LOG_DEBUG("[GLResolver] Current context: EGL");
215215
m_backend = Backend::EglGles;
216216
return;
217217
}
218218

219219
#ifndef _WIN32
220220
if (usingGlx)
221221
{
222-
LOG_DEBUG("[GLResolver] current context: GLX");
222+
LOG_DEBUG("[GLResolver] Current context: GLX");
223223
m_backend = Backend::GlxGl;
224224
return;
225225
}
226226
#else
227227
if (usingWgl)
228228
{
229-
LOG_DEBUG("[GLResolver] current context: WGL");
229+
LOG_DEBUG("[GLResolver] Current context: WGL");
230230
m_backend = Backend::WglGl;
231231
return;
232232
}
233233
#endif
234234

235-
LOG_DEBUG("[GLResolver] current context: (unknown, will try generic loader)");
235+
LOG_DEBUG("[GLResolver] Current context: (unknown, will try generic loader)");
236236
m_backend = Backend::None;
237237
}
238238

src/libprojectM/Renderer/PlatformGLResolver.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@ enum class Backend : std::uint8_t
2626
/**
2727
* Detected EGL backend (GL build), or GLES backend (ENABLE_GLES=ON build).
2828
*/
29-
EglGles,
29+
EglGles = 1,
3030

3131
/**
3232
* Detected GLX backend (GL build only).
3333
*/
34-
GlxGl,
34+
GlxGl = 2,
3535

3636
/**
3737
* Detected WGL backend (GL build only).
3838
*/
39-
WglGl,
39+
WglGl = 3,
4040

4141
/**
4242
* User resolver is used, no backend detection.
4343
*/
44-
UserResolver
44+
UserResolver = 4
4545
};
4646

4747
/**
@@ -142,11 +142,11 @@ class GLResolver
142142
bool m_loaded{false}; //!< True if the resolver is initialized.
143143
Backend m_backend{ Backend::None }; //!< Detected GL backend.
144144

145-
UserResolver m_userResolver{nullptr}; //!< User provided function resolver.
145+
UserResolver m_userResolver{nullptr}; //!< User provided function resolver. Optional, may be null.
146146
void* m_userData{nullptr}; //!< User data to pass to user provided function resolver.
147147

148-
DynamicLibrary m_eglLib; //!< EGL library handle. Optional, may not be assigned.
149-
DynamicLibrary m_glLib; //!< Detected GL backend. Optional, may not be assigned.
148+
DynamicLibrary m_eglLib; //!< EGL library handle. Optional, may be null.
149+
DynamicLibrary m_glLib; //!< GL library handle. Optional, may be null.
150150

151151
GetProcFunc m_eglGetProcAddress{nullptr}; //!< Function pointer to EGL proc resolver function.
152152
GetProcFunc m_glxGetProcAddress{nullptr}; //!< Function pointer to GLX proc resolver function.

0 commit comments

Comments
 (0)