Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix realsense viewer on macos #3195

Merged
merged 5 commits into from
Feb 3, 2019
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
13 changes: 13 additions & 0 deletions common/ux-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,19 @@ namespace rs2

gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);

// OpenGL 2.1 backward-compatibility fixes.
// On macOS, the compatibility profile is OpenGL 2.1 + extensions.
if (!GLAD_GL_VERSION_3_0 && !GLAD_GL_ARB_vertex_array_object) {
if (GLAD_GL_APPLE_vertex_array_object) {
glBindVertexArray = glBindVertexArrayAPPLE;
glDeleteVertexArrays = glDeleteVertexArraysAPPLE;
glGenVertexArrays = glGenVertexArraysAPPLE;
glIsVertexArray = glIsVertexArrayAPPLE;
} else {
throw std::runtime_error("OpenGL 3.0 or ARB_vertex_array_object extension required!");
}
}

prepare_config_file();

glfwDestroyWindow(ctx);
Expand Down
20 changes: 10 additions & 10 deletions third-party/glad/KHR/khrplatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define __khrplatform_h_

/*
** Copyright (c) 2008-2009 The Khronos Group Inc.
** Copyright (c) 2008-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
Expand All @@ -26,18 +26,16 @@

/* Khronos platform-specific types and definitions.
*
* $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $
* The master copy of khrplatform.h is maintained in the Khronos EGL
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
* The last semantic modification to khrplatform.h was at commit ID:
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692
*
* Adopters may modify this file to suit their platform. Adopters are
* encouraged to submit platform specific modifications to the Khronos
* group so that they can be included in future versions of this file.
* Please submit changes by sending them to the public Khronos Bugzilla
* (http://khronos.org/bugzilla) by filing a bug against product
* "Khronos (general)" component "Registry".
*
* A predefined template which fills in some of the bug fields can be
* reached using http://tinyurl.com/khrplatform-h-bugreport, but you
* must create a Bugzilla login first.
* Please submit changes by filing pull requests or issues on
* the EGL Registry repository linked above.
*
*
* See the Implementer's Guidelines for information about where this file
Expand Down Expand Up @@ -101,6 +99,8 @@
# define KHRONOS_APICALL __declspec(dllimport)
#elif defined (__SYMBIAN32__)
# define KHRONOS_APICALL IMPORT_C
#elif defined(__ANDROID__)
# define KHRONOS_APICALL __attribute__((visibility("default")))
#else
# define KHRONOS_APICALL
#endif
Expand Down Expand Up @@ -223,7 +223,7 @@ typedef signed short int khronos_int16_t;
typedef unsigned short int khronos_uint16_t;

/*
* Types that differ between LLP64 and LP64 architectures - in LLP64,
* Types that differ between LLP64 and LP64 architectures - in LLP64,
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
* to be the only LLP64 architecture in current use.
*/
Expand Down
Loading