-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Examples: SDL+OpenGL3: Using glew like existing example + renaming (#356
- Loading branch information
Showing
5 changed files
with
58 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,22 @@ | ||
|
||
# How to Build | ||
|
||
Link | ||
=== | ||
OpenGL | ||
SDL2 | ||
GLEW | ||
- On Windows with Visual Studio's CLI | ||
|
||
``` | ||
set SDL2DIR=path_to_your_sdl2_folder | ||
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters