当前位置: 首页>>代码示例>>C#>>正文


C# FrameEventArgs类代码示例

本文整理汇总了C#中FrameEventArgs的典型用法代码示例。如果您正苦于以下问题:C# FrameEventArgs类的具体用法?C# FrameEventArgs怎么用?C# FrameEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FrameEventArgs类属于命名空间,在下文中一共展示了FrameEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnUpdateFrame

        protected override void OnUpdateFrame(FrameEventArgs e) {
            base.OnUpdateFrame(e);

            if (KeyWasReleased(Key.Tilde)) {
                ToggleConsole();
            }
        }
开发者ID:jyunfan2015,项目名称:Fruitless,代码行数:7,代码来源:DebuggableGameWindow.cs

示例2: GameWindow_RenderFrame

        private void GameWindow_RenderFrame(object sender, FrameEventArgs e)
        {
            GL.Clear(ClearBufferMask.ColorBufferBit);

            //setup blending equation Color = Color_s · alpha + Color_d · (1 - alpha)
            GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
            GL.BlendEquation(BlendEquationMode.FuncAdd);

            GL.Enable(EnableCap.Blend);
            var rect = new Box2D(-.75f, -.75f, .5f, .5f);
            DrawRect(rect, new Color4(.5f, .7f, .1f, 1));
            rect.X += .25f;
            rect.Y += .25f;
            DrawRect(rect, new Color4(.7f, .5f, .9f, .5f));
            rect.X += .25f;
            rect.Y += .25f;
            DrawRect(rect, new Color4(.7f, .5f, .9f, .5f));
            rect.X += .25f;
            rect.Y += .25f;
            DrawRect(rect, new Color4(.5f, .7f, 1, .5f));
            rect.X += .25f;
            rect.Y += .25f;
            DrawRect(rect, new Color4(.5f, .7f, 1, .5f));
            GL.Disable(EnableCap.Blend);
        }
开发者ID:danielscherzer,项目名称:Framework,代码行数:25,代码来源:Program.cs

示例3: OnRenderFrame

        /// <summary>
        /// Called when it is time to render the next frame. Add your rendering code here.
        /// </summary>
        /// <param name="e">Contains timing information.</param>
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);

            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            GL.MatrixMode(MatrixMode.Modelview);
            var look = Matrix4.LookAt(3f, 3f, 2f, 0f, 0f, 0f, 0f, 0f, 1f);
            GL.LoadMatrix(ref look);

            var matrixTranslation = Matrix4.CreateTranslation(_translation);
            var matrixRotationx = Matrix4.CreateRotationX(_rotationx);
            var matrixRotationy = Matrix4.CreateRotationY(_rotationy);
            var matrixRotationz = Matrix4.CreateRotationZ(_rotationz);
            GL.MultMatrix(ref matrixTranslation);
            GL.MultMatrix(ref matrixRotationx);
            GL.MultMatrix(ref matrixRotationy);
            GL.MultMatrix(ref matrixRotationz);

            GL.Begin(BeginMode.Triangles);

            for (var iy = -5; iy < 5; iy++)
            {
                for (var i = -5; i < 5; i++)
                {
                    GL.Color3(1.0f, 1.0f, 0.0f); GL.Vertex3(-0.5f + i, -0.5f + iy, 0f);
                    GL.Color3(1.0f, 0.0f, 0.5f); GL.Vertex3(0.5f + i, -0.5f + iy, 0f);
                    GL.Color3(0.2f, 0.9f, 1.0f); GL.Vertex3(0.0f + i, 0.5f + iy, 0f);
                }
            }

            GL.End();

            SwapBuffers();
        }
开发者ID:andrewmacquarrie,项目名称:TkTwo,代码行数:39,代码来源:Program.cs

示例4: Game_UpdateFrame

 private void Game_UpdateFrame(object sender, FrameEventArgs e)
 {
     if (Game.Keyboard[Key.Escape])
     {
         Game.Exit();
     }
 }
开发者ID:MYheavyGo,项目名称:AoEdit,代码行数:7,代码来源:WindowsRender.cs

示例5: Update

        public void Update(FrameEventArgs e)
        {
            RotationCounter = (RotationCounter + 1) % 360;

            WorldData.Chunks.Update(e);
            GameObjects.GameItems.GameItemDynamic.UpdateAll(e);
        }
开发者ID:MagistrAVSH,项目名称:voxelgame,代码行数:7,代码来源:WorldHost.cs

示例6: gameWnd_RenderFrame

        static void gameWnd_RenderFrame(object sender, FrameEventArgs e)
        {
            game.Render();

            ((GameWindow)sender).SwapBuffers();

            renderWatch.Stop();

            if (renderWatch.Elapsed.TotalSeconds >= stepInterval)
            {
                float elapsed = (float)renderWatch.Elapsed.TotalSeconds;

                game.Tick(elapsed);

                for (float tickTime = 0f; tickTime < elapsed; tickTime += stepInterval)
                {
                    game.TickPhysics(stepInterval);

                    //if (elapsed - tickTime < 0.008f && elapsed - tickTime > 0.005f)
                    //{
                    //    //game.TickPhysics(elapsed - tickTime);
                    //}
                    //else
                    //{

                    //}
                }

                renderWatch.Restart();
            }
            else
            {
                renderWatch.Start();
            }
        }
