Skip to content

Commit b2dfcb7

Browse files
committed
Eveyrhing is now GLES and OpenGL 3.3 compatible in theory.
Should compile on MacOS.
1 parent 913a1e4 commit b2dfcb7

11 files changed

+172
-99
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ cache: ccache
55
branches:
66
only:
77
- master
8-
- michael
98
addons:
109
apt:
1110
sources:
@@ -40,7 +39,7 @@ matrix:
4039
compiler: gcc-7
4140
env:
4241
- MATRIX_EVAL="export CC=gcc-7 CXX=g++-7 CONFIG=Release PYTHON=python3"
43-
- os: linux
42+
- os: linux # same config like above but with -DLIBIGL_USE_STATIC_LIBRARY=OFF to test static and header-only builds
4443
compiler: gcc-7
4544
env:
4645
- MATRIX_EVAL="export CC=gcc-7 CXX=g++-7 CONFIG=Release PYTHON=python3 CMAKE_EXTRA='-DLIBIGL_USE_STATIC_LIBRARY=OFF'"

CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ project(fish_deformation)
33

44
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
55
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/voroffset/cmake)
6-
6+
if (APPLE)
7+
set(CMAKE_PREFIX_PATH /usr/local/opt/qt/lib/cmake)
8+
endif()
79

810

911

