コード例 #1
0
 public static GlfwMouseButtonFun SetMouseButtonCallback(GlfwWindowPtr window, GlfwMouseButtonFun cbfun)
 {
     mouseButtonFun = cbfun;
     return(GlfwDelegates.glfwSetMouseButtonCallback(window, cbfun));
 }
コード例 #2
0
ファイル: GlfwForms.cs プロジェクト: 52ChaseDream/PixelFarm
        static GlfwApp()
        {
            s_windowCloseCb = (GlfwWindowPtr wnd) =>
            {
                if (GetGlfwForm(wnd, out GlFwForm found))
                {
                    //user can cancel window close here here
                    bool userCancel = false;
                    GlFwForm.InvokeOnClosing(found, ref userCancel);
                    if (userCancel)
                    {
                        return;
                    }
                    //--------------------------------------
                    s_latestForm        = null;
                    s_latestGlWindowPtr = IntPtr.Zero;
                    //user let this window close ***
                    Glfw.SetWindowShouldClose(wnd, true);
                    Glfw.DestroyWindow(wnd); //destroy this
                    s_existingForms.Remove(wnd);
                    exitingFormList.Remove(found);
                    //--------------------------------------
                }
            };
            s_windowFocusCb = (GlfwWindowPtr wnd, bool focus) =>
            {
                if (GetGlfwForm(wnd, out GlFwForm found))
                {
                    GlFwForm.SetFocusState(found, focus);
                }
            };
            s_windowIconifyCb = (GlfwWindowPtr wnd, bool iconify) =>
            {
                if (GetGlfwForm(wnd, out GlFwForm found))
                {
                    GlFwForm.SetIconifyState(found, iconify);
                }
            };

            s_windowPosCb = (GlfwWindowPtr wnd, int x, int y) =>
            {
                if (GetGlfwForm(wnd, out GlFwForm found))
                {
                    GlFwForm.InvokeOnWindowMove(found, x, y);
                }
            };
            s_windowRefreshCb = (GlfwWindowPtr wnd) =>
            {
                if (GetGlfwForm(wnd, out GlFwForm found))
                {
                    GlFwForm.InvokeOnRefresh(found);
                }
            };

            s_windowSizeCb = (GlfwWindowPtr wnd, int width, int height) =>
            {
                if (GetGlfwForm(wnd, out GlFwForm found))
                {
                    GlFwForm.InvokeOnSizeChanged(found, width, height);
                }
            };
            s_windowCursorPosCb = (GlfwWindowPtr wnd, double x, double y) =>
            {
                if (GetGlfwForm(wnd, out GlFwForm found))
                {
                    found._latestMouseX = x;
                    found._latestMouseY = y;

                    GlFwForm.InvokeCursorPos(found, x, y);
                }
            };
            s_windowCursorEnterCb = (GlfwWindowPtr wnd, bool enter) =>
            {
                if (GetGlfwForm(wnd, out GlFwForm found))
                {
                    GlFwForm.SetCursorEnterState(found, enter);
                }
            };
            s_windowMouseButtonCb = (GlfwWindowPtr wnd, MouseButton btn, KeyActionKind keyAction) =>
            {
                if (GetGlfwForm(wnd, out GlFwForm found))
                {
                    int x = (int)found._latestMouseX;
                    int y = (int)found._latestMouseY;

                    GlFwForm.InvokeMouseButton(found, btn, keyAction, x, y);
                }
            };
            s_scrollCb = (GlfwWindowPtr wnd, double xoffset, double yoffset) =>
            {
                if (GetGlfwForm(wnd, out GlFwForm found))
                {
                    int x = (int)found._latestMouseX;
                    int y = (int)found._latestMouseY;
                    GlFwForm.InvokeOnScroll(found, x, y, (int)xoffset, (int)yoffset);
                }
            };
            s_windowKeyCb = (GlfwWindowPtr wnd, Key key, int scanCode, KeyActionKind action, KeyModifiers mods) =>
            {
                if (GetGlfwForm(wnd, out GlFwForm found))
                {
                    GlFwForm.InvokeKey(found, key, scanCode, action, mods);
                }
            };
            s_windowCharCb = (GlfwWindowPtr wnd, char ch) =>
            {
                if (GetGlfwForm(wnd, out GlFwForm found))
                {
                    GlFwForm.InvokeKeyPress(found, ch);
                }
            };
        }
コード例 #3
0
 internal static extern void glfwSetMouseButtonCallback(GlfwMouseButtonFun cbfun);
コード例 #4
0
ファイル: Glfw3_32.cs プロジェクト: luislasonbra/PixelFarm
 internal static extern GlfwMouseButtonFun glfwSetMouseButtonCallback(GlfwWindowPtr window, GlfwMouseButtonFun cbfun);
コード例 #5
0
ファイル: GLFW3.cs プロジェクト: mattparks/GLConverter
 public static GlfwMouseButtonFun SetMouseButtonCallback(GlfwWindowPtr window, GlfwMouseButtonFun cbfun)
 {
     mouseButtonFun = cbfun;
     return GLFWDelegates.glfwSetMouseButtonCallback(window, cbfun);
 }
コード例 #6
0
 public static void SetMouseButtonCallback(GlfwMouseButtonFun cbfun)
 {
     mouseButtonFun = cbfun;
     GlfwDelegates.glfwSetMouseButtonCallback(cbfun);
 }
