Пример #1
0
 public static bool UnLoadWindow()
 {
     m_WinHandle    = IntPtr.Zero;
     m_glrc         = null;
     m_windowWidth  = 0;
     m_windowHeight = 0;
     return(true);
 }
Пример #2
0
        public Form1()
        {
            InitializeComponent();

            this.Width  = 400;
            this.Height = 400;

            this.Shown       += Form1_Shown1;
            this.Paint       += Form1_Paint;
            this.Click       += Form1_Click;
            this.SizeChanged += Form1_SizeChanged;

            glrc = new GLRC(this.Handle);
            glrc.LoadExtensionFunctions();
        }
Пример #3
0
        public static bool LoadWindow(System.Windows.Forms.Form window)
        {
            if (window == null || window.IsDisposed || window.Handle == IntPtr.Zero)
            {
                return(false);
            }

            if (IsLoadedWindow())
            {
                throw new NotSupportedException("Please unload window before load new window.");
            }

            m_WinHandle    = window.Handle;
            m_windowWidth  = window.Width;
            m_windowHeight = window.Height;

            m_glrc = new GLRC(m_WinHandle);
            m_glrc.LoadExtensionFunctions();

            gl.Enable(GL.DEPTH_TEST);
            gl.LoadIdentity();

            return(true);
        }