diff --git a/CMakeLists.txt b/CMakeLists.txt index 56a081b5..56135f1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,7 +163,7 @@ set_target_properties( ${PROJECT_NAME} DEBUG_POSTFIX "_d" ) -cmake_policy(SET CMP0072 NEW) +#cmake_policy(SET CMP0072 NEW) find_package(OpenGL REQUIRED) include_directories(${OPENGL_INCLUDE_DIR}) target_link_libraries(${PROJECT_NAME} ${OPENGL_LIBRARIES}) diff --git a/EU07.cpp b/EU07.cpp index a07e2212..6a0f80d5 100644 --- a/EU07.cpp +++ b/EU07.cpp @@ -248,10 +248,10 @@ int main(int argc, char *argv[]) // memory leaks _CrtSetDbgFlag( _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG ) | _CRTDBG_LEAK_CHECK_DF ); // floating point operation errors - auto state = _clearfp(); - state = _control87( 0, 0 ); + //auto state = _clearfp(); + //state = _control87( 0, 0 ); // this will turn on FPE for #IND and zerodiv - state = _control87( state & ~( _EM_ZERODIVIDE | _EM_INVALID ), _MCW_EM ); + //state = _control87( state & ~( _EM_ZERODIVIDE | _EM_INVALID ), _MCW_EM ); #endif #ifdef _WIN32 ::SetUnhandledExceptionFilter( unhandled_handler ); diff --git a/imgui/imgui.h b/imgui/imgui.h index b9e3a6d2..84b830a2 100644 --- a/imgui/imgui.h +++ b/imgui/imgui.h @@ -1281,12 +1281,16 @@ public: // Helper: IM_NEW(), IM_PLACEMENT_NEW(), IM_DELETE() macros to call MemAlloc + Placement New, Placement Delete + MemFree // We call C++ constructor on own allocated memory via the placement "new(ptr) Type()" syntax. // Defining a custom placement new() with a dummy parameter allows us to bypass including which on some platforms complains when user has disabled exceptions. -struct ImNewDummy {}; -inline void* operator new(size_t, ImNewDummy, void* ptr) { return ptr; } -inline void operator delete(void*, ImNewDummy, void*) {} // This is only required so we can use the symetrical new() -#define IM_PLACEMENT_NEW(_PTR) new(ImNewDummy(), _PTR) -#define IM_NEW(_TYPE) new(ImNewDummy(), ImGui::MemAlloc(sizeof(_TYPE))) _TYPE -template void IM_DELETE(T* p) { if (p) { p->~T(); ImGui::MemFree(p); } } +//struct ImNewDummy {}; +//inline void* operator new(size_t, ImNewDummy, void* ptr) { return ptr; } +//inline void operator delete(void*, ImNewDummy, void*) {} // This is only required so we can use the symetrical new() +//#define IM_PLACEMENT_NEW(_PTR) new(ImNewDummy(), _PTR) +//#define IM_NEW(_TYPE) new(ImNewDummy(), ImGui::MemAlloc(sizeof(_TYPE))) _TYPE +//template void IM_DELETE(T* p) { if (p) { p->~T(); ImGui::MemFree(p); } } + +#define IM_PLACEMENT_NEW(_PTR) new (_PTR) +#define IM_NEW(_TYPE) new _TYPE +#define IM_DELETE(_X) delete _X // Helper: Execute a block of code at maximum once a frame. Convenient if you want to quickly create an UI within deep-nested code that runs multiple times every frame. // Usage: static ImGuiOnceUponAFrame oaf; if (oaf) ImGui::Text("This will be called only once per frame"); diff --git a/imgui/imgui_draw.cpp b/imgui/imgui_draw.cpp index dfb8bb4b..2162a40f 100644 --- a/imgui/imgui_draw.cpp +++ b/imgui/imgui_draw.cpp @@ -13,6 +13,7 @@ #define _CRT_SECURE_NO_WARNINGS #endif +#undef new #include "imgui.h" #define IMGUI_DEFINE_MATH_OPERATORS #include "imgui_internal.h" diff --git a/renderer.cpp b/renderer.cpp index 2e75b885..a55ad854 100644 --- a/renderer.cpp +++ b/renderer.cpp @@ -284,6 +284,7 @@ opengl_renderer::Render_pass( rendermode const Mode ) { glDebug("rendermode::color"); { + /* glDebug("render shadowmap start"); Timer::subsystem.gfx_shadows.start(); @@ -301,6 +302,7 @@ glm::vec3{ m_renderpass.camera.position() - m_shadowpass.camera.position() } ); Timer::subsystem.gfx_shadows.stop(); glDebug("render shadowmap end"); + */ } m_main_fb->bind(); diff --git a/stdafx.h b/stdafx.h index 2fd8807a..5c4558d2 100644 --- a/stdafx.h +++ b/stdafx.h @@ -107,4 +107,11 @@ #define glDebug(x) if (GLEW_GREMEDY_string_marker) glStringMarkerGREMEDY(0, __FILE__ ":" STRINGIZE(__LINE__) ": " x); #endif +#ifdef DBG_NEW +#pragma push_macro("new") +#undef new #include "imgui/imgui.h" +#pragma pop_macro("new") +#else +#include "imgui/imgui.h" +#endif \ No newline at end of file