Add shortcut methods to add/remove config/backend flags
This commit is contained in:
1 parent
258b9feeb6
commit
92a9d43876
3 files changed
+29
-2
No files matched your search
@@ -38,6 +38,20 @@ public final class ImGuiIO {
|
|||||||
ImGui::GetIO().ConfigFlags = configFlags;
|
ImGui::GetIO().ConfigFlags = configFlags;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See ImGuiConfigFlags enum. Set by user/application. Gamepad/keyboard navigation options, etc.
|
||||||
|
*/
|
||||||
|
public void addConfigFlags(int configFlags) {
|
||||||
|
setConfigFlags(getConfigFlags() | configFlags);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See ImGuiConfigFlags enum. Set by user/application. Gamepad/keyboard navigation options, etc.
|
||||||
|
*/
|
||||||
|
public void removeConfigFlags(int configFlags) {
|
||||||
|
setConfigFlags(getConfigFlags() & ~(configFlags));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See ImGuiBackendFlags enum. Set by back-end to communicate features supported by the back-end.
|
* See ImGuiBackendFlags enum. Set by back-end to communicate features supported by the back-end.
|
||||||
*/
|
*/
|
||||||
@@ -52,6 +66,19 @@ public final class ImGuiIO {
|
|||||||
ImGui::GetIO().BackendFlags = backendFlags;
|
ImGui::GetIO().BackendFlags = backendFlags;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See ImGuiBackendFlags enum. Set by back-end to communicate features supported by the back-end.
|
||||||
|
*/
|
||||||
|
public void addBackendFlags(int backendFlags) {
|
||||||
|
setBackendFlags(getBackendFlags() | backendFlags);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See ImGuiBackendFlags enum. Set by back-end to communicate features supported by the back-end.
|
||||||
|
*/
|
||||||
|
public void removeBackendFlags(int backendFlags) {
|
||||||
|
setBackendFlags(getBackendFlags() & ~(backendFlags));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Minimum time between saving positions/sizes to .ini file, in seconds.
|
* Minimum time between saving positions/sizes to .ini file, in seconds.
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ public class ImGuiImplGlfw {
|
|||||||
|
|
||||||
final ImGuiIO io = ImGui.getIO();
|
final ImGuiIO io = ImGui.getIO();
|
||||||
|
|
||||||
io.setBackendFlags(ImGuiBackendFlags.HasMouseCursors | ImGuiBackendFlags.HasSetMousePos);
|
io.addBackendFlags(ImGuiBackendFlags.HasMouseCursors | ImGuiBackendFlags.HasSetMousePos);
|
||||||
io.setBackendPlatformName("imgui_java_impl_glfw");
|
io.setBackendPlatformName("imgui_java_impl_glfw");
|
||||||
|
|
||||||
// Keyboard mapping. ImGui will use those indices to peek into the io.KeysDown[] array.
|
// Keyboard mapping. ImGui will use those indices to peek into the io.KeysDown[] array.
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ public final class ImGuiGlfwExample {
|
|||||||
final ImGuiIO io = ImGui.getIO();
|
final ImGuiIO io = ImGui.getIO();
|
||||||
|
|
||||||
io.setIniFilename(null); // We don't want to save .ini file
|
io.setIniFilename(null); // We don't want to save .ini file
|
||||||
io.setConfigFlags(ImGuiConfigFlags.NavEnableKeyboard | ImGuiConfigFlags.DockingEnable); // Navigation with keyboard and enabled docking
|
io.addConfigFlags(ImGuiConfigFlags.NavEnableKeyboard | ImGuiConfigFlags.DockingEnable); // Navigation with keyboard and enabled docking
|
||||||
|
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
// Fonts configuration
|
// Fonts configuration
|
||||||
|
|||||||
Reference in new issue
Block a user