Skip to content

Commit 40f9d1a

Browse files
committed
Merge branch 'implot' of github.com:Devsh-Graphics-Programming/Nabla
2 parents abbf79c + 4f8e56b commit 40f9d1a

File tree

6 files changed

+34
-9
lines changed

6 files changed

+34
-9
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,6 @@
8787
[submodule "3rdparty/imgui"]
8888
path = 3rdparty/imgui
8989
url = git@github.com:ocornut/imgui.git
90+
[submodule "3rdparty/implot"]
91+
path = 3rdparty/implot
92+
url = git@github.com:epezent/implot.git

3rdparty/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,24 @@ if(NBL_BUILD_IMGUI)
250250
PUBLIC "imgui/backends"
251251
)
252252

253+
# ImPlot
254+
add_library(implot STATIC
255+
"implot/implot.h"
256+
"implot/implot_internal.h"
257+
"implot/implot.cpp"
258+
"implot/implot_items.cpp"
259+
)
260+
target_include_directories(implot
261+
PUBLIC "imgui"
262+
)
263+
target_link_libraries(implot PUBLIC imgui)
264+
target_compile_definitions(implot PUBLIC IMPLOT_DEBUG IMPLOT_DLL_EXPORT)
265+
set_property(TARGET implot PROPERTY CXX_STANDARD 11)
266+
if(MSVC)
267+
target_compile_options(implot PRIVATE /MT /W4 /WX /arch:AVX2 /fp:fast /permissive-)
268+
else()
269+
target_compile_options(implot PRIVATE -Wall -Wextra -pedantic -Werror -mavx2 -Ofast)
270+
endif()
253271
endif()
254272

255273
add_library(aesGladman OBJECT

3rdparty/implot

Submodule implot added at 18758e2

cmake/common.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,11 @@ macro(nbl_create_ext_library_project EXT_NAME LIB_HEADERS LIB_SOURCES LIB_INCLUD
238238
target_link_libraries(${LIB_NAME} PUBLIC Nabla)
239239
target_compile_options(${LIB_NAME} PUBLIC ${LIB_OPTIONS})
240240
target_compile_definitions(${LIB_NAME} PUBLIC ${DEF_OPTIONS})
241-
set_target_properties(${LIB_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
241+
if(NBL_DYNAMIC_MSVC_RUNTIME)
242+
set_target_properties(${LIB_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
243+
else()
244+
set_target_properties(${LIB_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
245+
endif()
242246

243247
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
244248
add_compile_options(

include/nbl/ext/ImGui/ImGui.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#ifndef NBL_EXT_IMGUI_UI_H
22
#define NBL_EXT_IMGUI_UI_H
33

4-
#include <glm/vec3.hpp>
54

65
namespace nbl::ext::imgui
76
{
8-
class NBL_API2 UI final : public core::IReferenceCounted{
7+
class UI final : public core::IReferenceCounted{
98
public:
109

11-
explicit UI(
10+
UI(
1211
core::smart_refctd_ptr<video::ILogicalDevice> device,
1312
int maxFramesInFlight,
1413
core::smart_refctd_ptr<video::IGPURenderpass>& renderPass,
@@ -52,7 +51,7 @@ namespace nbl::ext::imgui
5251

5352
void InputFloat4(char const* label, float* value);
5453

55-
void InputFloat3(char const* label, glm::vec3& value);
54+
void InputFloat3(char const* label, nbl::core::vector3df& value);
5655

5756
bool Combo(
5857
char const* label,

src/nbl/ext/ImGui/ImGui.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -879,14 +879,14 @@ namespace nbl::ext::imgui
879879

880880
//-------------------------------------------------------------------------------------------------
881881

882-
void UI::InputFloat3(char const* label, glm::vec3& value)
882+
void UI::InputFloat3(char const* label, nbl::core::vector3df&value)
883883
{
884-
float tempValue[3]{ value.x, value.y, value.z };
884+
float tempValue[3]{ value.X, value.Y, value.Z };
885885
InputFloat3(label, tempValue);
886886

887-
if (memcmp(tempValue, &value[0], sizeof(float) * 3) != 0)
887+
if (memcmp(tempValue, &value.X, sizeof(float) * 3) != 0)
888888
{
889-
memcpy(&value[0], tempValue, sizeof(float) * 3);
889+
memcpy(&value.X, tempValue, sizeof(float) * 3);
890890
}
891891
}
892892

0 commit comments

Comments
 (0)