public static GLFWwindow getCurrentContext() { GLFWwindow win = new GLFWwindow(); win.handle = Glfwint.getCurrentContext(); return(win); }
public static GLFWmonitor getWindowMonitor(GLFWwindow window) { GLFWmonitor mon = new GLFWmonitor(); mon.handle = Glfwint.getWindowMonitor(window.handle); return(mon); }
public static GLFWwindow createWindow(int width, int height, string title, GLFWmonitor monitor, GLFWwindow share) { GLFWwindow win = new GLFWwindow(); IntPtr tmp = Glfwint.createWindow(width, height, Marshal.StringToHGlobalAuto(title), monitor.handle, share.handle); win.handle = tmp; return(win); }
public static void setWindowIcon(GLFWwindow window, List <GLFWimage> images) { GLFWimage[] arr = images.ToArray(); IntPtr addr = new IntPtr(); Marshal.StructureToPtr(arr, addr, false); Glfwint.setWindowIcon(window.handle, images.Count, addr); }
public static void getWindowFrameSize(GLFWwindow window, ref int left, ref int top, ref int right, ref int bottom) { left = 0; top = 0; right = 0; bottom = 0; Glfwint.getWindowFrameSize(window.handle, ref left, ref top, ref right, ref bottom); }
public static GLFWwindow createWindow(int width, int height, string title) { GLFWwindow win = new GLFWwindow(); IntPtr tmp = Glfwint.createWindow(width, height, Marshal.StringToHGlobalAuto(title), IntPtr.Zero, IntPtr.Zero); win.handle = tmp; return(win); }
public static GLFWbuttonState getKey(GLFWwindow window, int key) { int a = Glfwint.getKey(window.handle, key); if (a == (int)GLFWbuttonState.press) { return(GLFWbuttonState.press); } else { return(GLFWbuttonState.release); } }
public static bool windowShouldClose(GLFWwindow window) { int val = Glfwint.windowShouldClose(window.handle); if (Convert.ToBoolean(val)) { return(true); } else { return(false); } }
public static GLFWmode getInputMode(GLFWwindow window, GLFWmode mode) { int a = Glfwint.getInputMode(window.handle, (int)mode); if (a == 0) { return(GLFWmode.cursor); } else if (a == 1) { return(GLFWmode.stickyKeys); } else if (a == 2) { return(GLFWmode.stickyMouseButtons); } else { throw new Exception("Unknown code recieved from 'getInputMode', '" + a.ToString() + "'"); } }
public static GLFWcursorenterfun setCursorEnterCallback(GLFWwindow window, GLFWcursorenterfun cbfun) { return(Glfwint.setCursorEnterCallback(window.handle, cbfun)); }
public static void setCursorPos(GLFWwindow window, double x, double y) { Glfwint.setCursorPos(window.handle, x, y); }
public static void setClipboardString(GLFWwindow window, string content) { IntPtr msg = Marshal.StringToHGlobalAuto(content); Glfwint.setClipboardString(window.handle, msg); }
public static void setCursor(GLFWwindow window, GLFWcursor cursor) { Glfwint.setCursor(window.handle, cursor.handle); }
public static GLFWmousebuttonfun setMouseButtonCallback(GLFWwindow window, GLFWmousebuttonfun cbfun) { return(Glfwint.setMouseButtonCallback(window.handle, cbfun)); }
public static void showWindow(GLFWwindow window) { Glfwint.showWindow(window.handle); }
public static void setWindowSizeLimits(GLFWwindow window, int minWidth, int minHeight, int maxWidth, int maxHeight) { Glfwint.setWindowSizeLimits(window.handle, minWidth, minHeight, maxWidth, maxHeight); }
public static void setInputModes(GLFWwindow window, int mode, int value) { Glfwint.setInputMode(window.handle, mode, value); }
public static void getCursorPos(GLFWwindow window, out double x, out double y) { x = 0; y = 0; Glfwint.getCursorPos(window.handle, ref x, ref y); }
public static void setWindowTitle(GLFWwindow window, string title) { Glfwint.setWindowTitle(window.handle, Marshal.StringToHGlobalAuto(title)); }
public static string getClipboardString(GLFWwindow window) { IntPtr p = Glfwint.getClipboardString(window.handle); return(Marshal.PtrToStringAuto(p)); }
public static void makeContextCurrent(GLFWwindow window) { Glfwint.makeContextCurrent(window.handle); }
public static void setWindowUserPointer(GLFWwindow window, IntPtr pointer) { Glfwint.setWindowUserPointer(window.handle, pointer); }
public static GLFWcursorposfun setCursorPosCallback(GLFWwindow window, GLFWcursorposfun cbfun) { return(Glfwint.setCursorPosCallback(window.handle, cbfun)); }
public static GLFWbuttonState getMouseButton(GLFWwindow window, GLFWkey key) { int a = Glfwint.getMouseButton(window.handle, (int)key); return((GLFWbuttonState)a); }
public static GLFWdropfun setDropCallback(GLFWwindow window, GLFWdropfun cbfun) { return(Glfwint.setDropCallback(window.handle, cbfun)); }
public static GLFWcharfun setErrorCallback(GLFWwindow window, GLFWcharfun cbfun) { return(Glfwint.setErrorCallback(window.handle, cbfun)); }
public static GLFWkeyfun setKeyCallback(GLFWwindow window, GLFWkeyfun cbfun) { return(Glfwint.setKeyCallback(window.handle, cbfun)); }
public static GLFWcharmodsfun setCharModsCallback(GLFWwindow window, GLFWcharmodsfun cbfun) { return(Glfwint.setCharModsCallback(window.handle, cbfun)); }
public static GLFWscrollfun setScrollCallback(GLFWwindow window, GLFWscrollfun cbfun) { return(Glfwint.setScrollCallback(window.handle, cbfun)); }
public static void swapBuffers(GLFWwindow window) { Glfwint.swapBuffers(window.handle); }