Example #1
0
 public static extern GLFWframebuffersizefun glfwSetFramebufferSizeCallback(IntPtr window, GLFWframebuffersizefun cbfun);
Example #2
0
 internal OpenGLContext(string name)
 {
     if (GLFW.GlfwInit() == 0)
     {
         Console.Error.WriteLine("GLFW failed to initialize!");
         Environment.Exit(1);
     }
     Window = GLFW.GlfwCreateWindow(1920, 1080, name, null, null);
     if (Window == null)
     {
         Console.Error.WriteLine("GLFW failed to open window!");
         GLFW.GlfwTerminate();
         Environment.Exit(1);
     }
     Input = new InputSource();
     GLFW.GlfwMakeContextCurrent(Window);
     StrongReferences = new List <Delegate>();
     {
         GLFWkeyfun cb = KeyCallback;
         StrongReferences.Add(cb);
         GLFW.GlfwSetKeyCallback(Window, cb);
     }
     {
         GLFWcharfun cb = CharCallback;
         StrongReferences.Add(cb);
         GLFW.GlfwSetCharCallback(Window, cb);
     }
     {
         GLFWerrorfun cb = ErrorCallback;
         StrongReferences.Add(cb);
         GLFW.GlfwSetErrorCallback(cb);
     }
     {
         GLFWscrollfun cb = ScrollCallback;
         StrongReferences.Add(cb);
         GLFW.GlfwSetScrollCallback(Window, cb);
     }
     {
         GLFWcharmodsfun cb = CharModsCallback;
         StrongReferences.Add(cb);
         GLFW.GlfwSetCharModsCallback(Window, cb);
     }
     {
         GLFWcursorposfun cb = CursorPosCallback;
         StrongReferences.Add(cb);
         GLFW.GlfwSetCursorPosCallback(Window, cb);
     }
     {
         GLFWwindowposfun cb = WindowPosCallback;
         StrongReferences.Add(cb);
         GLFW.GlfwSetWindowPosCallback(Window, cb);
     }
     {
         GLFWwindowsizefun cb = WindowSizeCallback;
         StrongReferences.Add(cb);
         GLFW.GlfwSetWindowSizeCallback(Window, cb);
     }
     {
         GLFWcursorenterfun cb = CursorEnterCallback;
         StrongReferences.Add(cb);
         GLFW.GlfwSetCursorEnterCallback(Window, cb);
     }
     {
         GLFWmousebuttonfun cb = MouseButtonCallback;
         StrongReferences.Add(cb);
         GLFW.GlfwSetMouseButtonCallback(Window, cb);
     }
     {
         GLFWwindowfocusfun cb = WindowFocusCallback;
         StrongReferences.Add(cb);
         GLFW.GlfwSetWindowFocusCallback(Window, cb);
     }
     {
         GLFWwindowiconifyfun cb = WindowIconifyCallback;
         StrongReferences.Add(cb);
         GLFW.GlfwSetWindowIconifyCallback(Window, cb);
     }
     {
         GLFWframebuffersizefun cb = FrameBufferSizeCallback;
         StrongReferences.Add(cb);
         GLFW.GlfwSetFramebufferSizeCallback(Window, cb);
     }
 }
Example #3
0
 public static GLFWframebuffersizefun setFramebufferSizeCallback(GLFWwindow window, GLFWframebuffersizefun cbfun)
 {
     return(Glfwint.setFramebufferSizeCallback(window.handle, cbfun));
 }
Example #4
0
 /*! @brief Sets the framebuffer resize callback for the specified window.
  *
  *  This function sets the framebuffer resize callback of the specified window,
  *  which is called when the framebuffer of the specified window is resized.
  *
  *  @param[in] window The window whose callback to set.
  *  @param[in] cbfun The new callback, or `NULL` to remove the currently set
  *  callback.
  *  @return The previously set callback, or `NULL` if no callback was set or the
  *  library had not been [initialized](@ref intro_init).
  *
  *  @par Thread Safety
  *  This function may only be called from the main thread.
  *
  *  @sa @ref window_fbsize
  *
  *  @since Added in GLFW 3.0.
  *
  *  @ingroup window
  */
 internal static extern GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun);