mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-09 23:54:20 +00:00
CI, Backends: fixes for example_null building. Add consistent IMGUI_IMPL_API in backend.
This commit is contained in:
parent
d99baf332c
commit
0cf5b93a0a
3 changed files with 33 additions and 33 deletions
|
|
@ -17,46 +17,46 @@
|
|||
#ifndef IMGUI_DISABLE
|
||||
#include "imgui_impl_null.h"
|
||||
|
||||
bool ImGui_ImplNull_Init()
|
||||
IMGUI_IMPL_API bool ImGui_ImplNull_Init()
|
||||
{
|
||||
ImGui_ImplNullPlatform_Init();
|
||||
ImGui_ImplNullRender_Init();
|
||||
return true;
|
||||
}
|
||||
|
||||
void ImGui_ImplNull_Shutdown()
|
||||
IMGUI_IMPL_API void ImGui_ImplNull_Shutdown()
|
||||
{
|
||||
ImGui_ImplNullRender_Shutdown();
|
||||
ImGui_ImplNullPlatform_Shutdown();
|
||||
}
|
||||
|
||||
void ImGui_ImplNull_NewFrame()
|
||||
IMGUI_IMPL_API void ImGui_ImplNull_NewFrame()
|
||||
{
|
||||
ImGui_ImplNullPlatform_NewFrame();
|
||||
ImGui_ImplNullRender_NewFrame();
|
||||
}
|
||||
|
||||
bool ImGui_ImplNullPlatform_Init()
|
||||
IMGUI_IMPL_API bool ImGui_ImplNullPlatform_Init()
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ImGui_ImplNullPlatform_Shutdown()
|
||||
IMGUI_IMPL_API void ImGui_ImplNullPlatform_Shutdown()
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.BackendFlags &= ~ImGuiBackendFlags_HasMouseCursors;
|
||||
}
|
||||
|
||||
void ImGui_ImplNullPlatform_NewFrame()
|
||||
IMGUI_IMPL_API void ImGui_ImplNullPlatform_NewFrame()
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.DisplaySize = ImVec2(1920, 1080);
|
||||
io.DeltaTime = 1.0f / 60.0f;
|
||||
}
|
||||
|
||||
bool ImGui_ImplNullRender_Init()
|
||||
IMGUI_IMPL_API bool ImGui_ImplNullRender_Init()
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset;
|
||||
|
|
@ -64,14 +64,14 @@ bool ImGui_ImplNullRender_Init()
|
|||
return true;
|
||||
}
|
||||
|
||||
void ImGui_ImplNullRender_Shutdown()
|
||||
IMGUI_IMPL_API void ImGui_ImplNullRender_Shutdown()
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.BackendFlags &= ~ImGuiBackendFlags_RendererHasVtxOffset;
|
||||
io.BackendFlags &= ~ImGuiBackendFlags_RendererHasTextures;
|
||||
}
|
||||
|
||||
void ImGui_ImplNullRender_NewFrame()
|
||||
IMGUI_IMPL_API void ImGui_ImplNullRender_NewFrame()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ void ImGui_ImplNullRender_UpdateTexture(ImTextureData* tex)
|
|||
}
|
||||
}
|
||||
|
||||
void ImGui_ImplNullRender_RenderDrawData(ImDrawData* draw_data)
|
||||
IMGUI_IMPL_API void ImGui_ImplNullRender_RenderDrawData(ImDrawData* draw_data)
|
||||
{
|
||||
if (draw_data->Textures != nullptr)
|
||||
for (ImTextureData* tex : *draw_data->Textures)
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ IMGUI_IMPL_API bool ImGui_ImplWin32_InitForOpenGL(void* hwnd)
|
|||
return ImGui_ImplWin32_InitEx(hwnd, true);
|
||||
}
|
||||
|
||||
void ImGui_ImplWin32_Shutdown()
|
||||
IMGUI_IMPL_API void ImGui_ImplWin32_Shutdown()
|
||||
{
|
||||
ImGui_ImplWin32_Data* bd = ImGui_ImplWin32_GetBackendData();
|
||||
IM_ASSERT(bd != nullptr && "No platform backend to shutdown, or already shutdown?");
|
||||
|
|
@ -392,7 +392,7 @@ static void ImGui_ImplWin32_UpdateGamepads(ImGuiIO& io)
|
|||
#endif
|
||||
}
|
||||
|
||||
void ImGui_ImplWin32_NewFrame()
|
||||
IMGUI_IMPL_API void ImGui_ImplWin32_NewFrame()
|
||||
{
|
||||
ImGui_ImplWin32_Data* bd = ImGui_ImplWin32_GetBackendData();
|
||||
IM_ASSERT(bd != nullptr && "Context or backend not initialized? Did you call ImGui_ImplWin32_Init()?");
|
||||
|
|
@ -861,7 +861,7 @@ typedef HRESULT(WINAPI* PFN_GetDpiForMonitor)(HMONITOR, MONITOR_DPI_TYPE, UINT*,
|
|||
typedef DPI_AWARENESS_CONTEXT(WINAPI* PFN_SetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT); // User32.lib + dll, Windows 10 v1607+ (Creators Update)
|
||||
|
||||
// Helper function to enable DPI awareness without setting up a manifest
|
||||
void ImGui_ImplWin32_EnableDpiAwareness()
|
||||
IMGUI_IMPL_API void ImGui_ImplWin32_EnableDpiAwareness()
|
||||
{
|
||||
if (_IsWindows10OrGreater())
|
||||
{
|
||||
|
|
@ -890,7 +890,7 @@ void ImGui_ImplWin32_EnableDpiAwareness()
|
|||
#pragma comment(lib, "gdi32") // Link with gdi32.lib for GetDeviceCaps(). MinGW will require linking with '-lgdi32'
|
||||
#endif
|
||||
|
||||
float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor)
|
||||
IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor)
|
||||
{
|
||||
UINT xdpi = 96, ydpi = 96;
|
||||
if (_IsWindows8Point1OrGreater())
|
||||
|
|
@ -916,7 +916,7 @@ float ImGui_ImplWin32_GetDpiScaleForMonitor(void* monitor)
|
|||
return xdpi / 96.0f;
|
||||
}
|
||||
|
||||
float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd)
|
||||
IMGUI_IMPL_API float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd)
|
||||
{
|
||||
HMONITOR monitor = ::MonitorFromWindow((HWND)hwnd, MONITOR_DEFAULTTONEAREST);
|
||||
return ImGui_ImplWin32_GetDpiScaleForMonitor(monitor);
|
||||
|
|
@ -933,7 +933,7 @@ float ImGui_ImplWin32_GetDpiScaleForHwnd(void* hwnd)
|
|||
// [experimental]
|
||||
// Borrowed from GLFW's function updateFramebufferTransparency() in src/win32_window.c
|
||||
// (the Dwm* functions are Vista era functions but we are borrowing logic from GLFW)
|
||||
void ImGui_ImplWin32_EnableAlphaCompositing(void* hwnd)
|
||||
IMGUI_IMPL_API void ImGui_ImplWin32_EnableAlphaCompositing(void* hwnd)
|
||||
{
|
||||
if (!_IsWindowsVistaOrGreater())
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue