Examples: imgui_impl* functions declared with IMGUI_API to ease copy & pasting into projects using DLL

This commit is contained in:
ocornut 2015-08-24 14:02:51 +02:00
parent b1987d697f
commit 9a0650dbd0
8 changed files with 44 additions and 45 deletions

View File

@ -7,12 +7,11 @@
struct ALLEGRO_DISPLAY; struct ALLEGRO_DISPLAY;
union ALLEGRO_EVENT; union ALLEGRO_EVENT;
bool ImGui_ImplA5_Init(ALLEGRO_DISPLAY* display); IMGUI_API bool ImGui_ImplA5_Init(ALLEGRO_DISPLAY* display);
void ImGui_ImplA5_Shutdown(); IMGUI_API void ImGui_ImplA5_Shutdown();
void ImGui_ImplA5_NewFrame(); IMGUI_API void ImGui_ImplA5_NewFrame();
IMGUI_API bool ImGui_ImplA5_ProcessEvent(ALLEGRO_EVENT* event);
bool ImGui_ImplA5_ProcessEvent(ALLEGRO_EVENT* event);
// Use if you want to reset your rendering device without losing ImGui state. // Use if you want to reset your rendering device without losing ImGui state.
bool Imgui_ImplA5_CreateDeviceObjects(); IMGUI_API bool Imgui_ImplA5_CreateDeviceObjects();
void ImGui_ImplA5_InvalidateDeviceObjects(); IMGUI_API void ImGui_ImplA5_InvalidateDeviceObjects();

View File

@ -172,7 +172,7 @@ static void ImGui_ImplDX11_RenderDrawLists(ImDrawData* draw_data)
g_pd3dDeviceContext->VSSetShader(NULL, NULL, 0); g_pd3dDeviceContext->VSSetShader(NULL, NULL, 0);
} }
LRESULT ImGui_ImplDX11_WndProcHandler(HWND, UINT msg, WPARAM wParam, LPARAM lParam) IMGUI_API LRESULT ImGui_ImplDX11_WndProcHandler(HWND, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
ImGuiIO& io = ImGui::GetIO(); ImGuiIO& io = ImGui::GetIO();
switch (msg) switch (msg)

View File

@ -4,17 +4,17 @@
struct ID3D11Device; struct ID3D11Device;
struct ID3D11DeviceContext; struct ID3D11DeviceContext;
bool ImGui_ImplDX11_Init(void* hwnd, ID3D11Device* device, ID3D11DeviceContext* device_context); IMGUI_API bool ImGui_ImplDX11_Init(void* hwnd, ID3D11Device* device, ID3D11DeviceContext* device_context);
void ImGui_ImplDX11_Shutdown(); IMGUI_API void ImGui_ImplDX11_Shutdown();
void ImGui_ImplDX11_NewFrame(); IMGUI_API void ImGui_ImplDX11_NewFrame();
// Use if you want to reset your rendering device without losing ImGui state. // Use if you want to reset your rendering device without losing ImGui state.
void ImGui_ImplDX11_InvalidateDeviceObjects(); IMGUI_API void ImGui_ImplDX11_InvalidateDeviceObjects();
bool ImGui_ImplDX11_CreateDeviceObjects(); IMGUI_API bool ImGui_ImplDX11_CreateDeviceObjects();
// Handler for Win32 messages, update mouse/keyboard data. // Handler for Win32 messages, update mouse/keyboard data.
// You may or not need this for your implementation, but it can serve as reference for handling inputs. // You may or not need this for your implementation, but it can serve as reference for handling inputs.
// Commented out to avoid dragging dependencies on <windows.h> types. You can copy the extern declaration in your code. // Commented out to avoid dragging dependencies on <windows.h> types. You can copy the extern declaration in your code.
/* /*
extern LRESULT ImGui_ImplDX11_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); IMGUI_API LRESULT ImGui_ImplDX11_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
*/ */

View File

@ -133,7 +133,7 @@ static void ImGui_ImplDX9_RenderDrawLists(ImDrawData* draw_data)
} }
} }
LRESULT ImGui_ImplDX9_WndProcHandler(HWND, UINT msg, WPARAM wParam, LPARAM lParam) IMGUI_API LRESULT ImGui_ImplDX9_WndProcHandler(HWND, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
ImGuiIO& io = ImGui::GetIO(); ImGuiIO& io = ImGui::GetIO();
switch (msg) switch (msg)

View File

@ -3,17 +3,17 @@
struct IDirect3DDevice9; struct IDirect3DDevice9;
bool ImGui_ImplDX9_Init(void* hwnd, IDirect3DDevice9* device); IMGUI_API bool ImGui_ImplDX9_Init(void* hwnd, IDirect3DDevice9* device);
void ImGui_ImplDX9_Shutdown(); IMGUI_API void ImGui_ImplDX9_Shutdown();
void ImGui_ImplDX9_NewFrame(); IMGUI_API void ImGui_ImplDX9_NewFrame();
// Use if you want to reset your rendering device without losing ImGui state. // Use if you want to reset your rendering device without losing ImGui state.
void ImGui_ImplDX9_InvalidateDeviceObjects(); IMGUI_API void ImGui_ImplDX9_InvalidateDeviceObjects();
bool ImGui_ImplDX9_CreateDeviceObjects(); IMGUI_API bool ImGui_ImplDX9_CreateDeviceObjects();
// Handler for Win32 messages, update mouse/keyboard data. // Handler for Win32 messages, update mouse/keyboard data.
// You may or not need this for your implementation, but it can serve as reference for handling inputs. // You may or not need this for your implementation, but it can serve as reference for handling inputs.
// Commented out to avoid dragging dependencies on <windows.h> types. You can copy the extern declaration in your code. // Commented out to avoid dragging dependencies on <windows.h> types. You can copy the extern declaration in your code.
/* /*
extern LRESULT ImGui_ImplDX9_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); IMGUI_API LRESULT ImGui_ImplDX9_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
*/ */

View File

@ -3,18 +3,18 @@
struct GLFWwindow; struct GLFWwindow;
bool ImGui_ImplGlfwGL3_Init(GLFWwindow* window, bool install_callbacks); IMGUI_API bool ImGui_ImplGlfwGL3_Init(GLFWwindow* window, bool install_callbacks);
void ImGui_ImplGlfwGL3_Shutdown(); IMGUI_API void ImGui_ImplGlfwGL3_Shutdown();
void ImGui_ImplGlfwGL3_NewFrame(); IMGUI_API void ImGui_ImplGlfwGL3_NewFrame();
// Use if you want to reset your rendering device without losing ImGui state. // Use if you want to reset your rendering device without losing ImGui state.
void ImGui_ImplGlfwGL3_InvalidateDeviceObjects(); IMGUI_API void ImGui_ImplGlfwGL3_InvalidateDeviceObjects();
bool ImGui_ImplGlfwGL3_CreateDeviceObjects(); IMGUI_API bool ImGui_ImplGlfwGL3_CreateDeviceObjects();
// GLFW callbacks (installed by default if you enable 'install_callbacks' during initialization) // GLFW callbacks (installed by default if you enable 'install_callbacks' during initialization)
// Provided here if you want to chain callbacks. // Provided here if you want to chain callbacks.
// You can also handle inputs yourself and use those as a reference. // You can also handle inputs yourself and use those as a reference.
void ImGui_ImplGlfwGL3_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods); IMGUI_API void ImGui_ImplGlfwGL3_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods);
void ImGui_ImplGlfwGL3_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset); IMGUI_API void ImGui_ImplGlfwGL3_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset);
void ImGui_ImplGlfwGL3_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods); IMGUI_API void ImGui_ImplGlfwGL3_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
void ImGui_ImplGlfwGL3_CharCallback(GLFWwindow* window, unsigned int c); IMGUI_API void ImGui_ImplGlfwGL3_CharCallback(GLFWwindow* window, unsigned int c);

