idTech4.UI.idDeviceContext.DrawStretchPicture C# (CSharp) Method

DrawStretchPicture() public method

public DrawStretchPicture ( float x, float y, float width, float height, float s, float t, float s2, float t2, idMaterial material ) : void
x float
y float
width float
height float
s float
t float
s2 float
t2 float
material idTech4.Renderer.idMaterial
return void
		public void DrawStretchPicture(float x, float y, float width, float height, float s, float t, float s2, float t2, idMaterial material)
		{
			Vertex[] verts = new Vertex[4];
			int[] indexes = new int[6];

			/*indexes[0] = 0;
			indexes[1] = 1;
			indexes[2] = 2;
			indexes[3] = 0;
			indexes[4] = 2;
			indexes[5] = 3;*/
			
			indexes[0] = 3;
			indexes[1] = 0;
			indexes[2] = 2;
			indexes[3] = 2;
			indexes[4] = 0;
			indexes[5] = 1;

			verts[0].Position = new Vector3(x, y, 0);
			verts[0].TextureCoordinates = new Vector2(s, t);
			verts[0].Normal = new Vector3(0, 0, 1);
			/*verts[0].Tangents = new Vector3[] {
				new Vector3(1, 0, 0),
				new Vector3(0, 1, 0)
			};*/

			verts[1].Position = new Vector3(x + width, y, 0);
			verts[1].TextureCoordinates = new Vector2(s2, t);
			verts[1].Normal = new Vector3(0, 0, 1);
			/*verts[1].Tangents = new Vector3[] {
				new Vector3(1, 0, 0),
				new Vector3(0, 1, 0)
			};*/

			verts[2].Position = new Vector3(x + width, y + height, 0);
			verts[2].TextureCoordinates = new Vector2(s2, t2);
			verts[2].Normal = new Vector3(0, 0, 1);
			/*verts[2].Tangents = new Vector3[] {
				new Vector3(1, 0, 0),
				new Vector3(0, 1, 0)
			};*/

			verts[3].Position = new Vector3(x, y + height, 0);
			verts[3].TextureCoordinates = new Vector2(s, t2);
			verts[3].Normal = new Vector3(0, 0, 1);
			/*verts[3].Tangents = new Vector3[] {
				new Vector3(1, 0, 0),
				new Vector3(0, 1, 0)
			};*/

			bool ident = _matrix != Matrix.Identity;

			if(ident == true)
			{
				idConsole.Warning("TODO: IDENT == true");
				/*verts[0].Position -= _origin;
				verts[0].Position *= _matrix.Translation;
				verts[0].Position += _origin;
				verts[1].Position -= _origin;
				verts[1].Position *= _matrix.Translation;
				verts[1].Position += _origin;
				verts[2].Position -= _origin;
				verts[2].Position *= _matrix.Translation;
				verts[2].Position += _origin;
				verts[3].Position -= _origin;
				verts[3].Position *= _matrix.Translation;
				verts[3].Position += _origin;*/
			}

			idE.RenderSystem.DrawStretchPicture(verts.ToArray(), indexes.ToArray(), material, ident);
		}