Skip to content

Commit

Permalink
Obsoleted the io.RenderDrawListsFn callback, you can call your graphi…
Browse files Browse the repository at this point in the history
…cs engine render function after ImGui::Render(). Use ImGui::GetDrawData() to retrieve the ImDrawData* to display..(#1599)

Examples: Updated examples.
  • Loading branch information
ocornut committed Feb 16, 2018
1 parent 0cefd40 commit 63332d1
Show file tree
Hide file tree
Showing 30 changed files with 88 additions and 47 deletions.
11 changes: 9 additions & 2 deletions examples/allegro5_example/imgui_impl_a5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
// https://github.com/ocornut/imgui, Original code by @birthggd

// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplA5_RenderDrawData() in the .h file so you can call it yourself.
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.

#include <stdint.h> // uint64_t
#include <cstring> // memcpy
#include "imgui.h"
Expand All @@ -35,7 +41,9 @@ struct ImDrawVertAllegro
ALLEGRO_COLOR col;
};

void ImGui_ImplA5_RenderDrawLists(ImDrawData* draw_data)
// Render function.
// (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop)
void ImGui_ImplA5_RenderDrawData(ImDrawData* draw_data)
{
int op, src, dst;
al_get_blender(&op, &src, &dst);
Expand Down Expand Up @@ -190,7 +198,6 @@ bool ImGui_ImplA5_Init(ALLEGRO_DISPLAY* display)
io.KeyMap[ImGuiKey_Y] = ALLEGRO_KEY_Y;
io.KeyMap[ImGuiKey_Z] = ALLEGRO_KEY_Z;

io.RenderDrawListsFn = ImGui_ImplA5_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
#ifdef _WIN32
io.ImeWindowHandle = al_get_win_window_handle(g_Display);
#endif
Expand Down
1 change: 1 addition & 0 deletions examples/allegro5_example/imgui_impl_a5.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ union ALLEGRO_EVENT;
IMGUI_API bool ImGui_ImplA5_Init(ALLEGRO_DISPLAY* display);
IMGUI_API void ImGui_ImplA5_Shutdown();
IMGUI_API void ImGui_ImplA5_NewFrame();
IMGUI_API void ImGui_ImplA5_RenderDrawData(ImDrawData* draw_data);
IMGUI_API bool ImGui_ImplA5_ProcessEvent(ALLEGRO_EVENT* event);

// Use if you want to reset your rendering device without losing ImGui state.
Expand Down
1 change: 1 addition & 0 deletions examples/allegro5_example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ int main(int, char**)
// Rendering
al_clear_to_color(al_map_rgba_f(clear_color.x, clear_color.y, clear_color.z, clear_color.w));
ImGui::Render();
ImGui_ImplA5_RenderDrawData(ImGui::GetDrawData());
al_flip_display();
}

Expand Down
9 changes: 4 additions & 5 deletions examples/directx10_example/imgui_impl_dx10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplDX10_RenderDrawData() in the .h file so you can call it yourself.
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.
// 2018-02-06: Inputs: Honoring the io.WantMoveMouse by repositioning the mouse by using navigation and ImGuiNavFlags_MoveMouse is set.
Expand Down Expand Up @@ -57,10 +58,9 @@ struct VERTEX_CONSTANT_BUFFER
float mvp[4][4];
};

// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
// If text or lines are blurry when integrating ImGui in your engine:
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
void ImGui_ImplDX10_RenderDrawLists(ImDrawData* draw_data)
// Render function
// (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop)
void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data)
{
ID3D10Device* ctx = g_pd3dDevice;

Expand Down Expand Up @@ -570,7 +570,6 @@ bool ImGui_ImplDX10_Init(void* hwnd, ID3D10Device* device)
io.KeyMap[ImGuiKey_Y] = 'Y';
io.KeyMap[ImGuiKey_Z] = 'Z';

io.RenderDrawListsFn = ImGui_ImplDX10_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
io.ImeWindowHandle = g_hWnd;

return true;
Expand Down
1 change: 1 addition & 0 deletions examples/directx10_example/imgui_impl_dx10.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct ID3D10Device;
IMGUI_API bool ImGui_ImplDX10_Init(void* hwnd, ID3D10Device* device);
IMGUI_API void ImGui_ImplDX10_Shutdown();
IMGUI_API void ImGui_ImplDX10_NewFrame();
IMGUI_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data);