@@ -110,8 +112,13 @@ file(GLOB CT_SRCS external/Segmentangling/ContourTree/*.cpp)
110112
set(CT_INCLUDE_DIRS external/Segmentangling/ContourTree)
111113
list(REMOVE_ITEM CT_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/external/Segmentangling/ContourTree/main.cpp")
112114
add_library(contourtree STATIC ${CT_SRCS})
113-
target_compile_options(contourtree PRIVATE "-fopenmp")
114-
target_link_libraries(contourtree Qt5::Core Qt5::Widgets -fopenmp spdlog)
115+
if(NOT APPLE)
116+
target_link_libraries(contourtree Qt5::Core Qt5::Widgets -fopenmp spdlog)
117+
target_compile_options(contourtree PRIVATE "-fopenmp")
118+
target_link_libraries(contourtree Qt5::Core Qt5::Widgets -fopenmp spdlog)
119+
else()
120+
target_link_libraries(contourtree Qt5::Core Qt5::Widgets spdlog)
121+
endif()
115122
target_include_directories(contourtree PUBLIC ${CT_INCLUDE_DIRS})
116123
target_compile_definitions(contourtree PUBLIC CONTOUR_TREE_USE_SPDLOG)
117124

@@ -125,7 +132,7 @@ list(FILTER UTILS_HEADER EXCLUDE REGEX cgal*)
125132
add_library(utils STATIC ${UTILS_SRCS} ${UTILS_HEADER})
126133
set_property(TARGET utils PROPERTY CXX_STANDARD 14)
127134
set_property(TARGET utils PROPERTY CXX_STANDARD_REQUIRED ON)
128-
target_link_libraries(utils igl::core igl::opengl igl::cgal igl::triangle spdlog Qt5::Core Qt5::Widgets spdlog)
135+
target_link_libraries(utils igl::core igl::opengl igl::cgal igl::triangle spdlog Qt5::Core Qt5::Widgets spdlog glfw)
129136
target_include_directories(utils PUBLIC ${UTILS_INCLUDE_DIRS})
130137
target_include_directories(utils SYSTEM PUBLIC "${PROJECT_SOURCE_DIR}/external/glm")
131138

src/main.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ bool init(igl::opengl::glfw::Viewer& viewer) {
5656
ct_logger->set_level(CONTOURTREE_LOGGER_LEVEL);
5757
contourtree::Logger::setLogger(ct_logger);
5858

59-
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
60-
glDebugMessageCallback(log_opengl_debug, NULL);
61-
59+
init_opengl_debugging(log_opengl_debug);
6260
return false;
6361
}
6462

src/ui/bounding_widget_2d.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ bool Bounding_Polygon_Widget::post_draw(BoundingCage::KeyFrameIterator kf, bool
563563
//
564564
// Render the slice of the volume for this keyframe into an OpenGL texture
565565
//
566-
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, "Render slice");
566+
push_opengl_debug_group("Render Slice");
567567
{
568568
glUseProgram(plane.program);
569569
glBindVertexArray(empty_vao);
@@ -600,13 +600,13 @@ bool Bounding_Polygon_Widget::post_draw(BoundingCage::KeyFrameIterator kf, bool
600600
glBindVertexArray(0);
601601
glUseProgram(0);
602602
}
603-
glPopDebugGroup();
603+
pop_opengl_debug_group();
604604

605605

606606
//
607607
// Render the bounding-box, center, and axes into the same texture
608608
//
609-
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, "Render polygon");
609+
push_opengl_debug_group("Render Polygon");
610610
{
611611
const glm::vec2 centroid_2d = G2f(kf->centroid_2d());
612612
const glm::vec2 r_axis = G2f(kf->right_rotated_2d()), u_axis = G2f(kf->up_rotated_2d());
@@ -647,7 +647,7 @@ bool Bounding_Polygon_Widget::post_draw(BoundingCage::KeyFrameIterator kf, bool
647647
}
648648
}
649649
}
650-
glPopDebugGroup();
650+
pop_opengl_debug_group();
651651

652652
// Restore the framebuffer and viewport
653653
glBindFramebuffer(GL_FRAMEBUFFER, 0);
@@ -658,7 +658,7 @@ bool Bounding_Polygon_Widget::post_draw(BoundingCage::KeyFrameIterator kf, bool
658658
//
659659
// Blit the texture we just rendered to the screen
660660
//
661-
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, "Texture Blit");
661+
push_opengl_debug_group("Texture Blit");
662662
{
663663
int width;
664664
int height;
@@ -709,7 +709,7 @@ bool Bounding_Polygon_Widget::post_draw(BoundingCage::KeyFrameIterator kf, bool
709709
glBindVertexArray(0);
710710
glUseProgram(0);
711711
}
712-
glPopDebugGroup();
712+
pop_opengl_debug_group();
713713
glEnable(GL_DEPTH_TEST);
714714

715715
return false;

src/utils/gl/point_line_rendering.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "point_line_rendering.h"
2+
#include "utils/utils.h"
23

34
#include <igl/opengl/create_shader_program.h>
45

@@ -68,7 +69,7 @@ void PointLineRenderer::destroy() {
6869

6970

7071
bool PointLineRenderer::update_polyline_3d(int polyline_id, GLfloat* vertices, GLfloat* colors, GLsizei num_vertices, PolylineStyle style) {
71-
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, "update_polyline_3d");
72+
push_opengl_debug_group("update_polyline_3d");
7273
if (polyline_id >= _polylines.size() || polyline_id < 0) {
7374
return false;
7475
}
@@ -93,12 +94,12 @@ bool PointLineRenderer::update_polyline_3d(int polyline_id, GLfloat* vertices, G
9394

9495
glBindBuffer(GL_ARRAY_BUFFER, 0);
9596

96-
glPopDebugGroup();
97+
pop_opengl_debug_group();
9798
return true;
9899
}
99100

100101
bool PointLineRenderer::update_polyline_3d(int polyline_id, GLfloat* vertices, glm::vec4 color, GLsizei num_vertices, PolylineStyle style) {
101-
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, "update_polyline_3d");
102+
push_opengl_debug_group("update_polyline_3d");
102103
if (polyline_id >= _polylines.size() || polyline_id < 0) {
103104
return false;
104105
}
@@ -123,13 +124,13 @@ bool PointLineRenderer::update_polyline_3d(int polyline_id, GLfloat* vertices, g
123124
glDisableVertexAttribArray(1);
124125
glBindVertexArray(0);
125126

126-
glPopDebugGroup();
127+
pop_opengl_debug_group();
127128
return true;
128129
}
129130

130131

131132
int PointLineRenderer::add_polyline_3d(GLfloat* vertices, GLfloat* colors, GLsizei num_vertices, PolylineStyle style) {
132-
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, "add_polyline_3d");
133+
push_opengl_debug_group("add_polyline_3d");
133134

134135
Polyline polyline;
135136

@@ -170,13 +171,13 @@ int PointLineRenderer::add_polyline_3d(GLfloat* vertices, GLfloat* colors, GLsiz
170171
_polylines.push_back(polyline);
171172
}
172173

173-
glPopDebugGroup();
174+
pop_opengl_debug_group();
174175

175176
return polyline_id;
176177
}
177178

178179
int PointLineRenderer::add_polyline_3d(GLfloat* vertices, glm::vec4 color, GLsizei num_vertices, PolylineStyle style) {
179-
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, -1, "add_polyline_3d");
180+
push_opengl_debug_group("add_polyline_3d");
180181

181182
Polyline polyline;
182183

@@ -210,7 +211,7 @@ int PointLineRenderer::add_polyline_3d(GLfloat* vertices, glm::vec4 color, GLsiz
210211
_polylines.push_back(polyline);
211212
}
212213

213-
glPopDebugGroup();
214+
pop_opengl_debug_group();
214215

215216
return polyline_id;
216217
}

0 commit comments

Comments
 (0)