示例#1
0
        public static GLFWwindow getCurrentContext()
        {
            GLFWwindow win = new GLFWwindow();

            win.handle = Glfwint.getCurrentContext();
            return(win);
        }
示例#2
0
        public static GLFWmonitor getWindowMonitor(GLFWwindow window)
        {
            GLFWmonitor mon = new GLFWmonitor();

            mon.handle = Glfwint.getWindowMonitor(window.handle);
            return(mon);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
 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);
 }
示例#6
0
        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);
        }
示例#7
0
        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);
            }
        }
示例#8
0
        public static bool windowShouldClose(GLFWwindow window)
        {
            int val = Glfwint.windowShouldClose(window.handle);

            if (Convert.ToBoolean(val))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#9
0
        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() + "'");
            }
        }
示例#10
0
 public static GLFWcursorenterfun setCursorEnterCallback(GLFWwindow window, GLFWcursorenterfun cbfun)
 {
     return(Glfwint.setCursorEnterCallback(window.handle, cbfun));
 }
示例#11
0
 public static void setCursorPos(GLFWwindow window, double x, double y)
 {
     Glfwint.setCursorPos(window.handle, x, y);
 }
示例#12
0
        public static void setClipboardString(GLFWwindow window, string content)
        {
            IntPtr msg = Marshal.StringToHGlobalAuto(content);

            Glfwint.setClipboardString(window.handle, msg);
        }
示例#13
0
 public static void setCursor(GLFWwindow window, GLFWcursor cursor)
 {
     Glfwint.setCursor(window.handle, cursor.handle);
 }
示例#14
0
 public static GLFWmousebuttonfun setMouseButtonCallback(GLFWwindow window, GLFWmousebuttonfun cbfun)
 {
     return(Glfwint.setMouseButtonCallback(window.handle, cbfun));
 }
示例#15
0
 public static void showWindow(GLFWwindow window)
 {
     Glfwint.showWindow(window.handle);
 }
示例#16
0
 public static void setWindowSizeLimits(GLFWwindow window, int minWidth, int minHeight, int maxWidth, int maxHeight)
 {
     Glfwint.setWindowSizeLimits(window.handle, minWidth, minHeight, maxWidth, maxHeight);
 }
示例#17
0
 public static void setInputModes(GLFWwindow window, int mode, int value)
 {
     Glfwint.setInputMode(window.handle, mode, value);
 }
示例#18
0
 public static void getCursorPos(GLFWwindow window, out double x, out double y)
 {
     x = 0;
     y = 0;
     Glfwint.getCursorPos(window.handle, ref x, ref y);
 }
示例#19
0
 public static void setWindowTitle(GLFWwindow window, string title)
 {
     Glfwint.setWindowTitle(window.handle, Marshal.StringToHGlobalAuto(title));
 }
示例#20
0
        public static string getClipboardString(GLFWwindow window)
        {
            IntPtr p = Glfwint.getClipboardString(window.handle);

            return(Marshal.PtrToStringAuto(p));
        }
示例#21
0
 public static void makeContextCurrent(GLFWwindow window)
 {
     Glfwint.makeContextCurrent(window.handle);
 }
示例#22
0
 public static void setWindowUserPointer(GLFWwindow window, IntPtr pointer)
 {
     Glfwint.setWindowUserPointer(window.handle, pointer);
 }
示例#23
0
 public static GLFWcursorposfun setCursorPosCallback(GLFWwindow window, GLFWcursorposfun cbfun)
 {
     return(Glfwint.setCursorPosCallback(window.handle, cbfun));
 }
示例#24
0
        public static GLFWbuttonState getMouseButton(GLFWwindow window, GLFWkey key)
        {
            int a = Glfwint.getMouseButton(window.handle, (int)key);

            return((GLFWbuttonState)a);
        }
示例#25
0
 public static GLFWdropfun setDropCallback(GLFWwindow window, GLFWdropfun cbfun)
 {
     return(Glfwint.setDropCallback(window.handle, cbfun));
 }
示例#26
0
 public static GLFWcharfun setErrorCallback(GLFWwindow window, GLFWcharfun cbfun)
 {
     return(Glfwint.setErrorCallback(window.handle, cbfun));
 }
示例#27
0
 public static GLFWkeyfun setKeyCallback(GLFWwindow window, GLFWkeyfun cbfun)
 {
     return(Glfwint.setKeyCallback(window.handle, cbfun));
 }
示例#28
0
 public static GLFWcharmodsfun setCharModsCallback(GLFWwindow window, GLFWcharmodsfun cbfun)
 {
     return(Glfwint.setCharModsCallback(window.handle, cbfun));
 }
示例#29
0
 public static GLFWscrollfun setScrollCallback(GLFWwindow window, GLFWscrollfun cbfun)
 {
     return(Glfwint.setScrollCallback(window.handle, cbfun));
 }
示例#30
0
 public static void swapBuffers(GLFWwindow window)
 {
     Glfwint.swapBuffers(window.handle);
 }