Exemple #1
0
        /// <summary>
        /// Инициализация объектов отрисовки, сетки с объектами, текстур и времени
        /// </summary>
        public Form1()
        {
            InitializeComponent();
            Scene.InitializeContexts();
            Il.ilInit();
            Il.ilEnable(Il.IL_ORIGIN_SET);

            Gl.glClearColor(255, 255, 255, 1);
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);

            Gl.glViewport(0, 0, Scene.Width, Scene.Height);

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

            Glu.gluOrtho2D(0.0, Scene.Width, 0.0, Scene.Height);

            Gl.glMatrixMode(Gl.GL_MODELVIEW);

            Gl.glEnable(Gl.GL_BLEND);
            Gl.glBlendFunc(Gl.GL_SRC_ALPHA, Gl.GL_ONE_MINUS_SRC_ALPHA);


            GameRendering.mGlTextureObject0 = GameTextures.loadImage("..\\..\\Pictures\\pr0.bmp");
            GameRendering.mGlTextureObject1 = GameTextures.loadImage("..\\..\\Pictures\\pers0.bmp");
            GameRendering.mGlTextureObject2 = GameTextures.loadImage("..\\..\\Pictures\\pers.bmp");
            GameRendering.mGlTextureObject3 = GameTextures.loadImage("..\\..\\Pictures\\fac.bmp");
            GameRendering.mGlTextureObject4 = GameTextures.loadImage("..\\..\\Pictures\\grassDay.png");
            GameRendering.mGlTextureObject5 = GameTextures.loadImage("..\\..\\Pictures\\grassNight.png");

            g = ArrowBox.CreateGraphics();

            net = new Net();

            Time.Text = "07:00";
            dayTime = DateTime.Parse("07:00");

            // если день = 9, то время вышло
            // на все 1 день 23 часа
            gameTime = new DateTime(2, 1, 11, 23, 0, 0);
            GameTime.Text = gameTime.ToString("yyyy-MM-dd HH':'mm':'ss");

            GameRendering.RenderNet(net, beginRenderNet, Scene, scale, false);
            lastClickNet.X = 1;
            lastClickNet.Y = 1;
            GameRendering.RenderMouseClickAlgorithmPoint(lastClickNet.X, lastClickNet.Y, Textures.CurrentCharactert);
            timer.Start();
        }