From 2403ed92a346e4b816d375e8542b430b9841169f Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 31 Mar 2021 16:14:18 +0200 Subject: [PATCH] Added build/ to gitignore (#3027), Examples: SDL2: Link with shell32.lib required by SDL2main.lib since SDL 2.0.12. [#3988, #3884] + added batch file for SDL+Vulkan. --- .gitignore | 3 +++ docs/CHANGELOG.txt | 1 + examples/example_sdl_directx11/build_win32.bat | 2 +- examples/example_sdl_opengl2/build_win32.bat | 2 +- examples/example_sdl_opengl3/build_win32.bat | 2 +- examples/example_sdl_vulkan/build_win32.bat | 10 ++++++++++ 6 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 examples/example_sdl_vulkan/build_win32.bat diff --git a/.gitignore b/.gitignore index 8d7201998..86bed609c 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,9 @@ ipch *.VC.db *.VC.VC.opendb +## Commonly used CMake directories +/build*/ + ## Xcode artifacts project.xcworkspace xcuserdata diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index ff7a64d6a..8dcbbae52 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -59,6 +59,7 @@ Other Changes: VkPhysicalDeviceLimits::nonCoherentAtomSize. (#3957) [@AgentX1994] - Examples: Add OpenGL ES 2.0 support to modern GL examples. (#2837, #3951) [@lethal-guitar, @hinxx] - Examples: Vulkan: Rebuild swapchain on VK_SUBOPTIMAL_KHR. (#3881) +- Examples: SDL2: Link with shell32.lib required by SDL2main.lib since SDL 2.0.12. [#3988] - Docs: Improvements to minor mistakes in documentation comments (#3923) [@ANF-Studios] diff --git a/examples/example_sdl_directx11/build_win32.bat b/examples/example_sdl_directx11/build_win32.bat index 7433c74f8..b93082704 100644 --- a/examples/example_sdl_directx11/build_win32.bat +++ b/examples/example_sdl_directx11/build_win32.bat @@ -3,6 +3,6 @@ @set OUT_EXE=example_sdl_directx11 @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I "%DXSDK_DIR%Include" @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_dx11.cpp ..\..\imgui*.cpp -@set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib /LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d11.lib d3dcompiler.lib +@set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib /LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d11.lib d3dcompiler.lib shell32.lib mkdir %OUT_DIR% cl /nologo /Zi /MD %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console diff --git a/examples/example_sdl_opengl2/build_win32.bat b/examples/example_sdl_opengl2/build_win32.bat index d7fb003b3..47529e289 100644 --- a/examples/example_sdl_opengl2/build_win32.bat +++ b/examples/example_sdl_opengl2/build_win32.bat @@ -3,6 +3,6 @@ @set OUT_EXE=example_sdl_opengl2 @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp -@set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib +@set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib shell32.lib mkdir %OUT_DIR% cl /nologo /Zi /MD %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console diff --git a/examples/example_sdl_opengl3/build_win32.bat b/examples/example_sdl_opengl3/build_win32.bat index 8f5496016..72e89b199 100644 --- a/examples/example_sdl_opengl3/build_win32.bat +++ b/examples/example_sdl_opengl3/build_win32.bat @@ -3,6 +3,6 @@ @set OUT_EXE=example_sdl_opengl3 @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include /I..\libs\gl3w @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp ..\libs\gl3w\GL\gl3w.c -@set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib +@set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib shell32.lib mkdir %OUT_DIR% cl /nologo /Zi /MD %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console diff --git a/examples/example_sdl_vulkan/build_win32.bat b/examples/example_sdl_vulkan/build_win32.bat new file mode 100644 index 000000000..21b5ea314 --- /dev/null +++ b/examples/example_sdl_vulkan/build_win32.bat @@ -0,0 +1,10 @@ +@REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. + +@set OUT_EXE=example_sdl_vulkan +@set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include /I %VULKAN_SDK%\include +@set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\imgui*.cpp +@set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 /libpath:%VULKAN_SDK%\lib32 SDL2.lib SDL2main.lib shell32.lib vulkan-1.lib + +@set OUT_DIR=Debug +mkdir %OUT_DIR% +cl /nologo /Zi /MD %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console