[WIP] Viewports backend, 2
This commit is contained in:
1 parent
c1632cfd3e
commit
e9cfd62137
13 files changed
+126
-12
No files matched your search
@@ -590,6 +590,75 @@ public final class ImGuiIO {
|
||||
ImGui::GetIO().ConfigDockingTransparentPayload = value;
|
||||
*/
|
||||
|
||||
// Viewport options (when ImGuiConfigFlags_ViewportsEnable is set)
|
||||
|
||||
/**
|
||||
* Set to make all floating imgui windows always create their own viewport.
|
||||
* Otherwise, they are merged into the main host viewports when overlapping it. May also set ImGuiViewportFlags_NoAutoMerge on individual viewport.
|
||||
*/
|
||||
public native boolean getConfigViewportsNoAutoMerge(); /*
|
||||
return ImGui::GetIO().ConfigViewportsNoAutoMerge;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set to make all floating imgui windows always create their own viewport.
|
||||
* Otherwise, they are merged into the main host viewports when overlapping it. May also set ImGuiViewportFlags_NoAutoMerge on individual viewport.
|
||||
*/
|
||||
public native void setConfigViewportsNoAutoMerge(boolean value); /*
|
||||
ImGui::GetIO().ConfigViewportsNoAutoMerge = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Disable default OS task bar icon flag for secondary viewports. When a viewport doesn't want a task bar icon, ImGuiViewportFlags_NoTaskBarIcon will be set on it.
|
||||
*/
|
||||
public native boolean getConfigViewportsNoTaskBarIcon(); /*
|
||||
return ImGui::GetIO().ConfigViewportsNoTaskBarIcon;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Disable default OS task bar icon flag for secondary viewports. When a viewport doesn't want a task bar icon, ImGuiViewportFlags_NoTaskBarIcon will be set on it.
|
||||
*/
|
||||
public native void setConfigViewportsNoTaskBarIcon(boolean value); /*
|
||||
ImGui::GetIO().ConfigViewportsNoTaskBarIcon = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* [BETA] Disable default OS window decoration flag for secondary viewports. When a viewport doesn't want window decorations,
|
||||
* ImGuiViewportFlags_NoDecoration will be set on it. Enabling decoration can create subsequent issues at OS levels (e.g. minimum window size).
|
||||
*/
|
||||
public native boolean getConfigViewportsNoDecoration(); /*
|
||||
return ImGui::GetIO().ConfigViewportsNoDecoration;
|
||||
*/
|
||||
|
||||
/**
|
||||
* [BETA] Disable default OS window decoration flag for secondary viewports. When a viewport doesn't want window decorations,
|
||||
* ImGuiViewportFlags_NoDecoration will be set on it. Enabling decoration can create subsequent issues at OS levels (e.g. minimum window size).
|
||||
*/
|
||||
public native void setConfigViewportsNoDecoration(boolean value); /*
|
||||
ImGui::GetIO().ConfigViewportsNoDecoration = value;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Disable default OS parenting to main viewport for secondary viewports.
|
||||
* By default, viewports are marked with ParentViewportId = <main_viewport>,
|
||||
* expecting the platform back-end to setup a parent/child relationship between the OS windows (some back-end may ignore this).
|
||||
* Set to true if you want the default to be 0, then all viewports will be top-level OS windows.
|
||||
*/
|
||||
public native boolean getConfigViewportsNoDefaultParent(); /*
|
||||
return ImGui::GetIO().ConfigViewportsNoDefaultParent;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Disable default OS parenting to main viewport for secondary viewports.
|
||||
* By default, viewports are marked with ParentViewportId = <main_viewport>,
|
||||
* expecting the platform back-end to setup a parent/child relationship between the OS windows (some back-end may ignore this).
|
||||
* Set to true if you want the default to be 0, then all viewports will be top-level OS windows.
|
||||
*/
|
||||
public native void setConfigViewportsNoDefaultParent(boolean value); /*
|
||||
ImGui::GetIO().ConfigViewportsNoDefaultParent = value;
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Time elapsed since last frame, in seconds.
|
||||
* <p>
|
||||
|
||||
@@ -191,7 +191,7 @@ public final class ImGuiPlatformIO extends ImGuiStruct {
|
||||
JNIEnv* env = Jni::GetEnv();\
|
||||
env->SetLongField(jTmpViewport, Jni::GetBindingStructPtrID(), (intptr_t)vp);\
|
||||
Jni::CallImPlatformFuncViewportSuppImVec2(env, platformCallback##name, jTmpViewport, jTmpImVec2);\
|
||||
Jni::ImVec2Cpy(env, jTmpImVec2, dst);\
|
||||
Jni::ImVec2Cpy(env, jTmpImVec2, &dst);\
|
||||
}\
|
||||
return dst;\
|
||||
}
|
||||
|
||||
@@ -38,14 +38,14 @@ public final class ImGuiViewport extends ImGuiStruct {
|
||||
*/
|
||||
|
||||
/**
|
||||
* See ImGuiViewportFlags_.
|
||||
* See {@link imgui.flag.ImGuiViewportFlags}.
|
||||
*/
|
||||
public native int getFlags(); /*
|
||||
return IMGUI_VIEWPORT->Flags;
|
||||
*/
|
||||
|
||||
/**
|
||||
* See ImGuiViewportFlags_.
|
||||
* See {@link imgui.flag.ImGuiViewportFlags}.
|
||||
*/
|
||||
public native void setFlags(int flags); /*
|
||||
IMGUI_VIEWPORT->Flags = flags;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package imgui.glfw;
|
||||
|
||||
final class ImGuiImplGlfwNative {
|
||||
private ImGuiImplGlfwNative() {
|
||||
}
|
||||
|
||||
/*JNI
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
*/
|
||||
|
||||
// GLFW hack: Hide icon from task bar
|
||||
// Applied only for windows
|
||||
static native void win32hideFromTaskBar(long hwndPtr); /*
|
||||
#if defined(_WIN32)
|
||||
HWND hwnd = (HWND)hwndPtr;
|
||||
LONG ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||
ex_style &= ~WS_EX_APPWINDOW;
|
||||
ex_style |= WS_EX_TOOLWINDOW;
|
||||
::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
Reference in new issue
Block a user