Examples: SDL+OpenGL3: Using glew like existing example + renaming (#356)
parent
624adb1b23
commit
9d0caa2e66
@ -1,8 +1,22 @@
|
|||||||
|
|
||||||
# How to Build
|
# How to Build
|
||||||
|
|
||||||
Link
|
- On Windows with Visual Studio's CLI
|
||||||
===
|
|
||||||
OpenGL
|
```
|
||||||
SDL2
|
set SDL2DIR=path_to_your_sdl2_folder
|
||||||
GLEW
|
cl /Zi /MD /I ..\.. /I ..\libs\gl3w /I %SDL2DIR%\include main.cpp imgui_impl_sdl_gl3.cpp ..\..\imgui*.cpp ..\libs\gl3w\GL\gl3w.c /link /libpath:%SDL2DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console
|
||||||
|
```
|
||||||
|
|
||||||
|
- On Linux and similar Unixes
|
||||||
|
|
||||||
|
```
|
||||||
|
c++ `sdl2-config --cflags` -I ../.. -I ../libs/gl3w main.cpp imgui_impl_sdl.cpp ../../imgui*.cpp ../libs/gl3w/GL/gl3w.c `sdl2-config --libs` -lGL -o sdl2example
|
||||||
|
```
|
||||||
|
|
||||||
|
- On Mac OS X
|
||||||
|
|
||||||
|
```
|
||||||
|
brew install sdl2
|
||||||
|
c++ `sdl2-config --cflags` -I ../.. -I ../libs/gl3w main.cpp imgui_impl_sdl.cpp ../../imgui*.cpp ../libs/gl3w/GL/gl3w.c `sdl2-config --libs` -framework OpenGl -o sdl2example
|
||||||
|
```
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
// ImGui SDL2 binding with OpenGL3
|
||||||
|
// https://github.com/ocornut/imgui
|
||||||
|
|
||||||
|
struct SDL_Window;
|
||||||
|
typedef union SDL_Event SDL_Event;
|
||||||
|
|
||||||
|
IMGUI_API bool ImGui_ImplSdlGL3_Init(SDL_Window *window);
|
||||||
|
IMGUI_API void ImGui_ImplSdlGL3_Shutdown();
|
||||||
|
IMGUI_API void ImGui_ImplSdlGL3_NewFrame(SDL_Window *window);
|
||||||
|
IMGUI_API bool ImGui_ImplSdlGL3_ProcessEvent(SDL_Event* event);
|
||||||
|
|
||||||
|
// Use if you want to reset your rendering device without losing ImGui state.
|
||||||
|
IMGUI_API void ImGui_ImplSdlGL3_InvalidateDeviceObjects();
|
||||||
|
IMGUI_API bool ImGui_ImplSdlGL3_CreateDeviceObjects();
|
@ -1,14 +0,0 @@
|
|||||||
// ImGui SDL2 binding with OpenGL3
|
|
||||||
// https://github.com/ocornut/imgui
|
|
||||||
|
|
||||||
struct SDL_Window;
|
|
||||||
typedef union SDL_Event SDL_Event;
|
|
||||||
|
|
||||||
IMGUI_API bool ImGui_ImplSdlOgl3_Init(SDL_Window *window);
|
|
||||||
IMGUI_API void ImGui_ImplSdlOgl3_Shutdown();
|
|
||||||
IMGUI_API void ImGui_ImplSdlOgl3_NewFrame(SDL_Window *window);
|
|
||||||
IMGUI_API bool ImGui_ImplSdlOgl3_ProcessEvent(SDL_Event* event);
|
|
||||||
|
|
||||||
// Use if you want to reset your rendering device without losing ImGui state.
|
|
||||||
IMGUI_API void ImGui_ImplSdlOgl3_InvalidateDeviceObjects();
|
|
||||||
IMGUI_API bool ImGui_ImplSdlOgl3_CreateDeviceObjects();
|
|
Loading…
Reference in New Issue