Exemple #1
0
        // A cada frame é chamado depois do OnUpdateFrame, aqui é desenhado a cena.
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            GL.ClearColor(0.2f, 0.3f, 0.3f, 1.0f);
            GL.Enable(EnableCap.DepthTest);
            GL.DepthFunc(DepthFunction.Less);
            GL.DepthMask(true);
            GL.DepthRange(scene._camera._near, scene._camera._far);

            // Executando o postprocessing caso a tecla P tenha sido apertada no último frame
            if (executepostProcessing)
            {
                postProcessing.preparePostProcessing();
            }
            GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
            // Desenhando a cena.
            scene.Draw();

            // Desenhando o skybox
            skybox.Draw(scene._camera);

            // Executando o postprocessing caso a tecla P tenha sido apertada no último frame
            if (executepostProcessing)
            {
                postProcessing.executePostProcessing();
            }

            Context.SwapBuffers();
            base.OnRenderFrame(e);
        }