// Use if you want to reset your rendering device without losing ImGui state.
IMGUI_API void ImGui_ImplDX10_InvalidateDeviceObjects();
Expand Down
1 change: 1 addition & 0 deletions examples/directx10_example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ int main(int, char**)
g_pd3dDevice->OMSetRenderTargets(1, &g_mainRenderTargetView, NULL);
g_pd3dDevice->ClearRenderTargetView(g_mainRenderTargetView, (float*)&clear_color);
ImGui::Render();
ImGui_ImplDX10_RenderDrawData(ImGui::GetDrawData());

g_pSwapChain->Present(1, 0); // Present with vsync
//g_pSwapChain->Present(0, 0); // Present without vsync
Expand Down
9 changes: 4 additions & 5 deletions examples/directx11_example/imgui_impl_dx11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplDX11_RenderDrawData() in the .h file so you can call it yourself.
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.
// 2018-02-06: Inputs: Honoring the io.WantMoveMouse by repositioning the mouse by using navigation and ImGuiNavFlags_MoveMouse is set.
Expand Down Expand Up @@ -57,10 +58,9 @@ struct VERTEX_CONSTANT_BUFFER
float mvp[4][4];
};

// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
// If text or lines are blurry when integrating ImGui in your engine:
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
void ImGui_ImplDX11_RenderDrawLists(ImDrawData* draw_data)
// Render function
// (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop)
void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data)
{
ID3D11DeviceContext* ctx = g_pd3dDeviceContext;

Expand Down Expand Up @@ -572,7 +572,6 @@ bool ImGui_ImplDX11_Init(void* hwnd, ID3D11Device* device, ID3D11DeviceContex
io.KeyMap[ImGuiKey_Y] = 'Y';
io.KeyMap[ImGuiKey_Z] = 'Z';

io.RenderDrawListsFn = ImGui_ImplDX11_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
io.ImeWindowHandle = g_hWnd;

return true;
Expand Down
1 change: 1 addition & 0 deletions examples/directx11_example/imgui_impl_dx11.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct ID3D11DeviceContext;
IMGUI_API bool ImGui_ImplDX11_Init(void* hwnd, ID3D11Device* device, ID3D11DeviceContext* device_context);
IMGUI_API void ImGui_ImplDX11_Shutdown();
IMGUI_API void ImGui_ImplDX11_NewFrame();
IMGUI_API void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data);

// Use if you want to reset your rendering device without losing ImGui state.
IMGUI_API void ImGui_ImplDX11_InvalidateDeviceObjects();
Expand Down
1 change: 1 addition & 0 deletions examples/directx11_example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ int main(int, char**)
g_pd3dDeviceContext->OMSetRenderTargets(1, &g_mainRenderTargetView, NULL);
g_pd3dDeviceContext->ClearRenderTargetView(g_mainRenderTargetView, (float*)&clear_color);
ImGui::Render();
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());

g_pSwapChain->Present(1, 0); // Present with vsync
//g_pSwapChain->Present(0, 0); // Present without vsync
Expand Down
14 changes: 9 additions & 5 deletions examples/directx9_example/imgui_impl_dx9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
// https://github.com/ocornut/imgui

// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplDX9_RenderDrawData() in the .h file so you can call it yourself.
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.

#include "imgui.h"
#include "imgui_impl_dx9.h"

Expand All @@ -34,10 +40,9 @@ struct CUSTOMVERTEX
};
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1)

// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
// If text or lines are blurry when integrating ImGui in your engine:
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
void ImGui_ImplDX9_RenderDrawLists(ImDrawData* draw_data)
// Render function.
// (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop)
void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data)
{
// Avoid rendering when minimized
ImGuiIO& io = ImGui::GetIO();
Expand Down Expand Up @@ -276,7 +281,6 @@ bool ImGui_ImplDX9_Init(void* hwnd, IDirect3DDevice9* device)
io.KeyMap[ImGuiKey_Y] = 'Y';
io.KeyMap[ImGuiKey_Z] = 'Z';

io.RenderDrawListsFn = ImGui_ImplDX9_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
io.ImeWindowHandle = g_hWnd;

return true;
Expand Down
1 change: 1 addition & 0 deletions examples/directx9_example/imgui_impl_dx9.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct IDirect3DDevice9;
IMGUI_API bool ImGui_ImplDX9_Init(void* hwnd, IDirect3DDevice9* device);
IMGUI_API void ImGui_ImplDX9_Shutdown();
IMGUI_API void ImGui_ImplDX9_NewFrame();
IMGUI_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data);

