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