Skip to content

Commit

Permalink
Allow the possibility to override the link of glfw3
Browse files Browse the repository at this point in the history
  • Loading branch information
soufianekhiat committed Jun 1, 2024
1 parent f86cd97 commit b3965df
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ImPlatform/ImPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler( HWND hWnd, UINT ms
#if (IM_CURRENT_GFX != IM_GFX_OPENGL2) && (IM_CURRENT_GFX != IM_GFX_OPENGL3)
#include <backends/imgui_impl_glfw.cpp>
#endif
#if IM_GLFW3_AUTO_LINK
#pragma comment( lib, "../GLFW/lib-vc2010-64/glfw3.lib" )
#endif
#elif (IM_CURRENT_PLATFORM) == IM_PLATFORM_APPLE)
#else
#error IM_CURRENT_TARGET not specified correctly
Expand Down
7 changes: 6 additions & 1 deletion ImPlatform/ImPlatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

#include <imgui.h>

// To override the link of glfw3 use to 1
#ifndef IM_GLFW3_AUTO_LINK
#define IM_GLFW3_AUTO_LINK 1
#endif

// - [ O ] WIN32_OPENGL3
// - [ O ] WIN32_DIRECTX9
// - [ O ] WIN32_DIRECTX10
Expand Down Expand Up @@ -172,7 +177,7 @@ struct PlatformDataImpl
MSG oMessage;

// Dx12 Backend uses WM_SIZE to resize buffers
#if (IM_CURRENT_GFX != IM_GFX_DIRECTX12) && (IM_CURRENT_GFX != IM_GFX_OPENGL3) && (IM_CURRENT_GFX != IM_GFX_OPENGL2s)
#if (IM_CURRENT_GFX != IM_GFX_DIRECTX12) && (IM_CURRENT_GFX != IM_GFX_OPENGL3) && (IM_CURRENT_GFX != IM_GFX_OPENGL2)
UINT uResizeWidth = 0;
UINT uResizeHeight = 0;
#endif
Expand Down
2 changes: 1 addition & 1 deletion ImPlatformDemo/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include <stb_image.h>
#endif

bool g_bSimpleAPI = true;
static bool g_bSimpleAPI = true;

int main()
{
Expand Down

0 comments on commit b3965df

Please sign in to comment.