Beispiel #1
0
        protected override void Draw()
        {
            // Render 3D targets.
            glEnable(GL_DEPTH_TEST);
            glEnable(GL_CULL_FACE);
            glDepthFunc(GL_LEQUAL);

            activeLoop.DrawTargets();
            mainTarget.Apply();
            activeLoop.Draw();

            // Render 2D targets.
            glDisable(GL_DEPTH_TEST);
            glDisable(GL_CULL_FACE);
            glDepthFunc(GL_NEVER);

            canvas.DrawTargets(sb);

            // Draw to the main screen.
            glBindFramebuffer(GL_FRAMEBUFFER, 0);
            glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
            glViewport(0, 0, (uint)Resolution.WindowWidth, (uint)Resolution.WindowHeight);

            sb.ApplyTarget(null);
            mainSprite.Draw(sb);
            canvas.Draw(sb);
            sb.Flush();
        }