Class: GLWindow
Inheritance: Window
Example #1
0
        public int Run(GLModel aModel)
        {
            fModel = aModel;
            // create "controller" component by specifying what are "model" and "view"
            fController = new GLController(aModel, fView);

            // create window with given controller
            fWindow = new GLWindow(fView.Title, fWindowFrame, fController);
            fWindow.Show();

            return RunLoop();
        }
Example #2
0
        static void Main()
        {
            // instantiate model and view components, so "controller" component can reference them
            PixelDisplayModel model = new PixelDisplayModel();
            GLView view = new GLView("GL Pixel Viewer", true);

            // create "controller" component by specifying what are "model" and "view"
            GLController glCtrl = new GLController(model, view);

            // create window with given controller
            GLWindow glWin = new GLWindow("GL Pixel Viewer", new Rectangle(10, 10, 640, 480), glCtrl);
            //glWin.WindowClass.ClassStyle = User32.CS_HREDRAW | User32.CS_VREDRAW | User32.CS_OWNDC;
            //glWin.CreateWindow();
            glWin.Show();

            // main message loop
            int exitCode;
            exitCode = mainMessageLoop(IntPtr.Zero);
        }