开发者ID:BaldMan82,项目名称:iGL,代码行数:35,代码来源:Program.cs

示例7: OnRenderFrame

        protected override void OnRenderFrame(FrameEventArgs e)
        {
            // Clear the screen
            GL.ClearColor(Color4.Purple);
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            // Activate shader program and set uniforms
            this.shaderProgram.Use();
            this.projectionMatrix.Set(this.shaderProgram);

            // Bind vertex buffer and array object
            this.vertexBuffer.Bind();
            this.vertexArray.Bind();

            // Upload vertices to GPU and draw them
            this.vertexBuffer.BufferData();
            this.vertexBuffer.Draw();

            // Reset state for potential further draw calls
            GL.BindVertexArray(0);
            GL.BindBuffer(BufferTarget.ArrayBuffer, 0);
            GL.UseProgram(0);

            // Swap backbuffer
            this.SwapBuffers();

            // TODO: Render world
        }
开发者ID:spl33t,项目名称:VoxWorld,代码行数:28,代码来源:GameWindow.cs

示例8: OnRenderFrame

        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);

            _shader.Use();
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            SetupCamera();

            //            _cube.Draw();

            var points = new[] { new Vector2(0, 0), new Vector2(1, 2), new Vector2(-1, 1) };
            var aBezierCurve = new BezierCurve(points);

            GL.LineWidth(4.0f);

            CatmullRomSpline a = new CatmullRomSpline();
            a.AddPoint(new Vector3(-1, -1, 0));
            a.AddPoint(new Vector3(1, 1, 0));
            a.AddPoint(new Vector3(1, -1, 0));
            a.AddPoint(new Vector3(-1, 1, 0));
            a.AddPoint(new Vector3(-1, -1, 0));

            Vector3 vec = a.GetValue((float)_time / 10);
            GL.Translate(vec);

            _cube.Draw();

            SwapBuffers();
        }
开发者ID:henrikno,项目名称:FastIntroFramework,代码行数:30,代码来源:Game.cs

示例9: OnRenderFrame

        /// <summary>
        /// Called when it is time to render the next frame. Add your rendering code here.
        /// </summary>
        /// <param name="e">Contains timing information.</param>
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);
            Matrix4 lookat = Matrix4.LookAt(0, 5, 5, 0, 0, 0, 0, 1, 0);
            GL.MatrixMode(MatrixMode.Modelview);
            GL.LoadMatrix(ref lookat);

            //GL.Rotate(angle, 0.0f, 1.0f, 0.0f);
            //angle += 0.1f;
            //GL.Rotate(this.lookupdown, 1.0f, 0.0f, 0.0f);
            GL.Rotate(360.0f - this.yrot, 0.0f, 1.0f, 0.0f);

            GL.Translate(-this.xpos, -this.walkbias - 0.25f, -this.zpos);

               // GL.Rotate(rotateY + this.drY, -1.0f, 0.0f, 0.0f);
            GL.Rotate(xrot, 0.0f, 0.0f, 1.0f);

            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
            GL.BindTexture(TextureTarget.Texture2D, boxTexture);
            //shapeDraw.rawbox();
            shapeDraw.testBox();
            GL.Translate(2f,0,0);
               // shapeDraw.rawbox();

            SwapBuffers();
        }
开发者ID:leprosarium,项目名称:red-stone-simulator,代码行数:30,代码来源:Program.cs

示例10: OnUpdateFrame

		protected override void OnUpdateFrame(FrameEventArgs e)
        {
            base.OnUpdateFrame(e);
			
            if (Keyboard[Key.Escape])
                Exit();
        }
开发者ID:guozanhua,项目名称:kinectgest,代码行数:7,代码来源:JointVisualizer.cs

示例11: OnRenderFrame

		protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);

            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
			
			float camDistance = 3.0f;
			float scale = 2.0f;
			Vector3 centerPos = new Vector3(0.0f, -1.0f, 0.0f);
			
			// Front
			GL.Viewport(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width / 2, ClientRectangle.Height);
			Rescale();
            Matrix4 modelview = Matrix4.LookAt(new Vector3(0.0f, -1.0f, camDistance), centerPos, Vector3.UnitY);
            GL.MatrixMode(MatrixMode.Modelview);
			GL.LoadIdentity();
            GL.MultMatrix(ref modelview);
			GL.Scale(scale, scale, scale);
			
			RenderJoints();
			
			// Side
			GL.Viewport(ClientRectangle.X + ClientRectangle.Width / 2, ClientRectangle.Y, ClientRectangle.Width / 2, ClientRectangle.Height);
			Rescale();
            modelview = Matrix4.LookAt(new Vector3(camDistance, -1.0f, 0.0f), centerPos, Vector3.UnitY);
            GL.MatrixMode(MatrixMode.Modelview);
			GL.LoadIdentity();
            GL.MultMatrix(ref modelview);
			GL.Scale(scale, scale, scale);
			
			RenderJoints();
			
            SwapBuffers();
        }
