Skip to content

Commit

Permalink
fix a few warnings and clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangliangNan committed Feb 6, 2024
1 parent 71e74b7 commit d8f2117
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Easy3D_BINARY_DIR}/lib)

# Build shared libraries
if (MINGW) # Workaround for using MinGW on Windows
set(Easy3D_BUILD_SHARED_LIBS OFF)
set(Easy3D_BUILD_SHARED_LIBS OFF)
else()
option(Easy3D_BUILD_SHARED_LIBS "Build shared libaries" ON)
option(Easy3D_BUILD_SHARED_LIBS "Build shared libaries" ON )
endif ()
# Build tutorials
option(Easy3D_BUILD_TUTORIALS "Build Easy3D tutorials" ON)
option(Easy3D_BUILD_TUTORIALS "Build Easy3D tutorials" ON )
# Build documentation
option(Easy3D_BUILD_DOCUMENTATION "Build Easy3D documentation" OFF)
# Build tests
Expand Down
5 changes: 5 additions & 0 deletions easy3d/algo_ext/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ set(${module}_sources
add_module(${module} "${${module}_headers}" "${${module}_sources}" "${private_dependencies}" "${public_dependencies}")
target_link_libraries(easy3d_${module} PRIVATE ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES})
target_compile_definitions(easy3d_${module} PUBLIC HAS_CGAL)
#if (MINGW)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mbig-obj")
# message(STATUS "------------********* CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
## target_compile_options(easy3d_${module} PRIVATE -mbig-obj)
#endif ()
install_module(${module})
2 changes: 1 addition & 1 deletion easy3d/renderer/framebuffer_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ namespace easy3d {
glGetIntegerv(GL_MAX_DRAW_BUFFERS, (GLint*)&maxbuffers);

auto buffers = new GLenum[maxbuffers];
int count = 0;
unsigned int count = 0;
for (unsigned int cc = minId; cc <= maxId && count < maxbuffers; cc++) {
buffers[cc] = GL_COLOR_ATTACHMENT0 + cc;
count++;
Expand Down
16 changes: 8 additions & 8 deletions tutorials/Tutorial_202_Viewer_imgui/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ namespace easy3d {
int height /* = 800 */
) : Viewer(title, samples, gl_major, gl_minor, full_screen, resizable, depth_bits, stencil_bits, width, height)
{
#if defined(_WIN32) || defined(MSVC)
// Liangliang: the internal glfw won't be shared across dll boundaries (But seems ok on mac. That is weird!)
glfwInit();
#endif
//#if defined(_WIN32) && defined(_MSC_VER)
// // Liangliang: the internal glfw won't be shared across dll boundaries (But seems ok on macOS. That is weird!)
// glfwInit();
//#endif
}


Expand All @@ -73,10 +73,10 @@ namespace easy3d {
// Not needed: it will be called in the destructor of the base class
//Viewer::cleanup();

#if defined(_WIN32) || defined(MSVC)
// Liangliang: the internal glfw won't be shared across dll boundaries (But seems ok on mac. That is weird!)
glfwTerminate();
#endif
//#if defined(_WIN32) && defined(_MSC_VER)
// // Liangliang: the internal glfw won't be shared across dll boundaries (But seems ok on macOS. That is weird!)
// glfwTerminate();
//#endif
}


Expand Down
3 changes: 3 additions & 0 deletions tutorials/Tutorial_406_CollisionDetection/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
********************************************************************/

#include "viewer.h"

#include <mutex>

#include <easy3d/renderer/drawable_triangles.h>
#include <easy3d/renderer/manipulator.h>
#include <easy3d/renderer/manipulated_frame.h>
Expand Down

0 comments on commit d8f2117

Please sign in to comment.