mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Minor Windows adjustments
This commit is contained in:
parent
23e7bdebcf
commit
3604aecf8f
@ -7,7 +7,7 @@
|
|||||||
// GL3W/GLFW
|
// GL3W/GLFW
|
||||||
#include <GL/gl3w.h>
|
#include <GL/gl3w.h>
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
#ifdef _MSC_VER
|
#ifdef _WIN32
|
||||||
#undef APIENTRY
|
#undef APIENTRY
|
||||||
#define GLFW_EXPOSE_NATIVE_WIN32
|
#define GLFW_EXPOSE_NATIVE_WIN32
|
||||||
#define GLFW_EXPOSE_NATIVE_WGL
|
#define GLFW_EXPOSE_NATIVE_WGL
|
||||||
@ -253,7 +253,7 @@ bool ImGui_ImplGlfwGL3_Init(GLFWwindow* window, bool install_callbacks)
|
|||||||
io.RenderDrawListsFn = ImGui_ImplGlfwGL3_RenderDrawLists;
|
io.RenderDrawListsFn = ImGui_ImplGlfwGL3_RenderDrawLists;
|
||||||
io.SetClipboardTextFn = ImGui_ImplGlfwGL3_SetClipboardText;
|
io.SetClipboardTextFn = ImGui_ImplGlfwGL3_SetClipboardText;
|
||||||
io.GetClipboardTextFn = ImGui_ImplGlfwGL3_GetClipboardText;
|
io.GetClipboardTextFn = ImGui_ImplGlfwGL3_GetClipboardText;
|
||||||
#ifdef _MSC_VER
|
#ifdef _WIN32
|
||||||
io.ImeWindowHandle = glfwGetWin32Window(g_Window);
|
io.ImeWindowHandle = glfwGetWin32Window(g_Window);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
// GLFW
|
// GLFW
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
#ifdef _MSC_VER
|
#ifdef _WIN32
|
||||||
#undef APIENTRY
|
#undef APIENTRY
|
||||||
#define GLFW_EXPOSE_NATIVE_WIN32
|
#define GLFW_EXPOSE_NATIVE_WIN32
|
||||||
#define GLFW_EXPOSE_NATIVE_WGL
|
#define GLFW_EXPOSE_NATIVE_WGL
|
||||||
@ -198,7 +198,7 @@ bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks)
|
|||||||
io.RenderDrawListsFn = ImGui_ImplGlfw_RenderDrawLists;
|
io.RenderDrawListsFn = ImGui_ImplGlfw_RenderDrawLists;
|
||||||
io.SetClipboardTextFn = ImGui_ImplGlfw_SetClipboardText;
|
io.SetClipboardTextFn = ImGui_ImplGlfw_SetClipboardText;
|
||||||
io.GetClipboardTextFn = ImGui_ImplGlfw_GetClipboardText;
|
io.GetClipboardTextFn = ImGui_ImplGlfw_GetClipboardText;
|
||||||
#ifdef _MSC_VER
|
#ifdef _WIN32
|
||||||
io.ImeWindowHandle = glfwGetWin32Window(g_Window);
|
io.ImeWindowHandle = glfwGetWin32Window(g_Window);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ bool ImGui_ImplSdl_Init(SDL_Window *window)
|
|||||||
io.SetClipboardTextFn = ImGui_ImplSdl_SetClipboardText;
|
io.SetClipboardTextFn = ImGui_ImplSdl_SetClipboardText;
|
||||||
io.GetClipboardTextFn = ImGui_ImplSdl_GetClipboardText;
|
io.GetClipboardTextFn = ImGui_ImplSdl_GetClipboardText;
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _WIN32
|
||||||
SDL_SysWMinfo wmInfo;
|
SDL_SysWMinfo wmInfo;
|
||||||
SDL_VERSION(&wmInfo.version);
|
SDL_VERSION(&wmInfo.version);
|
||||||
SDL_GetWindowWMInfo(window, &wmInfo);
|
SDL_GetWindowWMInfo(window, &wmInfo);
|
||||||
|
16
imgui.cpp
16
imgui.cpp
@ -725,7 +725,7 @@ void ImGuiIO::AddInputCharactersUTF8(const char* utf8_chars)
|
|||||||
#define IM_INT_MAX (2147483647)
|
#define IM_INT_MAX (2147483647)
|
||||||
|
|
||||||
// Play it nice with Windows users. Notepad in 2015 still doesn't display text data with Unix-style \n.
|
// Play it nice with Windows users. Notepad in 2015 still doesn't display text data with Unix-style \n.
|
||||||
#ifdef _MSC_VER
|
#ifdef _WIN32
|
||||||
#define IM_NEWLINE "\r\n"
|
#define IM_NEWLINE "\r\n"
|
||||||
#else
|
#else
|
||||||
#define IM_NEWLINE "\n"
|
#define IM_NEWLINE "\n"
|
||||||
@ -8706,13 +8706,17 @@ void ImGui::Color(const char* prefix, unsigned int v)
|
|||||||
// PLATFORM DEPENDANT HELPERS
|
// PLATFORM DEPENDANT HELPERS
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS)
|
#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS)
|
||||||
|
|
||||||
#ifndef _WINDOWS_
|
#ifndef _WINDOWS_
|
||||||
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma comment(lib, "user32")
|
#pragma comment(lib, "user32")
|
||||||
|
#endif
|
||||||
|
|
||||||
// Win32 API clipboard implementation
|
// Win32 API clipboard implementation
|
||||||
static const char* GetClipboardTextFn_DefaultImpl()
|
static const char* GetClipboardTextFn_DefaultImpl()
|
||||||
@ -8782,14 +8786,18 @@ static void SetClipboardTextFn_DefaultImpl(const char* text)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS)
|
#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS)
|
||||||
|
|
||||||
#ifndef _WINDOWS_
|
#ifndef _WINDOWS_
|
||||||
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
#include <Imm.h>
|
#include <imm.h>
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma comment(lib, "imm32")
|
#pragma comment(lib, "imm32")
|
||||||
|
#endif
|
||||||
|
|
||||||
static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y)
|
static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y)
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Play it nice with Windows users. Notepad in 2015 still doesn't display text data with Unix-style \n.
|
// Play it nice with Windows users. Notepad in 2015 still doesn't display text data with Unix-style \n.
|
||||||
#ifdef _MSC_VER
|
#ifdef _WIN32
|
||||||
#define IM_NEWLINE "\r\n"
|
#define IM_NEWLINE "\r\n"
|
||||||
#else
|
#else
|
||||||
#define IM_NEWLINE "\n"
|
#define IM_NEWLINE "\n"
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <stdio.h> // vsnprintf, sscanf, printf
|
#include <stdio.h> // vsnprintf, sscanf, printf
|
||||||
#include <new> // new (ptr)
|
#include <new> // new (ptr)
|
||||||
#ifndef alloca
|
#ifndef alloca
|
||||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
#if _WIN32
|
||||||
#include <malloc.h> // alloca
|
#include <malloc.h> // alloca
|
||||||
#else
|
#else
|
||||||
#include <alloca.h> // alloca
|
#include <alloca.h> // alloca
|
||||||
|
Loading…
Reference in New Issue
Block a user