Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            scene = new Scene.Scene(800, 600);

            menuList.Add(new InfoMenu(300, scene.HEIGHT - 20, 0, bottomHeight + 20));
            menuList.Add(new BottomMenu(scene.WIDTH, bottomHeight, 0, 0));

            Glut.glutInit();

            Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGBA | Glut.GLUT_DEPTH);
            Glut.glutInitWindowSize(scene.WIDTH + menuList[0].WIDTH, scene.HEIGHT + menuList[1].HEIGHT);

            Glut.glutInitWindowPosition(100, 10);
            int id = Glut.glutCreateWindow("Scene Editor");

            Init();
            Glut.glutDisplayFunc(new Glut.DisplayCallback(Draw));
            Glut.glutKeyboardFunc(new Glut.KeyboardCallback(KeyboardHandle));
            Glut.glutMouseFunc(new Glut.MouseCallback(MouseHandle));
            Glut.glutMouseWheelFunc(new Glut.MouseWheelCallback(MouseWheelHandle));
            //Glut.glutReshapeFunc(new Glut.ReshapeCallback(Resize));
            Glut.glutTimerFunc(1000 / 60, Update, 0);

            Glut.glutMainLoop();
        }
Ejemplo n.º 2
0
        private static void Init()
        {
            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_DEPTH);
            Glut.glutInitWindowSize(Width, Height);

            ScreenWidth  = Glut.glutGet(Glut.GLUT_SCREEN_WIDTH);
            ScreenHeight = Glut.glutGet(Glut.GLUT_SCREEN_HEIGHT);

            Glut.glutInitWindowPosition((ScreenWidth - Width) / 2, (ScreenHeight - Height) / 2);
            Glut.glutCreateWindow("Plexico 2D Game - Copyright Alex Tan 2016");
            //Glut.glutGameModeString(Width+"x"+Height+":32@60");

            Glut.glutSetOption(Glut.GLUT_ACTION_ON_WINDOW_CLOSE, Glut.GLUT_ACTION_CONTINUE_EXECUTION);
            Gl.Viewport(0, 0, Width, Height);
            Glut.glutReshapeFunc(OnReshape);
            Glut.glutDisplayFunc(delegate() { });
            Glut.glutIdleFunc(MainGameLoop);

            //Console.SetWindowSize(Console.LargestWindowWidth / 4, Console.LargestWindowHeight / 4);
            //Console.SetWindowPosition(0, 0);
            Mode = ProgramMode.None;

            AssetsManager.Init();
            Input.Init();
            Gui.Init();
            SwitchToTitleScreen();
        }
Ejemplo n.º 3
0
        // --- Entry Point ---
        #region Run()
        public static void Run()
        {
            // initialize GLUT
            Glut.glutInit();
            // double buffer, use rgb color, enable depth buffers
            Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGB | Glut.GLUT_DEPTH);
            // initialize the window size
            Glut.glutInitWindowSize(windowWidth, windowHeight);
            // set the window postion
            Glut.glutInitWindowPosition(100, 100);
            // create the window
            Glut.glutCreateWindow("Starfield");

            // set the display function - called when redrawing
            Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
            // set the idle function - called when idle
            Glut.glutIdleFunc(new Glut.IdleCallback(Idle));
            // set the keyboard function - called on keyboard events
            Glut.glutKeyboardFunc(new Glut.KeyboardCallback(Keyboard));
            // set the mouse function - called on mouse stuff
            Glut.glutMouseFunc(new Glut.MouseCallback(Mouse));
            // set the reshape function - called when client area changes
            Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));

            // do our own initialization
            Init();

            // let GLUT handle the current thread from here
            Glut.glutMainLoop();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            int w = 400;
            int h = 400;

            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB);
            Glut.glutInitWindowSize(w, h);
            Glut.glutInitWindowPosition(400, 300);
            Glut.glutCreateWindow("Pradzia");
            Init();
            Glut.glutDisplayFunc(new Glut.DisplayCallback(Piesk));
            Glut.glutCreateMenu(new Glut.CreateMenuCallback(Menu));
            Glut.glutAddMenuEntry("(1)Ketvirtis is virsaus", 1);
            Glut.glutAddMenuEntry("(2)Figura is virsaus", 2);
            Glut.glutAddMenuEntry("(3)Figura is sono", 3);
            Glut.glutAddMenuEntry("(4)Fugura paversta", 4);
            Glut.glutAddMenuEntry("(5)Sumazint, pasukt ir pastumt", 5);
            Glut.glutAddMenuEntry("(6)glu.Perspective", 6);
            Glut.glutAddMenuEntry("(7)glFrustum", 7);
            Glut.glutAddMenuEntry("Astuntas punktas", 8);
            Glut.glutAddMenuEntry("Pabaiga", 9);
            Glut.glutAttachMenu(Glut.GLUT_RIGHT_BUTTON);
            Glut.glutMainLoop();
        }
