예제 #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);
 }