👋 only print opengl errors if errors actually occurred. also fixed building on gcc

This commit is contained in:
LDA 2023-06-23 01:54:39 -07:00
parent 176c79bada
commit fa5042902c
3 changed files with 3 additions and 5 deletions

View File

@ -693,8 +693,6 @@ void OpenGl20Renderer::GlRenderBuffer::set(List<RenderPrimitive> primitives) {
}
void OpenGl20Renderer::logGlErrorSummary(String prefix) {
prefix += ": ";
Logger::error(prefix.utf8Ptr());
List<GLenum> errors;
while (GLenum error = glGetError())
errors.append(error);

View File

@ -28,9 +28,9 @@ String const& FontTextureGroup::activeFont() {
return m_fontName;
}
void FontTextureGroup::addFont(FontPtr const& font, String const& name, bool default) {
void FontTextureGroup::addFont(FontPtr const& font, String const& name, bool isDefault) {
m_fonts[name] = font;
if (default)
if (isDefault)
m_defaultFont = m_font = font;
}

View File

@ -35,7 +35,7 @@ public:
// Switches the current font
void switchFont(String const& font);
String const& activeFont();
void addFont(FontPtr const& font, String const& name, bool default = false);
void addFont(FontPtr const& font, String const& name, bool isDefault = false);
void clearFonts();
private:
StringMap<FontPtr> m_fonts;