Ejemplo n.º 5
0
        static Visualizer()
        {
            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGB | Glut.GLUT_DEPTH);
            Glut.glutInitWindowSize(windowWidth, windowHeight);
            Glut.glutInitWindowPosition(700, 100);
            Glut.glutCreateWindow("Rubik's cube");

            Gl.glViewport(0, 0, windowWidth, windowHeight);
            Gl.glClearColor(0.85f, 0.85f, 0.85f, 0.0f);
            Gl.glMatrixMode(Gl.GL_PROJECTION);
            Gl.glLoadIdentity();
            Glu.gluPerspective(ViewAngle, ((double)windowWidth) / windowHeight, ZNear, ZFar);
            //Gl.glOrtho(-250, 250,
            //               -250, 250, ZNear, ZFar);
            Gl.glMatrixMode(Gl.GL_MODELVIEW);
            Gl.glLoadIdentity();
            Gl.glTranslated(0, 0, StartingZ);
            Gl.glRotated(StartingAngleXY, 1, -1, 0);
            Gl.glClearDepth(1.0f);
            Gl.glEnable(Gl.GL_DEPTH_TEST);
            Gl.glDepthFunc(Gl.GL_LEQUAL);
            Gl.glShadeModel(Gl.GL_SMOOTH);
            Gl.glHint(Gl.GL_PERSPECTIVE_CORRECTION_HINT, Gl.GL_NICEST);

            rc.CubeRotationEvent += rc_CubeRotationEvent;
            rc.EdgeRotationEvent += rc_EdgeRotationEvent;
            isAnimationEnabled    = true;
        }
Ejemplo n.º 6
0
        static void Init()
        {
            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_DEPTH | Glut.GLUT_DOUBLE | Glut.GLUT_RGB);
            Glut.glutInitWindowSize(1024, 700);
            //Glut.glutInitWindowPosition(150, 0);
            Glut.glutInitWindowPosition(150, 0);
            Glut.glutCreateWindow("Computação Gráfica");

            ContentManager.SetModelList("modelos\\");
            ContentManager.LoadModels();
            Load3dsModels();

            Gl.glMatrixMode(Gl.GL_PROJECTION);
            Gl.glLoadIdentity();

            SetupLight();

            Glu.gluPerspective(35.0f, 1.0, 0.001, 100.0);
            Gl.glMatrixMode(Gl.GL_MODELVIEW);
            Glu.gluLookAt(0.0, 1.0, 8.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);

            Gl.glClearColor(0.498039f, 1, 0.831373f, 0.0f);
            Glut.glutTimerFunc(1, airplane.Timer, 1);

            Gl.glEnable(Gl.GL_DEPTH_TEST);
            Glut.glutDisplayFunc(Render);

            RegisterFuncs();

            Glut.glutMainLoop();
        }
Ejemplo n.º 7
0
        /*private void keyboard(byte key, int x, int y)
         * {
         *      int mod = Glut.glutGetModifiers();
         *              if(mod==Glut.GLUT_ACTIVE_CTRL) ctrl=true;
         *              else ctrl=false;
         * }*/

        /**
         * luo glut ikkuna, aseta callbackit ja luo tyhjä texture
         */
        void create(int width, int height)
        {
            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGB);
            Glut.glutInitWindowSize(width, height);
            Glut.glutInitWindowPosition(100, 100);
            Glut.glutCreateWindow("CSPaint");

            Glut.glutDisplayFunc(new Glut.DisplayCallback(display));
            Glut.glutMouseFunc(new Glut.MouseCallback(mouseButton));
            Glut.glutMotionFunc(new Glut.MotionCallback(mouseMotion));
            Glut.glutCloseFunc(new Glut.CloseCallback(closeWindow));
            Glut.glutReshapeFunc(new Glut.ReshapeCallback(reshape));
            //Glut.glutKeyboardFunc(new Glut.KeyboardCallback(keyboard));

            Gl.glDisable(Gl.GL_LIGHTING);
            Gl.glClearColor(1, 1, 1, 1);
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);
            Gl.glDisable(Gl.GL_CULL_FACE);

            Gl.glDisable(Gl.GL_DEPTH_TEST);
            Gl.glMatrixMode(Gl.GL_PROJECTION);
            Gl.glLoadIdentity();
            Gl.glOrtho(0, width, height, 0, -1, 1);
            Gl.glMatrixMode(Gl.GL_MODELVIEW);
            Gl.glLoadIdentity();

            // luo yksi taso
            newLayer();
        }
Ejemplo n.º 8
0
        public static void Main(string[] args)
        {
            int i, j;

            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGBA);
            Glut.glutInitWindowSize(320, 320);
            Glut.glutInitWindowPosition(50, 50);
            Glut.glutCreateWindow("Null");

            Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
            Glut.glutKeyboardFunc(new Glut.KeyboardCallback(Keyboard));
            Glut.glutMotionFunc(new Glut.MotionCallback(Motion));
            Glut.glutMouseFunc(new Glut.MouseCallback(Mouse));
            Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));

            // Create a pretty color ramp
            for (j = 0; j < 256; j++)
            {
                for (i = 0; i < 256; i++)
                {
                    image[(256 * j + i) * 3 + 0] = (byte)(255 - i * j / 255);
                    image[(256 * j + i) * 3 + 1] = (byte)i;
                    image[(256 * j + i) * 3 + 2] = (byte)j;
                }
            }

            Glut.glutMainLoop();
        }
Ejemplo n.º 9
0
        public static void Run()
        {
            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_DEPTH | Glut.GLUT_DOUBLE | Glut.GLUT_RGB);
            Glut.glutInitWindowPosition(50, 50);
            Glut.glutCreateWindow("Voronoi");

            Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
            Glut.glutKeyboardFunc(new Glut.KeyboardCallback(Keyboard));
            Glut.glutMouseFunc(new Glut.MouseCallback(Mouse));
            Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));

            Glut.glutCreateMenu(new Glut.CreateMenuCallback(Menu));
            Glut.glutAddMenuEntry("Voronoi", 0);
            Glut.glutAddMenuEntry("", 0);
            Glut.glutAddMenuEntry("[r] Reset", (int)'r');
            Glut.glutAddMenuEntry("[p] Toggle points", (int)'p');
            Glut.glutAddMenuEntry("", 0);
            Glut.glutAddMenuEntry("Quit", 27);
            Glut.glutAttachMenu(Glut.GLUT_RIGHT_BUTTON);

            Init();

            Glut.glutMainLoop();
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            int w = 400;
            int h = 400;

            Glut.glutInit();
            Gl.glEnable(Gl.GL_DEPTH_TEST);
            Glut.glutInitDisplayMode(Glut.GLUT_DEPTH | Glut.GLUT_SINGLE | Glut.GLUT_RGB);
            Glut.glutInitWindowSize(w, h);
            Glut.glutInitWindowPosition(400, 300);
            Glut.glutCreateWindow("Pradzia");
            Init();
            Glut.glutDisplayFunc(new Glut.DisplayCallback(Vaizdavimas));
            Glut.glutSpecialFunc(new Glut.SpecialCallback(Klaviatura));
            Glut.glutCreateMenu(new Glut.CreateMenuCallback(Menu));
            Glut.glutReshapeFunc(new Glut.ReshapeCallback(Perpiesti));
            Glut.glutAddMenuEntry("Difuse", 1);
            Glut.glutAddMenuEntry("Specular", 2);
            Glut.glutAddMenuEntry("Ambient", 3);
            Glut.glutAddMenuEntry("Du sviesos saltiniai", 4);
            Glut.glutAddMenuEntry("+45 laipsniai X", 5);
            Glut.glutAddMenuEntry("-45 laipsniai X", 6);
            Glut.glutAddMenuEntry("Pabaiga", 9);
            Glut.glutAttachMenu(Glut.GLUT_RIGHT_BUTTON);
            Glut.glutMainLoop();
        }
Ejemplo n.º 11
0
 private static void Main()
 {
     Glut.GlutInit();
     Glut.glutCreateWindow("GeometricModelingLR1");
     Glut.glutInitWindowSize(300, 300);
     Glut.glutInitWindowPosition(0, 0);
     Glut.GlutDisplayFunc(Display);
     Glut.glutMainLoop();
 }