View File

@ -3,18 +3,18 @@
struct GLFWwindow; struct GLFWwindow;
bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks); IMGUI_API bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks);
void ImGui_ImplGlfw_Shutdown(); IMGUI_API void ImGui_ImplGlfw_Shutdown();
void ImGui_ImplGlfw_NewFrame(); IMGUI_API void ImGui_ImplGlfw_NewFrame();
// Use if you want to reset your rendering device without losing ImGui state. // Use if you want to reset your rendering device without losing ImGui state.
void ImGui_ImplGlfw_InvalidateDeviceObjects(); IMGUI_API void ImGui_ImplGlfw_InvalidateDeviceObjects();
bool ImGui_ImplGlfw_CreateDeviceObjects(); IMGUI_API bool ImGui_ImplGlfw_CreateDeviceObjects();
// GLFW callbacks (installed by default if you enable 'install_callbacks' during initialization) // GLFW callbacks (installed by default if you enable 'install_callbacks' during initialization)
// Provided here if you want to chain callbacks. // Provided here if you want to chain callbacks.
// You can also handle inputs yourself and use those as a reference. // You can also handle inputs yourself and use those as a reference.
void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods); IMGUI_API void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods);
void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset); IMGUI_API void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset);
void ImGui_ImplGlFw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods); IMGUI_API void ImGui_ImplGlFw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c); IMGUI_API void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c);

View File

@ -4,11 +4,11 @@
struct SDL_Window; struct SDL_Window;
typedef union SDL_Event SDL_Event; typedef union SDL_Event SDL_Event;
bool ImGui_ImplSdl_Init(SDL_Window *window); IMGUI_API bool ImGui_ImplSdl_Init(SDL_Window *window);
void ImGui_ImplSdl_Shutdown(); IMGUI_API void ImGui_ImplSdl_Shutdown();
void ImGui_ImplSdl_NewFrame(SDL_Window *window); IMGUI_API void ImGui_ImplSdl_NewFrame(SDL_Window *window);
bool ImGui_ImplSdl_ProcessEvent(SDL_Event* event); IMGUI_API bool ImGui_ImplSdl_ProcessEvent(SDL_Event* event);
// Use if you want to reset your rendering device without losing ImGui state. // Use if you want to reset your rendering device without losing ImGui state.
void ImGui_ImplSdl_InvalidateDeviceObjects(); IMGUI_API void ImGui_ImplSdl_InvalidateDeviceObjects();
bool ImGui_ImplSdl_CreateDeviceObjects(); IMGUI_API bool ImGui_ImplSdl_CreateDeviceObjects();