|
|
@ -28,8 +28,8 @@ int main(int, char**)
|
|
|
|
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
|
|
|
|
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
|
|
|
|
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();
|
|
|
|
|
|
|
|
|
|
|
|