mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-26 21:47:00 +00:00
Examples: Renamed applications to emphasis on use of GLFW as a platform framework + minor local tweaks
This commit is contained in:
parent
70d500502a
commit
74b7dce394
@ -22,7 +22,7 @@ int main(int, char**)
|
|||||||
glfwSetErrorCallback(glfw_error_callback);
|
glfwSetErrorCallback(glfw_error_callback);
|
||||||
if (!glfwInit())
|
if (!glfwInit())
|
||||||
return 1;
|
return 1;
|
||||||
GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui OpenGL2 example", NULL, NULL);
|
GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui GLFW+OpenGL2 example", NULL, NULL);
|
||||||
glfwMakeContextCurrent(window);
|
glfwMakeContextCurrent(window);
|
||||||
glfwSwapInterval(1); // Enable vsync
|
glfwSwapInterval(1); // Enable vsync
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ int main(int, char**)
|
|||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||||
#endif
|
#endif
|
||||||
GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui OpenGL3 example", NULL, NULL);
|
GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui GLFW+OpenGL3 example", NULL, NULL);
|
||||||
glfwMakeContextCurrent(window);
|
glfwMakeContextCurrent(window);
|
||||||
glfwSwapInterval(1); // Enable vsync
|
glfwSwapInterval(1); // Enable vsync
|
||||||
gl3wInit();
|
gl3wInit();
|
||||||
|
@ -30,7 +30,7 @@ int main(int, char**)
|
|||||||
SDL_DisplayMode current;
|
SDL_DisplayMode current;
|
||||||
SDL_GetCurrentDisplayMode(0, ¤t);
|
SDL_GetCurrentDisplayMode(0, ¤t);
|
||||||
SDL_Window* window = SDL_CreateWindow("ImGui SDL2+OpenGL example", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, SDL_WINDOW_OPENGL|SDL_WINDOW_RESIZABLE);
|
SDL_Window* window = SDL_CreateWindow("ImGui SDL2+OpenGL example", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, SDL_WINDOW_OPENGL|SDL_WINDOW_RESIZABLE);
|
||||||
SDL_GLContext glcontext = SDL_GL_CreateContext(window);
|
SDL_GLContext gl_context = SDL_GL_CreateContext(window);
|
||||||
SDL_GL_SetSwapInterval(1); // Enable vsync
|
SDL_GL_SetSwapInterval(1); // Enable vsync
|
||||||
|
|
||||||
// Setup ImGui binding
|
// Setup ImGui binding
|
||||||
@ -130,7 +130,7 @@ int main(int, char**)
|
|||||||
ImGui_ImplSdlGL2_Shutdown();
|
ImGui_ImplSdlGL2_Shutdown();
|
||||||
ImGui::DestroyContext();
|
ImGui::DestroyContext();
|
||||||
|
|
||||||
SDL_GL_DeleteContext(glcontext);
|
SDL_GL_DeleteContext(gl_context);
|
||||||
SDL_DestroyWindow(window);
|
SDL_DestroyWindow(window);
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ int main(int, char**)
|
|||||||
SDL_DisplayMode current;
|
SDL_DisplayMode current;
|
||||||
SDL_GetCurrentDisplayMode(0, ¤t);
|
SDL_GetCurrentDisplayMode(0, ¤t);
|
||||||
SDL_Window* window = SDL_CreateWindow("ImGui SDL2+OpenGL3 example", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, SDL_WINDOW_OPENGL|SDL_WINDOW_RESIZABLE);
|
SDL_Window* window = SDL_CreateWindow("ImGui SDL2+OpenGL3 example", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, SDL_WINDOW_OPENGL|SDL_WINDOW_RESIZABLE);
|
||||||
SDL_GLContext glcontext = SDL_GL_CreateContext(window);
|
SDL_GLContext gl_context = SDL_GL_CreateContext(window);
|
||||||
SDL_GL_SetSwapInterval(1); // Enable vsync
|
SDL_GL_SetSwapInterval(1); // Enable vsync
|
||||||
gl3wInit();
|
gl3wInit();
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ int main(int, char**)
|
|||||||
ImGui_ImplSdlGL3_Shutdown();
|
ImGui_ImplSdlGL3_Shutdown();
|
||||||
ImGui::DestroyContext();
|
ImGui::DestroyContext();
|
||||||
|
|
||||||
SDL_GL_DeleteContext(glcontext);
|
SDL_GL_DeleteContext(gl_context);
|
||||||
SDL_DestroyWindow(window);
|
SDL_DestroyWindow(window);
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
|
|
||||||
|
@ -614,7 +614,7 @@ int main(int, char**)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
|
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
|
||||||
GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui Vulkan example", NULL, NULL);
|
GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui GLFW+Vulkan example", NULL, NULL);
|
||||||
|
|
||||||
// Setup Vulkan
|
// Setup Vulkan
|
||||||
if (!glfwVulkanSupported())
|
if (!glfwVulkanSupported())
|
||||||
|
Loading…
Reference in New Issue
Block a user