| 1 | |
| 2 | # How to Build |
| 3 | |
| 4 | ## Windows with Visual Studio's IDE |
| 5 | |
| 6 | Use the provided project file (.vcxproj). Add to solution (imgui_examples.sln) if necessary. |
| 7 | |
| 8 | ## Windows with Visual Studio's CLI |
| 9 | |
| 10 | Use build_win32.bat or directly: |
| 11 | ``` |
| 12 | set SDL3_DIR=path_to_your_sdl3_folder |
| 13 | cl /Zi /MD /utf-8 /I.. /I..\.. /I%SDL3_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp /FeDebug/example_sdl3_opengl3.exe /FoDebug/ /link /libpath:%SDL3_DIR%\lib\x86 SDL3.lib opengl32.lib /subsystem:console |
| 14 | # ^^ include paths ^^ source files ^^ output exe ^^ output dir ^^ libraries |
| 15 | # or for 64-bit: |
| 16 | cl /Zi /MD /utf-8 /I.. /I..\.. /I%SDL3_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp /FeDebug/example_sdl3_opengl3.exe /FoDebug/ /link /libpath:%SDL3_DIR%\lib\x64 SDL3.lib SDL2mainopengl32.lib /subsystem:console |
| 17 | ``` |
| 18 | |
| 19 | ## Linux and similar Unixes |
| 20 | |
| 21 | Use our Makefile or directly: |
| 22 | ``` |
| 23 | c++ `sdl3-config --cflags` -I .. -I ../.. -I ../../backends |
| 24 | main.cpp ../../backends/imgui_impl_sdl3.cpp ../../backends/imgui_impl_opengl3.cpp ../../imgui*.cpp |
| 25 | `sdl3-config --libs` -lGL -ldl |
| 26 | ``` |
| 27 | |
| 28 | ## macOS |
| 29 | |
| 30 | Use our Makefile or directly: |
| 31 | ``` |
| 32 | brew install sdl3 |
| 33 | c++ `sdl3-config --cflags` -I .. -I ../.. -I ../../backends |
| 34 | main.cpp ../../backends/imgui_impl_sdl3.cpp ../../backends/imgui_impl_opengl3.cpp ../../imgui*.cpp |
| 35 | `sdl3-config --libs` -framework OpenGl -framework CoreFoundation |
| 36 | ``` |
| 37 | |
| 38 | ## Emscripten |
| 39 | |
| 40 | As of 2023-05-30 Emscripten doesn't support SDL3 yet. |