Class GLFWNativeWGL


  • public class GLFWNativeWGL
    extends java.lang.Object
    Native bindings to the GLFW library's WGL native access functions.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  GLFWNativeWGL.Functions
      Contains the function pointers loaded from GLFW.getLibrary().
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long glfwGetWGLContext​(long window)
      Returns the HGLRC of the specified window.
      static void setPath​(java.lang.String path)
      Overrides the OpenGL shared library that GLFW loads internally.
      static void setPath​(org.lwjgl.system.FunctionProvider sharedLibrary)
      Calls setPath(String) with the path of the specified SharedLibrary.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • glfwGetWGLContext

        public static long glfwGetWGLContext​(long window)
        Returns the HGLRC of the specified window.

        The HDC associated with the window can be queried with the GetDC function. HDC dc = GetDC(glfwGetWin32Window(window)); This DC is private and does not need to be released.

        Note: This function may be called from any thread. Access is not synchronized.

        Parameters:
        window - the GLFW window
        Returns:
        the HGLRC of the specified window, or NULL if an error occurred.

        Possible errors include NO_WINDOW_CONTEXT and NOT_INITIALIZED.

        Since:
        version 3.0
      • setPath

        public static void setPath​(org.lwjgl.system.FunctionProvider sharedLibrary)
        Calls setPath(String) with the path of the specified SharedLibrary.

        Example usage: GLFWNativeWGL.setPath(GL.getFunctionProvider());

        Parameters:
        sharedLibrary - a FunctionProvider instance that will be cast to SharedLibrary
      • setPath

        public static void setPath​(@Nullable
                                   java.lang.String path)
        Overrides the OpenGL shared library that GLFW loads internally.

        This is useful when there's a mismatch between the shared libraries loaded by LWJGL and GLFW.

        This method must be called before GLFW initializes OpenGL. The override is available only in the default GLFW build bundled with LWJGL. Using the override with a custom GLFW build will produce a warning in DEBUG mode (but not an error).

        Parameters:
        path - the OpenGL shared library path, or null to remove the override.