@ -13,6 +13,7 @@
// CHANGELOG
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// (minor and older changes stripped away, please see git history for details)
// 2019-09-16: OpenGL: Tweak initialization code to allow application calling ImGui_ImplOpenGL3_CreateFontsTexture() before the first NewFrame() call.
// 2019-05-29: OpenGL: Desktop GL only: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag.
// 2019-05-29: OpenGL: Desktop GL only: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag.
// 2019-04-30: OpenGL: Added support for special ImDrawCallback_ResetRenderState callback to reset render state.
// 2019-04-30: OpenGL: Added support for special ImDrawCallback_ResetRenderState callback to reset render state.
// 2019-03-29: OpenGL: Not calling glBindBuffer more than necessary in the render loop.
// 2019-03-29: OpenGL: Not calling glBindBuffer more than necessary in the render loop.
@ -164,7 +165,7 @@ void ImGui_ImplOpenGL3_Shutdown()
void ImGui_ImplOpenGL3_NewFrame ( )
void ImGui_ImplOpenGL3_NewFrame ( )
{
{
if ( ! g_ FontTextur e)
if ( ! g_ ShaderHandl e)
ImGui_ImplOpenGL3_CreateDeviceObjects ( ) ;
ImGui_ImplOpenGL3_CreateDeviceObjects ( ) ;
}
}
@ -613,20 +614,13 @@ bool ImGui_ImplOpenGL3_CreateDeviceObjects()
void ImGui_ImplOpenGL3_DestroyDeviceObjects ( )
void ImGui_ImplOpenGL3_DestroyDeviceObjects ( )
{
{
if ( g_VboHandle ) glDeleteBuffers ( 1 , & g_VboHandle ) ;
if ( g_VboHandle ) { glDeleteBuffers ( 1 , & g_VboHandle ) ; g_VboHandle = 0 ; }
if ( g_ElementsHandle ) glDeleteBuffers ( 1 , & g_ElementsHandle ) ;
if ( g_ElementsHandle ) { glDeleteBuffers ( 1 , & g_ElementsHandle ) ; g_ElementsHandle = 0 ; }
g_VboHandle = g_ElementsHandle = 0 ;
if ( g_ShaderHandle & & g_VertHandle ) { glDetachShader ( g_ShaderHandle , g_VertHandle ) ; }
if ( g_ShaderHandle & & g_FragHandle ) { glDetachShader ( g_ShaderHandle , g_FragHandle ) ; }
if ( g_ShaderHandle & & g_VertHandle ) glDetachShader ( g_ShaderHandle , g_VertHandle ) ;
if ( g_VertHandle ) { glDeleteShader ( g_VertHandle ) ; g_VertHandle = 0 ; }
if ( g_VertHandle ) glDeleteShader ( g_VertHandle ) ;
if ( g_FragHandle ) { glDeleteShader ( g_FragHandle ) ; g_FragHandle = 0 ; }
g_VertHandle = 0 ;
if ( g_ShaderHandle ) { glDeleteProgram ( g_ShaderHandle ) ; g_ShaderHandle = 0 ; }
if ( g_ShaderHandle & & g_FragHandle ) glDetachShader ( g_ShaderHandle , g_FragHandle ) ;
if ( g_FragHandle ) glDeleteShader ( g_FragHandle ) ;
g_FragHandle = 0 ;
if ( g_ShaderHandle ) glDeleteProgram ( g_ShaderHandle ) ;
g_ShaderHandle = 0 ;
ImGui_ImplOpenGL3_DestroyFontsTexture ( ) ;
ImGui_ImplOpenGL3_DestroyFontsTexture ( ) ;
}
}