Esempio n. 1
0
        /// <summary>
        /// begin rendering, initializing viewport and projections to the given dimensions
        /// </summary>
        /// <param name="yflipped">Whether the matrices should be Y-flipped, for use with render targets</param>
        public void Begin(int width, int height, bool yflipped = false)
        {
            Begin();

            Projection = Owner.CreateGuiProjectionMatrix(width, height);
            Modelview  = Owner.CreateGuiViewMatrix(width, height);

            if (yflipped)
            {
                //not sure this is the best way to do it. could be done in the view matrix creation
                Modelview.Scale(1, -1);
                Modelview.Translate(0, -height);
            }
            Owner.SetViewport(width, height);
        }
Esempio n. 2
0
		/// <summary>
		/// begin rendering, initializing viewport and projections to the given dimensions
		/// </summary>
		/// <param name="yflipped">Whether the matrices should be Y-flipped, for use with render targets</param>
		public void Begin(int width, int height, bool yflipped = false)
		{
			Begin();

			Projection = Owner.CreateGuiProjectionMatrix(width, height);
			Modelview = Owner.CreateGuiViewMatrix(width, height);

			if (yflipped)
			{
				//not sure this is the best way to do it. could be done in the view matrix creation
				Modelview.Scale(1, -1);
				Modelview.Translate(0, -height);
			}
			Owner.SetViewport(width, height);
		}