aglSetInteger() private méthode

private aglSetInteger ( AGLContext ctx, ParameterNames pname, int &@params ) : byte
ctx AGLContext
pname ParameterNames
@params int
Résultat byte
Exemple #1
0
        void SetBufferRect(CarbonWindowInfo carbonWindow)
        {
            if (carbonWindow.IsControl == false)
            {
                return;
            }
            System.Windows.Forms.Control ctrl = Control.FromHandle(carbonWindow.WindowRef);
            if (ctrl.TopLevelControl == null)
            {
                return;
            }
            Rect rect = API.GetControlBounds(carbonWindow.WindowRef);

            System.Windows.Forms.Form frm = (System.Windows.Forms.Form)ctrl.TopLevelControl;
            System.Drawing.Point      loc =
                frm.PointToClient(ctrl.PointToScreen(System.Drawing.Point.Empty));
            rect.X = (short)loc.X;
            rect.Y = (short)loc.Y;
            Debug.Print("Setting buffer_rect for control.");
            Debug.Print("MacOS Coordinate Rect:   {0}", rect);
            rect.Y = (short)(ctrl.TopLevelControl.ClientSize.Height - rect.Y - rect.Height);
            Debug.Print("  AGL Coordinate Rect:   {0}", rect);
            int[] glrect = new int[4];
            glrect[0] = rect.X;
            glrect[1] = rect.Y;
            glrect[2] = rect.Width;
            glrect[3] = rect.Height;
            Agl.aglSetInteger(Handle.Handle, Agl.ParameterNames.AGL_BUFFER_RECT, glrect);
            MyAGLReportError("aglSetInteger");
            Agl.aglEnable(Handle.Handle, Agl.ParameterNames.AGL_BUFFER_RECT);
            MyAGLReportError("aglEnable");
        }
Exemple #2
0
        private void SetBufferRect(IWindowInfo carbonWindow)
        {
            Rect rect = API.GetControlBounds(carbonWindow.Handle);

            Debug.Print("Setting buffer_rect for control.");
            Debug.Print("MacOS Coordinate Rect:   {0}", rect);
            int[] glrect = new int[4];

            if (XOffset != null)
            {
                glrect[0] = rect.X + XOffset();
            }
            else
            {
                glrect[0] = rect.X;
            }
            if (YOffset != null)
            {
                glrect[1] = rect.Y + YOffset();
            }
            else
            {
                glrect[1] = rect.Y;
            }
            glrect[2] = rect.Width;
            glrect[3] = rect.Height;

            Agl.aglSetInteger(Context.Handle, Agl.ParameterNames.AGL_BUFFER_RECT, glrect);
            MyAGLReportError("aglSetInteger");

            Agl.aglEnable(Context.Handle, Agl.ParameterNames.AGL_BUFFER_RECT);
            MyAGLReportError("aglEnable");
        }