Ejemplo n.º 12
0
 static void Main()
 {
     Glut.glutInit();
     Glut.glutInitWindowSize(800, 800);
     Glut.glutCreateWindow("OpenGL Static Shape");
     Glut.glutInitWindowPosition(50, 50);
     Glut.glutDisplayFunc(display);
     Glut.glutMainLoop();
 }
Ejemplo n.º 13
0
        public static int CreateWindow(int width, int height, bool tryFullScreen)
        {
            //!!! полный экран здесь не сделан, да и нафиг он нужен для 2д игры

            //Делаем окошко в левом верхнем углу
            Glut.glutInitWindowSize(width, height);
            Glut.glutInitWindowPosition(0, 0);
            return(Glut.glutCreateWindow(Config.WindowName));
        }
Ejemplo n.º 14
0
 public GlControl(int Width, int Height)
 {
     this.width  = Width;
     this.height = Height;
     Glut.glutInit();
     Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGB | Glut.GLUT_DEPTH);
     Glut.glutInitWindowSize(Width, Height);
     Glut.glutInitWindowPosition(0, 0);
     Glut.glutCreateWindow("Tarea OpenGL");
     Init();
 }
Ejemplo n.º 15
0
 public static void Run()
 {
     Glut.glutInit();
     Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB);
     Glut.glutInitWindowSize(250, 250);
     Glut.glutInitWindowPosition(100, 100);
     Glut.glutCreateWindow("Hello");
     Init();
     Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
     Glut.glutMainLoop();
 }
Ejemplo n.º 16
0
 public static void Main(string[] args)
 {
     Glut.glutInit();
     Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB);
     Glut.glutInitWindowSize(100, 100);
     Glut.glutInitWindowPosition(100, 100);
     Glut.glutCreateWindow("Feedback");
     Init();
     Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
     Glut.glutKeyboardFunc(new Glut.KeyboardCallback(Keyboard));
     Glut.glutMainLoop();
 }
Ejemplo n.º 17
0
 public static void Run()
 {
     Glut.glutInit();
     Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB | Glut.GLUT_DEPTH);
     Glut.glutInitWindowSize(200, 200);
     Glut.glutInitWindowPosition(100, 100);
     Glut.glutCreateWindow("Select");
     Init();
     Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
     Glut.glutKeyboardFunc(new Glut.KeyboardCallback(Keyboard));
     Glut.glutMainLoop();
 }
Ejemplo n.º 18
0
        static void Main(string[] args)
        {
            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_DEPTH);
            Glut.glutInitWindowSize(width, height);
            Glut.glutInitWindowPosition(posX, posY);
            Glut.glutCreateWindow(name);
            Glut.glutIdleFunc(OnRenderFrame);
            Glut.glutDisplayFunc(OnDisplay);

            Glut.glutMainLoop();
        }
Ejemplo n.º 19
0
 public static void Main(string[] args)
 {
     Glut.glutInit();
     Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB);
     Glut.glutInitWindowSize(500, 500);
     Glut.glutInitWindowPosition(100, 100);
     Glut.glutCreateWindow("TexProx");
     Init();
     Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
     Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));
     Glut.glutMainLoop();
 }
Ejemplo n.º 20
0
 public static void Main(string[] args)
 {
     Glut.glutInit();
     Glut.glutInitDisplayMode(Glut.GLUT_RGB | Glut.GLUT_SINGLE);
     Glut.glutInitWindowSize(320, 320);
     Glut.glutInitWindowPosition(50, 50);
     Glut.glutCreateWindow("Area");
     Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
     Glut.glutKeyboardFunc(new Glut.KeyboardCallback(Keyboard));
     Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));
     Glut.glutMainLoop();
 }
Ejemplo n.º 21
0
 public static void Main(string[] args)
 {
     Glut.glutInit();
     Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB);
     Glut.glutInitWindowSize(500, 500);
     Glut.glutInitWindowPosition(100, 100);
     Glut.glutCreateWindow("UnProject");
     Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
     Glut.glutKeyboardFunc(new Glut.KeyboardCallback(Keyboard));
     Glut.glutMouseFunc(new Glut.MouseCallback(Mouse));
     Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));
     Glut.glutMainLoop();
 }
Ejemplo n.º 22
0
 public static void Run()
 {
     Glut.glutInit();
     Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGB);
     Glut.glutInitWindowSize(250, 250);
     Glut.glutInitWindowPosition(100, 100);
     Glut.glutCreateWindow("Double");
     Init();
     Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
     Glut.glutMouseFunc(new Glut.MouseCallback(Mouse));
     Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));
     Glut.glutMainLoop();
 }
