Skip to content

Commit

Permalink
imGuIZMO.quat ver.2.1.3 - CMake improvement (use of built-in macro_lib)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrutPitt committed Mar 15, 2020
1 parent acae260 commit 70d6224
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
19 changes: 10 additions & 9 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ else()
${SRC}/libs/ImGui/imgui_impl_sdl.cpp
${SRC}/libs/ImGui/imgui_impl_sdl.h)
set(M_GLOBAL_FLAGS "${M_GLOBAL_FLAGS} -DGLAPP_USE_SDL")
include_directories(/usr/include/SDL2)
else()
add_executable(${PROJECT_NAME} ${SOURCE_FILES}
${SRC}/libs/glad/glad.cpp
Expand All @@ -149,21 +148,23 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${M_GLOBAL_FLAGS} ${M_CXX_FLAGS}")


if(WIN32)
set(TARGET_LIBS "")
else()
set(TARGET_LIBS ${CMAKE_DL_LIBS})
endif()

if(USE_SDL)
if(WIN32)
target_link_libraries(${PROJECT_NAME} ${OPENGL_gl_LIBRARY} SDL2 SDL2main)
else()
target_link_libraries(${PROJECT_NAME} ${OPENGL_gl_LIBRARY} SDL2 dl)
endif()
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${OPENGL_gl_LIBRARY} ${SDL2_LIBRARIES} ${TARGET_LIBS})
else()
if(WIN32)
find_package(glfw3 REQUIRED)
target_link_libraries(${PROJECT_NAME} ${OPENGL_gl_LIBRARY} glfw)
else()
else()
#find_package(glfw3 REQUIRED)
target_link_libraries(${PROJECT_NAME} ${OPENGL_gl_LIBRARY} glfw dl)
endif()
target_link_libraries(${PROJECT_NAME} ${OPENGL_gl_LIBRARY} ${TARGET_LIBS} glfw)
endif()

endif ()
4 changes: 2 additions & 2 deletions example/src/tools/transforms.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ class transformsClass {
tM.invMV = inverse(tM.mvMatrix);
}
void buid_invP() {
tM.invP = inverse(tM.pMatrix); //BUGLIGHT
tM.invP = inverse(tM.pMatrix);
}

void setModelMatrix(const mat4& m) { tM.mMatrix = m; }
void setViewMatrix (const mat4& m) { tM.vMatrix = m; }
void setProjMatrix (const mat4& m) { tM.pMatrix = m; buid_invP(); }
void setProjMatrix (const mat4& m) { tM.pMatrix = m; }

mat4& getModelMatrix() { return tM.mMatrix; }
mat4& getViewMatrix () { return tM.vMatrix; }
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# imGuIZMO.quat  v2.1
# imGuIZMO.quat  v2.1.3
**imGuIZMO.quat** is a [**ImGui**](https://github.com/ocornut/imgui) widget: like a trackball it provides a way to rotate models, lights, or objects with mouse, and graphically visualize their position in space, also around any single axis (*Shift/Ctrl/Alt/Super*). It uses **quaternions** algebra, internally, to manage rotations, but offers the possibility also to interfacing with **vec3**, **vec4** or **mat4x4** (rotation)

With **imGuIZMO.quat** you can manipulate an object **with only 4 code lines!**     *(read below)*
Expand Down Expand Up @@ -314,7 +314,7 @@ Use the following command-line defines to enable different options:
- `-DUSE_SDL:BOOL=TRUE` to enable **SDL** framework instead of **GLFW**
- `-DUSE_VIRTUALGIZMO:BOOL=TRUE` to use also (together) [**virtualGizmo3D**](https://github.com/BrutPitt/virtualGizmo3D) to manipulate objects

**this flags are available also in CMakeGUI*
**these flags are available also in CMakeGUI*

To build [**EMSCRIPTEN**](https://kripken.github.io/emscripten-site/index.html) example, use batch/script files:

Expand Down

0 comments on commit 70d6224

Please sign in to comment.