public static void PushSoftwareViewport(Viewport viewport)
 {
     lock (cachedViewportStack)
     {
         cachedViewportStack.Push(viewport);
     }
 }
 public static void UpdateCurrentViewport()
 {
     GraphicsContext.Assert();
     Viewport viewport = new Viewport();
     GL.GetInteger(GetPName.Viewport, out viewport.X);
     currentViewport = viewport;
 }
 public static void UpdateCurrentViewportFromHardware()
 {
     lock (cachedViewportStack)
     {
         GraphicsContext.Assert();
         Viewport viewport = new Viewport();
         GL.GetInteger(GetPName.Viewport, out viewport.X);
         cachedViewportStack.Pop();
         cachedViewportStack.Push(viewport);
     }
 }
        public static void End()
        {
            GraphicsContext.Assert();

            int current_matrix;
            GL.GetInteger(GetPName.MatrixMode, out current_matrix);

            viewport = viewport_stack.Pop();
            GL.Viewport(viewport.X, viewport.Y, viewport.Width, viewport.Height);

            GL.MatrixMode(MatrixMode.Texture);
            matrix = texture_stack.Pop();
            GL.LoadMatrix(ref matrix);

            GL.MatrixMode(MatrixMode.Modelview);
            matrix = modelview_stack.Pop();
            GL.LoadMatrix(ref matrix);

            GL.MatrixMode(MatrixMode.Projection);
            matrix = projection_stack.Pop();
            GL.LoadMatrix(ref matrix);

            GL.MatrixMode((MatrixMode)current_matrix);
        }
Пример #5
0
 /// <summary>
 /// Use a new viewport. This is more efficient 
 /// than calling ForceViewportRefresh() or InvalidateViewport()
 /// </summary>
 /// <param name="viewport"></param>
 public static void PushSoftwareViewport(Viewport viewport)
 {
     ProjectionStack.PushSoftwareViewport(viewport);
 }
Пример #6
0
 /// <summary>
 /// Use a new viewport. This is more efficient
 /// than calling ForceViewportRefresh() or InvalidateViewport()
 /// </summary>
 /// <param name="viewport"></param>
 public static void PushSoftwareViewport(Viewport viewport)
 {
     ProjectionStack.PushSoftwareViewport(viewport);
 }