Exemplo n.º 1
0
        public static GLFWwindow getCurrentContext()
        {
            GLFWwindow win = new GLFWwindow();

            win.handle = Glfwint.getCurrentContext();
            return(win);
        }
Exemplo n.º 2
0
        public static GLFWmonitor getWindowMonitor(GLFWwindow window)
        {
            GLFWmonitor mon = new GLFWmonitor();

            mon.handle = Glfwint.getWindowMonitor(window.handle);
            return(mon);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 8
0
        public static bool windowShouldClose(GLFWwindow window)
        {
            int val = Glfwint.windowShouldClose(window.handle);

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

            Glfwint.setClipboardString(window.handle, msg);
        }
Exemplo n.º 13
0
 public static void setCursor(GLFWwindow window, GLFWcursor cursor)
 {
     Glfwint.setCursor(window.handle, cursor.handle);
 }
Exemplo n.º 14
0
 public static GLFWmousebuttonfun setMouseButtonCallback(GLFWwindow window, GLFWmousebuttonfun cbfun)
 {
     return(Glfwint.setMouseButtonCallback(window.handle, cbfun));
 }
Exemplo n.º 15
0
 public static void showWindow(GLFWwindow window)
 {
     Glfwint.showWindow(window.handle);
 }
Exemplo n.º 16
0
 public static void setWindowSizeLimits(GLFWwindow window, int minWidth, int minHeight, int maxWidth, int maxHeight)
 {
     Glfwint.setWindowSizeLimits(window.handle, minWidth, minHeight, maxWidth, maxHeight);
 }
Exemplo n.º 17
0
 public static void setInputModes(GLFWwindow window, int mode, int value)
 {
     Glfwint.setInputMode(window.handle, mode, value);
 }
Exemplo n.º 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);
 }
Exemplo n.º 19
0
 public static void setWindowTitle(GLFWwindow window, string title)
 {
     Glfwint.setWindowTitle(window.handle, Marshal.StringToHGlobalAuto(title));
 }
Exemplo n.º 20
0
        public static string getClipboardString(GLFWwindow window)
        {
            IntPtr p = Glfwint.getClipboardString(window.handle);

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

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