// Use if you want to reset your rendering device without losing ImGui state.
IMGUI_API void ImGui_ImplDX9_InvalidateDeviceObjects();
Expand Down
1 change: 1 addition & 0 deletions examples/directx9_example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ int main(int, char**)
if (g_pd3dDevice->BeginScene() >= 0)
{
ImGui::Render();
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
g_pd3dDevice->EndScene();
}
HRESULT result = g_pd3dDevice->Present(NULL, NULL, NULL, NULL);
Expand Down
12 changes: 9 additions & 3 deletions examples/marmalade_example/imgui_impl_marmalade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
// Copyright (C) 2015 by Giovanni Zito
// This file is part of ImGui

// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_Marmalade_RenderDrawData() in the .h file so you can call it yourself.
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.

#include "imgui.h"
#include "imgui_impl_marmalade.h"

Expand All @@ -30,8 +36,9 @@ static bool g_osdKeyboardEnabled = false;
// use this setting to scale the interface - e.g. on device you could use 2 or 3 scale factor
static ImVec2 g_RenderScale = ImVec2(1.0f,1.0f);

// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
void ImGui_Marmalade_RenderDrawLists(ImDrawData* draw_data)
// Render function.
// (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop)
void ImGui_Marmalade_RenderDrawData(ImDrawData* draw_data)
{
// Handle cases of screen coordinates != from framebuffer coordinates (e.g. retina displays)
ImGuiIO& io = ImGui::GetIO();
Expand Down Expand Up @@ -232,7 +239,6 @@ bool ImGui_Marmalade_Init(bool install_callbacks)
io.KeyMap[ImGuiKey_Y] = s3eKeyY;
io.KeyMap[ImGuiKey_Z] = s3eKeyZ;

io.RenderDrawListsFn = ImGui_Marmalade_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
io.SetClipboardTextFn = ImGui_Marmalade_SetClipboardText;
io.GetClipboardTextFn = ImGui_Marmalade_GetClipboardText;

Expand Down
1 change: 1 addition & 0 deletions examples/marmalade_example/imgui_impl_marmalade.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
IMGUI_API bool ImGui_Marmalade_Init(bool install_callbacks);
IMGUI_API void ImGui_Marmalade_Shutdown();
IMGUI_API void ImGui_Marmalade_NewFrame();
IMGUI_API void ImGui_Marmalade_RenderDrawData(ImDrawData* draw_data);

// Use if you want to reset your rendering device without losing ImGui state.
IMGUI_API void ImGui_Marmalade_InvalidateDeviceObjects();
Expand Down
1 change: 1 addition & 0 deletions examples/marmalade_example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ int main(int, char**)
IwGxSetColClear(clear_color.x * 255, clear_color.y * 255, clear_color.z * 255, clear_color.w * 255);
IwGxClear();
ImGui::Render();
ImGui_Marmalade_RenderDrawData(ImGui::GetDrawData());
IwGxSwapBuffers();

s3eDeviceYield(0);
Expand Down
8 changes: 4 additions & 4 deletions examples/opengl2_example/imgui_impl_glfw_gl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplGlfwGL2_RenderDrawData() in the .h file so you can call it yourself.
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.
// 2018-01-25: Inputs: Honoring the io.WantMoveMouse by repositioning the mouse by using navigation and ImGuiNavFlags_MoveMouse is set.
Expand Down Expand Up @@ -49,10 +50,10 @@ static double g_Time = 0.0f;
static bool g_MouseJustPressed[3] = { false, false, false };
static GLuint g_FontTexture = 0;

// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
void ImGui_ImplGlfwGL2_RenderDrawLists(ImDrawData* draw_data)
// OpenGL2 Render function.
// (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop)
// Note that this implementation is little overcomplicated because we are saving/setting up/restoring every OpenGL state explicitly, in order to be able to run within any OpenGL engine that doesn't do so.
// If text or lines are blurry when integrating ImGui in your engine: in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
void ImGui_ImplGlfwGL2_RenderDrawData(ImDrawData* draw_data)
{
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
ImGuiIO& io = ImGui::GetIO();
Expand Down Expand Up @@ -241,7 +242,6 @@ bool ImGui_ImplGlfwGL2_Init(GLFWwindow* window, bool install_callbacks)
io.KeyMap[ImGuiKey_Y] = GLFW_KEY_Y;
io.KeyMap[ImGuiKey_Z] = GLFW_KEY_Z;

io.RenderDrawListsFn = ImGui_ImplGlfwGL2_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
io.SetClipboardTextFn = ImGui_ImplGlfwGL2_SetClipboardText;
io.GetClipboardTextFn = ImGui_ImplGlfwGL2_GetClipboardText;
io.ClipboardUserData = g_Window;
Expand Down
1 change: 1 addition & 0 deletions examples/opengl2_example/imgui_impl_glfw_gl2.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct GLFWwindow;
IMGUI_API bool ImGui_ImplGlfwGL2_Init(GLFWwindow* window, bool install_callbacks);
IMGUI_API void ImGui_ImplGlfwGL2_Shutdown();
IMGUI_API void ImGui_ImplGlfwGL2_NewFrame();
IMGUI_API void ImGui_ImplGlfwGL2_RenderDrawData(ImDrawData* draw_data);

// Use if you want to reset your rendering device without losing ImGui state.
IMGUI_API void ImGui_ImplGlfwGL2_InvalidateDeviceObjects();
Expand Down
1 change: 1 addition & 0 deletions examples/opengl2_example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ int main(int, char**)
glClear(GL_COLOR_BUFFER_BIT);
//glUseProgram(0); // You may want this if using this code in an OpenGL 3+ context where shaders may be bound, but prefer using the GL3+ code.
ImGui::Render();
ImGui_ImplGlfwGL2_RenderDrawData(ImGui::GetDrawData());
glfwSwapBuffers(window);
}

Expand Down
8 changes: 4 additions & 4 deletions examples/opengl3_example/imgui_impl_glfw_gl3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplGlfwGL3_RenderDrawData() in the .h file so you can call it yourself.
// 2018-02-06: Misc: Removed call to ImGui::Shutdown() which is not available from 1.60 WIP, user needs to call CreateContext/DestroyContext themselves.
// 2018-02-06: Inputs: Added mapping for ImGuiKey_Space.
// 2018-01-25: Inputs: Added gamepad support if ImGuiNavFlags_EnableGamepad is set.
Expand Down Expand Up @@ -50,10 +51,10 @@ static int g_AttribLocationTex = 0, g_AttribLocationProjMtx = 0;
static int g_AttribLocationPosition = 0, g_AttribLocationUV = 0, g_AttribLocationColor = 0;
static unsigned int g_VboHandle = 0, g_VaoHandle = 0, g_ElementsHandle = 0;

// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
// OpenGL3 Render function.
// (this used to be set in io.RenderDrawListsFn and called by ImGui::Render(), but you can now call this directly from your main loop)
// Note that this implementation is little overcomplicated because we are saving/setting up/restoring every OpenGL state explicitly, in order to be able to run within any OpenGL engine that doesn't do so.
// If text or lines are blurry when integrating ImGui in your engine: in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
void ImGui_ImplGlfwGL3_RenderDrawLists(ImDrawData* draw_data)
void ImGui_ImplGlfwGL3_RenderDrawData(ImDrawData* draw_data)
{
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
ImGuiIO& io = ImGui::GetIO();
Expand Down Expand Up @@ -356,7 +357,6 @@ bool ImGui_ImplGlfwGL3_Init(GLFWwindow* window, bool install_callbacks)
io.KeyMap[ImGuiKey_Y] = GLFW_KEY_Y;
io.KeyMap[ImGuiKey_Z] = GLFW_KEY_Z;

io.RenderDrawListsFn = ImGui_ImplGlfwGL3_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
io.SetClipboardTextFn = ImGui_ImplGlfwGL3_SetClipboardText;
io.GetClipboardTextFn = ImGui_ImplGlfwGL3_GetClipboardText;
io.ClipboardUserData = g_Window;
Expand Down
1 change: 1 addition & 0 deletions examples/opengl3_example/imgui_impl_glfw_gl3.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct GLFWwindow;
IMGUI_API bool ImGui_ImplGlfwGL3_Init(GLFWwindow* window, bool install_callbacks);
IMGUI_API void ImGui_ImplGlfwGL3_Shutdown();
IMGUI_API void ImGui_ImplGlfwGL3_NewFrame();
IMGUI_API void ImGui_ImplGlfwGL3_RenderDrawData(ImDrawData* draw_data);

// Use if you want to reset your rendering device without losing ImGui state.
IMGUI_API void ImGui_ImplGlfwGL3_InvalidateDeviceObjects();
Expand Down
1 change: 1 addition & 0 deletions examples/opengl3_example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ int main(int, char**)
glClearColor(clear_color.x, clear_color.y, clear_color.z, clear_color.w);
glClear(GL_COLOR_BUFFER_BIT);
ImGui::Render();
ImGui_ImplGlfwGL3_RenderDrawData(ImGui::GetDrawData());
glfwSwapBuffers(window);
}

Expand Down
Loading

0 comments on commit 63332d1

Please sign in to comment.