开发者ID:guozanhua,项目名称:kinectgest,代码行数:34,代码来源:JointVisualizer.cs

示例12: OnRenderFrame

    protected override void OnRenderFrame(FrameEventArgs e)
    {
        Tick tick = new Tick();
        base.OnRenderFrame(e);

        GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

        GL.MatrixMode(MatrixMode.Modelview);

        m_camera.UpdateCameraView();
        List<CoordinateEngine.RelativisticObject> ros = universe.GetNPCs();
        lock (ros) {
            foreach (CoordinateEngine.RelativisticObject ro in ros) {
                DrawRelativisticObject (ro);
            }
        }
        lock(universe.bro){
            m_camera.camera_position = CoordinateEngine.toVector3(universe.bro.x);//Loses accuracy in this...
        }
        //DrawRelativisticObject(universe.bro, false);//Don't draw bro if the camera is at bro.

        DrawHUD();

        stats.AddValue(FPS_TAG, tick.Tock());

        this.SwapBuffers();
        Thread.Sleep(1);
    }
开发者ID:tstein,项目名称:rope,代码行数:28,代码来源:canvas.cs

示例13: OnRenderFrame

        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame (e);
            //select some bits from a bitmask that represent what we want to clear I guess
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);

            //create a perspective projection
            Matrix4 perspective = Matrix4.CreatePerspectiveFieldOfView(0.9f, ClientRectangle.Width/(float)ClientRectangle.Height, 0.01f, 1000f);
            //tell openGL we want to set the Projection matrix
            GL.MatrixMode(MatrixMode.Projection);
            //set the projection matrix
            GL.LoadMatrix(ref perspective);

            //builds a world space to camera space matrix up is <0,1,0>
            Matrix4 modelview = Matrix4.LookAt(eye, target, Vector3.UnitY);
            //tell openGL we want to set the modelview matrix to this matrix
            GL.MatrixMode(MatrixMode.Modelview);
            //set it
            GL.LoadMatrix(ref modelview);

            //these coords in world space are multiplied by the world space -> camera matrix to provide something we can see
            //so this is where we want the drawing code to go
            Draw(t);

            if (film)
            {
                using (Bitmap b = GrabScreenshot())	{
                    b.Save(String.Format("{0}.bmp", frame_updates++)) ;
                }
            }

            SwapBuffers();
        }
开发者ID:bentles,项目名称:OpenGLTerrain,代码行数:33,代码来源:Program.cs

示例14: OnUpdateFrame

 protected override void OnUpdateFrame(FrameEventArgs e)
 {
     base.OnUpdateFrame(e);
     if (Keyboard[Key.Escape]) {
         Exit();
     }
     if (Keyboard[Key.Q]) {
         p1.Z -= 0.1F;
     }
     if (Keyboard[Key.Z]) {
         p1.Z += 0.1F;
     }
     if (Keyboard[Key.W]) {
         p1.Y -= 0.1F;
     }
     if (Keyboard[Key.S]) {
         p1.Y += 0.1F;
     }
     if (Keyboard[Key.A]) {
         p1.X -= 0.1F;
     }
     if (Keyboard[Key.D]) {
         p1.X += 0.1F;
     }
 }
开发者ID:gaoshoufenmu,项目名称:LearningOpenTK,代码行数:25,代码来源:Program.cs

示例15: OnRenderFrame

        protected override void OnRenderFrame(FrameEventArgs _e)
        {
            m_stopwatch.Restart();
            if (IsActive)
            {
                if (World.TheWorld != null)
                {
                    var avatar = World.TheWorld.Avatar;
                    Title = string.Format("The Hall lc:{0} wc:{1} bld:{2} pmc:{3} fps:{4} per frame, ms:{5}, creatures:{6}",
                                          avatar[0, 0].LiveCoords, avatar[0, 0].WorldCoords, avatar[0, 0].InBuilding,
                                          avatar[0, 0].PathMapCoords, Math.Round(1 / _e.Time), (m_sum / m_cnt),
                                          World.TheWorld.CreatureManager.InfoByCreature.Count);
                }

                m_game.Update(KeyState);
                if (m_needRedraw)
                {
                    m_needRedraw = false;
                    Clear(FColor.Empty);
                    m_game.Draw();
                    OnRenderFinished();
                }
            }
            m_stopwatch.Stop();
            m_sum += m_stopwatch.ElapsedMilliseconds;
            m_cnt++;
            if (m_stopwatch.ElapsedMilliseconds < 1000 / FPS)
            {
                Thread.Sleep(1000 / FPS - (int)m_stopwatch.ElapsedMilliseconds);
            }

        }
开发者ID:Foxbow74,项目名称:my-busycator,代码行数:32,代码来源:TheHallGame.cs


注:本文中的FrameEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。