Commit bb5fb8db authored by Philip Trettner's avatar Philip Trettner

Merge branch 'feature/mac-support' into 'develop'

Feature/mac support

See merge request !38
parents aa2fdf3b 59759b6b
......@@ -40,8 +40,9 @@ if (GLOW_CMAKE_REPORT)
message(STATUS " OpenGL : ${GLOW_OPENGL_SUPPORT}")
endif()
if(MSVC)
set(GLOW_LINK_TYPE STATIC CACHE STRING "" FORCE) # unfortunately, we need to link statically here
if(MSVC OR APPLE)
# we need to link statically on Windows and OSX
set(GLOW_LINK_TYPE STATIC CACHE STRING "" FORCE)
endif()
if(APPLE)
......
......@@ -51,10 +51,10 @@ struct FileLocation
const FileLocation getFileLocation(const std::string_view path)
{
const auto predict = [](char character) {
const auto predict = [](char character) -> bool {
#ifdef _WIN32
return character == _T('\\') || character == _T('/');
#elif __unix__
#elif __unix__ || __APPLE__
return character == '/';
#endif // __unix__
};
......@@ -248,6 +248,8 @@ public:
GLOW_RUNTIME_ASSERT(winDirectory != INVALID_HANDLE_VALUE, "Failed to create Win32 directory handle", return nullptr);
return std::make_unique<Monitor>(path, winCloseEvent, winDirectory);
#elif defined __APPLE__
return {};
#endif
}
......
......@@ -7,6 +7,8 @@
#include <glow/common/traits.hh>
#include <glow/gl.hh>
#include <glow/glow.hh>
#include <typed-geometry/types/color.hh>
#include <typed-geometry/types/objects/aabb.hh>
#include <typed-geometry/types/pos.hh>
......@@ -223,9 +225,20 @@ struct debugGroup
{
GLOW_NON_COPYABLE(debugGroup);
debugGroup(std::string const& name, GLuint id = 0) { glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, id, -1, name.c_str()); }
debugGroup(std::string const& name, GLuint id = 0)
{
if (glow::OGLVersion.total >= 43)
{
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, id, -1, name.c_str());
}
}
~debugGroup() { glPopDebugGroup(); }
~debugGroup() {
if (glow::OGLVersion.total >= 43)
{
glPopDebugGroup();
}
}
};
#define GLOW_SCOPED_ENUM_VALUED_GL_FUNC(name, func, getName) \
......
......@@ -9,6 +9,10 @@ std::string glow::detail::getObjectLabel(GLenum glNamespace, GLuint objectName)
{
checkValidGLOW();
// getObjectLabel requires OpenGL 4.3 or higher
if (glow::OGLVersion.total < 43)
return "";
GLsizei len = 0;
glGetObjectLabel(glNamespace, objectName, 0, &len, nullptr);
......@@ -23,6 +27,10 @@ void glow::detail::setObjectLabel(GLenum glNamespace, GLuint objectName, std::st
{
checkValidGLOW();
// glObjectLabel requires OpenGL 4.3 or higher
if (glow::OGLVersion.total < 43)
return;
if (label.size() > maxLength)
{
auto s = std::string(label.substr(0, maxLength)) + "...";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment