Class ImGuiImplGlfw

java.lang.Object
de.luckymcdev.foundryengine.client.imgui.backend.ImGuiImplGlfw

public class ImGuiImplGlfw extends Object
This class is a straightforward port of the imgui_impl_glfw.cpp.

It supports clipboard, gamepad, mouse and keyboard in the same way the original Dear ImGui code does. You can copy-paste this class in your codebase and modify the rendering routine in the way you'd like.

MODIFIED: Clipboard handled via minecraft X11 bug fixed.

  • Field Details

    • OS

      protected static final String OS
    • IS_WINDOWS

      protected static final boolean IS_WINDOWS
    • IS_APPLE

      protected static final boolean IS_APPLE
    • glfwVersionCombined

      protected static final int glfwVersionCombined
      See Also:
    • glfwHawWindowTopmost

      protected static final boolean glfwHawWindowTopmost
      See Also:
    • glfwHasWindowHovered

      protected static final boolean glfwHasWindowHovered
      See Also:
    • glfwHasWindowAlpha

      protected static final boolean glfwHasWindowAlpha
      See Also:
    • glfwHasPerMonitorDpi

      protected static final boolean glfwHasPerMonitorDpi
      See Also:
    • glfwHasFocusWindow

      protected static final boolean glfwHasFocusWindow
      See Also:
    • glfwHasFocusOnShow

      protected static final boolean glfwHasFocusOnShow
      See Also:
    • glfwHasMonitorWorkArea

      protected static final boolean glfwHasMonitorWorkArea
      See Also:
    • glfwHasOsxWindowPosFix

      protected static final boolean glfwHasOsxWindowPosFix
      See Also:
    • glfwHasNewCursors

      protected static final boolean glfwHasNewCursors
      See Also:
    • glfwHasMousePassthrough

      protected static final boolean glfwHasMousePassthrough
      See Also:
    • glfwHasGamepadApi

      protected static final boolean glfwHasGamepadApi
      See Also:
    • glfwHasGetKeyName

      protected static final boolean glfwHasGetKeyName
      See Also:
    • glfwHasGetError

      protected static final boolean glfwHasGetError
      See Also:
    • data

      protected ImGuiImplGlfw.Data data
  • Constructor Details

    • ImGuiImplGlfw

      public ImGuiImplGlfw()
  • Method Details

    • getClipboardTextFn

      protected imgui.callback.ImStrSupplier getClipboardTextFn()
    • setClipboardTextFn

      protected imgui.callback.ImStrConsumer setClipboardTextFn()
    • glfwKeyToImGuiKey

      protected int glfwKeyToImGuiKey(int glfwKey)
    • updateKeyModifiers

      protected void updateKeyModifiers(long window)
    • shouldChainCallback

      protected boolean shouldChainCallback(long window)
    • mouseButtonCallback

      public void mouseButtonCallback(long window, int button, int action, int mods)
    • scrollCallback

      public void scrollCallback(long window, double xOffset, double yOffset)
    • translateUntranslatedKey

      protected int translateUntranslatedKey(int key, int scancode)
    • eatErrors

      protected void eatErrors()
    • keyCallback

      public void keyCallback(long window, int keycode, int scancode, int action, int mods)
    • windowFocusCallback

      public void windowFocusCallback(long window, boolean focused)
    • cursorPosCallback

      public void cursorPosCallback(long window, double x, double y)
    • cursorEnterCallback

      public void cursorEnterCallback(long window, boolean entered)
    • charCallback

      public void charCallback(long window, int c)
    • monitorCallback

      public void monitorCallback(long window, int event)
    • installCallbacks

      public void installCallbacks(long window)
    • freeCallback

      protected void freeCallback(org.lwjgl.system.Callback cb)
    • restoreCallbacks

      public void restoreCallbacks(long window)
    • setCallbacksChainForAllWindows

      public void setCallbacksChainForAllWindows(boolean chainForAllWindows)
      Set to 'true' to enable chaining installed callbacks for all windows (including secondary viewports created by backends or by user. This is 'false' by default meaning we only chain callbacks for the main viewport. We cannot set this to 'true' by default because user callbacks code may be not testing the 'window' parameter of their callback. If you set this to 'true' your user callback code will need to make sure you are testing the 'window' parameter.
    • newData

      protected ImGuiImplGlfw.Data newData()
    • init

      public boolean init(long window, boolean installCallbacks)
    • shutdown

      public void shutdown()
    • updateMouseData

      protected void updateMouseData()
    • updateMouseCursor

      protected void updateMouseCursor()
    • updateGamepads

      protected void updateGamepads()
    • updateMonitors

      protected void updateMonitors()
    • newFrame

      public void newFrame()
    • initPlatformInterface

      protected void initPlatformInterface()
    • shutdownPlatformInterface

      protected void shutdownPlatformInterface()