| 1 | |
| 2 | # How to Build |
| 3 | |
| 4 | - On Windows with Visual Studio's IDE |
| 5 | |
| 6 | Use the provided project file (.vcxproj). Add to solution (imgui_examples.sln) if necessary. |
| 7 | |
| 8 | - On Windows with Visual Studio's CLI |
| 9 | |
| 10 | ``` |
| 11 | set SDL2_DIR=path_to_your_sdl2_folder |
| 12 | cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl2_opengl2.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console |
| 13 | # ^^ include paths ^^ source files ^^ output exe ^^ output dir ^^ libraries |
| 14 | # or for 64-bit: |
| 15 | cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl2_opengl2.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x64 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console |
| 16 | ``` |
| 17 | |
| 18 | - On Linux and similar Unixes |
| 19 | |
| 20 | ``` |
| 21 | c++ `sdl2-config --cflags` -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_sdl2.cpp ../../backends/imgui_impl_opengl2.cpp ../../imgui*.cpp `sdl2-config --libs` -lGL |
| 22 | ``` |
| 23 | |
| 24 | - On Mac OS X |
| 25 | |
| 26 | ``` |
| 27 | brew install sdl2 |
| 28 | c++ `sdl2-config --cflags` -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_sdl2.cpp ../../backends/imgui_impl_opengl2.cpp ../../imgui*.cpp `sdl2-config --libs` -framework OpenGl |
| 29 | ``` |