• Home
Name Date Size #Lines LOC

..--

MakefileD12-May-20242 KiB8042

README.mdD12-May-20241.4 KiB3020

build_win32.batD12-May-2024555 98

example_sdl_opengl2.vcxprojD12-May-20249.7 KiB181181

example_sdl_opengl2.vcxproj.filtersD12-May-20242 KiB6261

main.cppD12-May-20247.6 KiB15888

README.md

1
2# How to Build
3
4- On Windows with Visual Studio's IDE
5
6Use the provided project file (.vcxproj). Add to solution (imgui_examples.sln) if necessary.
7
8- On Windows with Visual Studio's CLI
9
10```
11set SDL2_DIR=path_to_your_sdl2_folder
12cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl_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:
15cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl_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```
21c++ `sdl2-config --cflags` -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_sdl.cpp ../../backends/imgui_impl_opengl2.cpp ../../imgui*.cpp `sdl2-config --libs` -lGL
22```
23
24- On Mac OS X
25
26```
27brew install sdl2
28c++ `sdl2-config --cflags` -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_sdl.cpp ../../backends/imgui_impl_opengl2.cpp ../../imgui*.cpp `sdl2-config --libs` -framework OpenGl
29```
30