File tree Expand file tree Collapse file tree
examples/example_sdl3_opengl3 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # Example SDL3 with OpenGL3
1+ # How to Build
2+
3+ ## Windows with Visual Studio's IDE
4+
5+ Use the provided project file (.vcxproj). Add to solution (imgui_examples.sln) if necessary.
6+
7+ ## Windows with Visual Studio's CLI
8+
9+ Use build_win32.bat or directly:
10+ ```
11+ set SDL2_DIR=path_to_your_sdl3_folder
12+ cl /Zi /MD /utf-8 /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp /FeDebug/example_sdl3_opengl3.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x86 SDL3.lib opengl32.lib /subsystem:console
13+ # ^^ include paths ^^ source files ^^ output exe ^^ output dir ^^ libraries
14+ # or for 64-bit:
15+ cl /Zi /MD /utf-8 /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp /FeDebug/example_sdl3_opengl3.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x64 SDL3.lib SDL2mainopengl32.lib /subsystem:console
16+ ```
17+
18+ ## Linux and similar Unixes
19+
20+ Use our Makefile or directly:
21+ ```
22+ c++ `sdl3-config --cflags` -I .. -I ../.. -I ../../backends
23+ main.cpp ../../backends/imgui_impl_sdl3.cpp ../../backends/imgui_impl_opengl3.cpp ../../imgui*.cpp
24+ `sdl3-config --libs` -lGL -ldl
25+ ```
26+
27+ ## macOS
28+
29+ Use our Makefile or directly:
30+ ```
31+ brew install sdl3
32+ c++ `sdl3-config --cflags` -I .. -I ../.. -I ../../backends
33+ main.cpp ../../backends/imgui_impl_sdl3.cpp ../../backends/imgui_impl_opengl3.cpp ../../imgui*.cpp
34+ `sdl3-config --libs` -framework OpenGl -framework CoreFoundation
35+ ```
36+
37+ ## Emscripten
38+
39+ As of 2023-05-30 Emscripten doesn't support SDL3 yet.
240
341## Android
442
Original file line number Diff line number Diff line change 1111#include " imgui_impl_sdl3.h"
1212#include " imgui_impl_opengl3.h"
1313#include < stdio.h>
14- <<<<<<< HEAD
15- #include < SDL3/SDL.h>
16- =======
1714
1815#include < SDL3/SDL.h>
1916#include < SDL3/SDL_main.h>
2017
21- >>>>>>> e54b3b42 (Update CMakeLists.txt to download properly)
2218#if defined(IMGUI_IMPL_OPENGL_ES2)
2319#include < SDL3/SDL_opengles2.h>
2420#else
You can’t perform that action at this time.
0 commit comments