コード例 #7
0
ファイル: Glfw3_32.cs プロジェクト: prepare/HTML-Renderer
 internal static extern GlfwMouseButtonFun glfwSetMouseButtonCallback(GlfwWindowPtr window, GlfwMouseButtonFun cbfun);
コード例 #8
0
 public static void SetMouseButtonCallback(GlfwWindowPtr window, GlfwMouseButtonFun cbfun)
 {
     mouseButtonFun = cbfun;
     GlfwDelegates.glfwSetMouseButtonCallback(window, cbfun);
 }
コード例 #9
0
ファイル: GlfwForms.cs プロジェクト: prepare/HTML-Renderer
        static GlfwApp()
        {
            s_windowCloseCb = (GlfwWindowPtr wnd) =>
            {

                GlFwForm found;
                if (GetGlfwForm(wnd, out found))
                {
                    //user can cancel window close here here
                    bool userCancel = false;
                    found.InvokeOnClosing(ref userCancel);
                    if (userCancel)
                    {
                        return;
                    }
                    //--------------------------------------
                    latestForm = null;
                    latestGlWindowPtr = IntPtr.Zero;
                    //user let this window close ***
                    Glfw.SetWindowShouldClose(wnd, true);
                    Glfw.DestroyWindow(wnd); //destroy this
                    existingForms.Remove(wnd);
                    exitingFormList.Remove(found);
                    //--------------------------------------
                }
            };
            s_windowFocusCb = (GlfwWindowPtr wnd, bool focus) =>
            {
                GlFwForm found;
                if (GetGlfwForm(wnd, out found))
                {
                    found.SetFocusState(focus);
                }
            };
            s_windowIconifyCb = (GlfwWindowPtr wnd, bool iconify) =>
            {
                GlFwForm found;
                if (GetGlfwForm(wnd, out found))
                {
                    found.SetIconifyState(iconify);
                }
            };

            s_windowPosCb = (GlfwWindowPtr wnd, int x, int y) =>
            {
                GlFwForm found;
                if (GetGlfwForm(wnd, out found))
                {
                    found.InvokeOnMove(x, y);
                }
            };
            s_windowRefreshCb = (GlfwWindowPtr wnd) =>
            {
                GlFwForm found;
                if (GetGlfwForm(wnd, out found))
                {
                    found.InvokeOnRefresh();
                }
            };

            s_windowSizeCb = (GlfwWindowPtr wnd, int width, int height) =>
            {
                GlFwForm found;
                if (GetGlfwForm(wnd, out found))
                {
                    found.InvokeOnSizeChanged(width, height);
                }
            };
            s_windowCursorPosCb = (GlfwWindowPtr wnd, double x, double y) =>
            {
                GlFwForm found;
                if (GetGlfwForm(wnd, out found))
                {
                    found.InvokeCursorPos(x, y);
                }
            };
            s_windowCursorEnterCb = (GlfwWindowPtr wnd, bool enter) =>
            {
                GlFwForm found;
                if (GetGlfwForm(wnd, out found))
                {
                    found.SetCursorEnterState(enter);
                }
            };
            s_windowMouseButtonCb = (GlfwWindowPtr wnd, MouseButton btn, KeyAction keyAction) =>
            {
                GlFwForm found;
                if (GetGlfwForm(wnd, out found))
                {
                    found.InvokeMouseButton(btn, keyAction);
                }
            };
            s_scrollCb = (GlfwWindowPtr wnd, double xoffset, double yoffset) =>
            {
                GlFwForm found;
                if (GetGlfwForm(wnd, out found))
                {
                    found.InvokeOnScroll(xoffset, yoffset);
                }
            };
            s_windowKeyCb = (GlfwWindowPtr wnd, Key key, int scanCode, KeyAction action, KeyModifiers mods) =>
            {
                GlFwForm found;
                if (GetGlfwForm(wnd, out found))
                {
                    found.InvokeKey(key, scanCode, action, mods);
                }
            };
            s_windowCharCb = (GlfwWindowPtr wnd, char ch) =>
            {
                GlFwForm found;
                if (GetGlfwForm(wnd, out found))
                {
                    found.InvokeKeyPress(ch);
                }
            };
        }
コード例 #10
0
ファイル: Glfw3.cs プロジェクト: Wonkyth/Pencil.Gaming
		public static void SetMouseButtonCallback(GlfwWindowPtr window, GlfwMouseButtonFun cbfun) {
			mouseButtonFun = cbfun;
			GlfwDelegates.glfwSetMouseButtonCallback(window, cbfun);
		}
コード例 #11
0
ファイル: Glfw3.cs プロジェクト: rhynodegreat/Pencil.Gaming
		public static GlfwMouseButtonFun SetMouseButtonCallback(WindowPtr window, GlfwMouseButtonFun cbfun) {
			mouseButtonFun = cbfun;
			return glfwSetMouseButtonCallback(window, cbfun);
		}
コード例 #12
0
ファイル: Glfw2.cs プロジェクト: AmzBee/Pencil.Gaming
		public static void SetMouseButtonCallback(GlfwMouseButtonFun cbfun) {
			mouseButtonFun = cbfun;
			GlfwDelegates.glfwSetMouseButtonCallback(cbfun);
		}
コード例 #13
0
ファイル: Glfw2_64.cs プロジェクト: nagyist/Pencil.Gaming
		internal static extern void glfwSetMouseButtonCallback(GlfwMouseButtonFun cbfun);