public static GLFWcursor createCursor(GLFWimage image, int x, int y) { GLFWcursor cursor = new GLFWcursor(); cursor.handle = Glfwint.createCursor(image.handle, x, y); return(cursor); }
public static void setGammaRamp(GLFWmonitor monitor, GLFWgammaramp ramp) { IntPtr ptr = new IntPtr(); Marshal.StructureToPtr(ramp, ptr, false); Glfwint.setGammaRamp(monitor.handle, ptr); }
public static GlfwVersion getVersion() { GlfwVersion version = new GlfwVersion(); Glfwint.getVersion(ref version.Major, ref version.Minor, ref version.Revision); return(version); }
public static GLFWwindow getCurrentContext() { GLFWwindow win = new GLFWwindow(); win.handle = Glfwint.getCurrentContext(); return(win); }
public static GLFWcursor createStandardCursor(int shape) { GLFWcursor cursor = new GLFWcursor(); cursor.handle = Glfwint.createStandardCursor(shape); return(cursor); }
public static GLFWbuttonState[] getJoystickButtons(int joy) { int count = 0; IntPtr a = Glfwint.getJoystickButtons(joy, ref count); if (count != 0) { char[] o = new char[count]; Marshal.Copy(a, o, 0, count); GLFWbuttonState[] t = new GLFWbuttonState[count]; for (int i = 0; i < o.Length; i++) { if (o [i] == (int)GLFWbuttonState.press) { t [i] = GLFWbuttonState.press; } else { t [i] = GLFWbuttonState.release; } } return(t); } return(new GLFWbuttonState[0]); }
public static bool extensionSupported(string extension) { IntPtr ext = Marshal.StringToHGlobalAuto(extension); int val = Glfwint.extensionSupported(ext); return(val == 1); }
public static GLFWmonitor getWindowMonitor(GLFWwindow window) { GLFWmonitor mon = new GLFWmonitor(); mon.handle = Glfwint.getWindowMonitor(window.handle); return(mon); }
public static GLFWmonitor getPrimaryMonitor() { GLFWmonitor newMonitor = new GLFWmonitor(); newMonitor.handle = Glfwint.getPrimaryMonitor(); return(newMonitor); }
public static GLFWgammaramp getGammaRamp(GLFWmonitor monitor) { IntPtr a = Glfwint.getGammaRamp(monitor.handle); GLFWgammaramp ramp = (GLFWgammaramp)Marshal.PtrToStructure(a, typeof(GLFWgammaramp)); return(ramp); }
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 bool joystickPresent(int joy) { if (Glfwint.joystickPresent(joy) == 1) { return(true); } return(false); }
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 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 float[] getJoystickAxes(int joy) { int count = 0; IntPtr a = Glfwint.getJoystickAxes(joy, ref count); if (count != 0) { float[] o = new float[count]; Marshal.Copy(a, o, 0, count); return(o); } return(new float[0]); }
public static List <GLFWvidmode> getVideoModes(GLFWmonitor monitor) { int count = 0; IntPtr modeList = Glfwint.getVideoModes(monitor.handle, ref count); List <GLFWvidmode> modes = new List <GLFWvidmode> (); for (int i = 0; i < count; i++) { GLFWvidmode newMode = new GLFWvidmode(); newMode = (GLFWvidmode)Marshal.PtrToStructure(modeList, typeof(GLFWvidmode)); modeList += Marshal.SizeOf(typeof(GLFWvidmode)); modes.Add(newMode); } return(modes); }
public static List <GLFWmonitor> getMonitors() { int count = 0; IntPtr monitorList = Glfwint.getMonitors(ref count); List <GLFWmonitor> monitors = new List <GLFWmonitor> (); for (int i = 0; i < count; i++) { GLFWmonitor newMonitor = new GLFWmonitor(); newMonitor.handle = (IntPtr)Marshal.PtrToStructure(monitorList, typeof(IntPtr)); monitorList += Marshal.SizeOf(typeof(IntPtr)); monitors.Add(newMonitor); } return(monitors); }
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 GLFWcursorposfun setCursorPosCallback(GLFWwindow window, GLFWcursorposfun cbfun) { return(Glfwint.setCursorPosCallback(window.handle, cbfun)); }
public static string getVersionString() { return(Marshal.PtrToStringAuto(Glfwint.getVersionString())); }
public static GLFWscrollfun setScrollCallback(GLFWwindow window, GLFWscrollfun cbfun) { return(Glfwint.setScrollCallback(window.handle, cbfun)); }
public static void setTime(double time) { Glfwint.setTime(time); }
public static GLFWmousebuttonfun setMouseButtonCallback(GLFWwindow window, GLFWmousebuttonfun cbfun) { return(Glfwint.setMouseButtonCallback(window.handle, cbfun)); }
public static GLFWkeyfun setKeyCallback(GLFWwindow window, GLFWkeyfun cbfun) { return(Glfwint.setKeyCallback(window.handle, cbfun)); }
public static GLFWjoystickfun setJoystickCallback(GLFWjoystickfun cbfun) { return(Glfwint.setJoystickCallback(cbfun)); }
public static void setInputModes(GLFWwindow window, int mode, int value) { Glfwint.setInputMode(window.handle, mode, value); }
public static GLFWdropfun setDropCallback(GLFWwindow window, GLFWdropfun cbfun) { return(Glfwint.setDropCallback(window.handle, cbfun)); }