Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gui-builder/src/GuiBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ namespace
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} // namespace
} // anonymous namespace

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Expand Down
83 changes: 40 additions & 43 deletions include/TGUI/Backend/Renderer/OpenGL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,54 +90,51 @@
#define TGUI_GL_CHECK(expr) expr
#endif

namespace tgui
namespace tgui::priv
{
namespace priv
{
#if !defined(NDEBUG) && !defined(TGUI_NO_RUNTIME_WARNINGS)
inline void checkAndLogErrorOpenGL(const char* file, unsigned int line, const char* expression)
{
const GLenum errorCode = glGetError();
if (errorCode == GL_NO_ERROR)
return;

const char* error;
switch (errorCode)
{
case GL_INVALID_ENUM:
error = "GL_INVALID_ENUM";
break;
case GL_INVALID_VALUE:
error = "GL_INVALID_VALUE";
break;
case GL_INVALID_OPERATION:
error = "GL_INVALID_OPERATION";
break;
case GL_STACK_OVERFLOW:
error = "GL_STACK_OVERFLOW";
break;
case GL_STACK_UNDERFLOW:
error = "GL_STACK_UNDERFLOW";
break;
case GL_OUT_OF_MEMORY:
error = "GL_OUT_OF_MEMORY";
break;
default:
error = "Unknown error";
break;
}
inline void checkAndLogErrorOpenGL(const char* file, unsigned int line, const char* expression)
{
const GLenum errorCode = glGetError();
if (errorCode == GL_NO_ERROR)
return;

const std::string fileStr = file;
TGUI_PRINT_WARNING(
"An internal OpenGL call failed in " + fileStr.substr(fileStr.find_last_of("\\/") + 1) + "("
+ std::to_string(line) + ")." + "\nExpression:\n " + expression + "\nError description:\n " + error + "\n");
}
#else
inline void checkAndLogErrorOpenGL(const char*, unsigned int, const char*)
const char* error;
switch (errorCode)
{
case GL_INVALID_ENUM:
error = "GL_INVALID_ENUM";
break;
case GL_INVALID_VALUE:
error = "GL_INVALID_VALUE";
break;
case GL_INVALID_OPERATION:
error = "GL_INVALID_OPERATION";
break;
case GL_STACK_OVERFLOW:
error = "GL_STACK_OVERFLOW";
break;
case GL_STACK_UNDERFLOW:
error = "GL_STACK_UNDERFLOW";
break;
case GL_OUT_OF_MEMORY:
error = "GL_OUT_OF_MEMORY";
break;
default:
error = "Unknown error";
break;
}

const std::string fileStr = file;
TGUI_PRINT_WARNING(
"An internal OpenGL call failed in " + fileStr.substr(fileStr.find_last_of("\\/") + 1) + "(" + std::to_string(line)
+ ")." + "\nExpression:\n " + expression + "\nError description:\n " + error + "\n");
}
#else
inline void checkAndLogErrorOpenGL(const char*, unsigned int, const char*)
{
}
#endif
} // namespace priv
} // namespace tgui
} // namespace tgui::priv

#endif // TGUI_OPENGL_HPP
2 changes: 0 additions & 2 deletions include/TGUI/Backend/Renderer/SFML-Graphics/CanvasSFML.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,4 @@ namespace tgui
};
} // namespace tgui

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#endif // TGUI_CANVAS_SFML_HPP
6 changes: 1 addition & 5 deletions include/TGUI/Backend/Window/GLFW/BackendGuiGLFW.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,9 @@ TGUI_IGNORE_DEPRECATED_WARNINGS_START // Required for VS2017 due to inheriting a

protected:
GLFWwindow* m_window = nullptr;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
};
}
} // namespace tgui

TGUI_IGNORE_DEPRECATED_WARNINGS_END

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#endif // TGUI_BACKEND_GUI_GLFW_HPP
6 changes: 1 addition & 5 deletions include/TGUI/Backend/Window/Raylib/BackendRaylib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,8 @@ TGUI_IGNORE_DEPRECATED_WARNINGS_START // Required for VS2017 due to inheriting a
[[nodiscard]] std::unique_ptr<std::uint8_t[]> readFileFromAndroidAssets(const String& filename, std::size_t& fileSize) const override;
#endif
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
} // namespace tgui

TGUI_IGNORE_DEPRECATED_WARNINGS_END

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#endif // TGUI_BACKEND_RAYLIB_HPP
6 changes: 1 addition & 5 deletions include/TGUI/Backend/Window/SDL/BackendSDL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,8 @@ TGUI_IGNORE_DEPRECATED_WARNINGS_START // Required for VS2017 due to inheriting a
bool m_customCursorX11 = false;
#endif
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
} // namespace tgui

TGUI_IGNORE_DEPRECATED_WARNINGS_END

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#endif // TGUI_BACKEND_SDL_HPP
6 changes: 1 addition & 5 deletions include/TGUI/Backend/Window/SFML/BackendSFML.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,8 @@ TGUI_IGNORE_DEPRECATED_WARNINGS_START // Required for VS2017 due to inheriting a

static std::vector<std::unique_ptr<sf::Cursor>> m_leakedCursors;
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
} // namespace tgui

TGUI_IGNORE_DEPRECATED_WARNINGS_END

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#endif // TGUI_BACKEND_SFML_HPP
2 changes: 1 addition & 1 deletion include/TGUI/Renderers/TextBoxRenderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
namespace tgui
{
using TextBoxRenderer TGUI_DEPRECATED("TextBoxRenderer has been renamed to TextAreaRenderer") = TextAreaRenderer;
}
} // namespace tgui

#endif // TGUI_TEXT_BOX_RENDERER_HPP
9 changes: 3 additions & 6 deletions include/TGUI/SvgImage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace tgui
namespace tgui::priv
{
namespace priv
{
struct SvgImageData;
}
} // namespace tgui
struct SvgImageData;
} // namespace tgui::priv

namespace tgui
{
Expand Down
Loading
Loading