Ejemplo n.º 23
0
 public static void Execute()
 {
     Glut.glutInit();
     Glut.glutInitWindowPosition(100, 100);
     Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGBA | Glut.GLUT_DEPTH);
     Glut.glutInitWindowSize(width, height);
     Glut.glutCreateWindow("OpenGL Task1");
     Glut.glutDisplayFunc(RenderWireCube);
     Glut.glutIdleFunc(RenderWireCube);
     Glut.glutSpecialFunc(specialKeys);
     Init();
     Glut.glutMainLoop();
 }
Ejemplo n.º 24
0
 static void Main(string[] args)
 {
     Glut.glutInit();
     Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB);
     Glut.glutInitWindowSize(800, 400);
     Glut.glutInitWindowPosition(100, 100);
     Glut.glutCreateWindow("Sobrevivendo");
     Inicializa();
     Glut.glutDisplayFunc(DesenhaJogo);
     Glut.glutSpecialFunc(Mover);
     Glut.glutTimerFunc(100, Timer, 1);
     Glut.glutMainLoop();
 }
Ejemplo n.º 25
0
 public static void Run()
 {
     Glut.glutInit();
     Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGB);
     Glut.glutInitWindowSize(500, 500);
     Glut.glutInitWindowPosition(100, 100);
     Glut.glutCreateWindow("Planet");
     Init();
     Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
     Glut.glutKeyboardFunc(new Glut.KeyboardCallback(Keyboard));
     Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));
     Glut.glutMainLoop();
 }
Ejemplo n.º 26
0
 public static void Run()
 {
     Glut.glutInit();
     Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB | Glut.GLUT_DEPTH);
     Glut.glutInitWindowSize(256, 256);
     Glut.glutInitWindowPosition(100, 100);
     Glut.glutCreateWindow("TexGen");
     Init();
     Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
     Glut.glutKeyboardFunc(new Glut.KeyboardCallback(Keyboard));
     Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));
     Glut.glutMainLoop();
 }
Ejemplo n.º 27
0
 // --- Entry Point ---
 #region Main(string[] args)
 public static void Main(string[] args)
 {
     Glut.glutInit();
     Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB | Glut.GLUT_DEPTH);
     Glut.glutCreateWindow("Checker");
     Glut.glutInitWindowSize(250, 250);
     Glut.glutInitWindowPosition(100, 100);
     Init();
     Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
     Glut.glutKeyboardFunc(new Glut.KeyboardCallback(Keyboard));
     Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));
     Glut.glutMainLoop();
 }
Ejemplo n.º 28
0
 public static void Run()
 {
     Glut.glutInit();
     Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB);
     Glut.glutInitWindowSize(250, 250);
     Glut.glutInitWindowPosition(100, 100);
     Glut.glutCreateWindow("Image");
     Init();
     Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
     Glut.glutKeyboardFunc(new Glut.KeyboardCallback(Keyboard));
     Glut.glutMotionFunc(new Glut.MotionCallback(Motion));
     Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));
     Glut.glutMainLoop();
 }
Ejemplo n.º 29
0
        public void InitGlSetting(int width, int height, int posX, int posY, string name, int FPS)
        {
            Glut.glutInit();
            Glut.glutInitWindowSize(width, height);  //setting window size
            Glut.glutInitWindowPosition(posX, posY); //setting window position
            Glut.glutCreateWindow(name);             //creating a window with some name
            Gl.glEnable(Gl.GL_TEXTURE_2D);

            this.InitGraphSetting();

            Glut.glutDisplayFunc(Redraw);             //rendering method setting
            Glut.glutTimerFunc(1000 / FPS, Timer, 0); //SET SPEED OF RENDERING HERE
            Glut.glutReshapeFunc(WindowReshape);      //on window reshape method setting
        }
Ejemplo n.º 30
0
        public static void Main(string[] args)
        {
            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGB);
            Glut.glutInitWindowSize(256, 256);
            Glut.glutInitWindowPosition(50, 50);
            Glut.glutCreateWindow("Rotate");

            Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
            Glut.glutIdleFunc(new Glut.IdleCallback(Idle));
            Glut.glutKeyboardFunc(new Glut.KeyboardCallback(Keyboard));
            Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));
            Glut.glutMainLoop();
        }