コード例 #1
0
ファイル: ArtManager.cs プロジェクト: CadeLaRen/BizHawk
		Art LoadArtInternal(BitmapBuffer tex)
		{
			AssertIsOpen(true);

			Art a = new Art(this);
			ArtLooseTextureAssociation[a] = tex;
			ManagedArts.Add(a);

			return a;
		}
コード例 #2
0
ファイル: GuiRenderer.cs プロジェクト: tunstek/BizHawk
        unsafe void DrawInternal(Art art, float x, float y, float w, float h, bool fx, bool fy)
        {
            //TEST: d3d shouldnt ever use this, it was a gl hack. maybe we can handle it some other way in gl (fix the projection? take a render-to-texture arg to the gui view transforms?)
            fy = false;

            float u0, v0, u1, v1;

            if (fx)
            {
                u0 = art.u1; u1 = art.u0;
            }
            else
            {
                u0 = art.u0; u1 = art.u1;
            }
            if (fy)
            {
                v0 = art.v1; v1 = art.v0;
            }
            else
            {
                v0 = art.v0; v1 = art.v1;
            }

            float[] data = new float[32] {
                x, y, u0, v0, CornerColors[0].R, CornerColors[0].G, CornerColors[0].B, CornerColors[0].A,
                x + art.Width, y, u1, v0, CornerColors[1].R, CornerColors[1].G, CornerColors[1].B, CornerColors[1].A,
                x, y + art.Height, u0, v1, CornerColors[2].R, CornerColors[2].G, CornerColors[2].B, CornerColors[2].A,
                x + art.Width, y + art.Height, u1, v1, CornerColors[3].R, CornerColors[3].G, CornerColors[3].B, CornerColors[3].A,
            };

            Texture2d tex = art.BaseTexture;

            PrepDrawSubrectInternal(tex);

            fixed(float *pData = &data[0])
            {
                Owner.BindArrayData(pData);
                Owner.DrawArrays(PrimitiveType.TriangleStrip, 0, 4);
            }
        }
コード例 #3
0
ファイル: GuiRenderer.cs プロジェクト: stuff2600/RAEmus
        unsafe void DrawInternal(Art art, float x, float y, float w, float h, bool fx, bool fy)
        {
            float u0, v0, u1, v1;

            if (fx)
            {
                u0 = art.u1; u1 = art.u0;
            }
            else
            {
                u0 = art.u0; u1 = art.u1;
            }
            if (fy)
            {
                v0 = art.v1; v1 = art.v0;
            }
            else
            {
                v0 = art.v0; v1 = art.v1;
            }

            float[] data = new float[32] {
                x, y, u0, v0, CornerColors[0].R, CornerColors[0].G, CornerColors[0].B, CornerColors[0].A,
                x + art.Width, y, u1, v0, CornerColors[1].R, CornerColors[1].G, CornerColors[1].B, CornerColors[1].A,
                x, y + art.Height, u0, v1, CornerColors[2].R, CornerColors[2].G, CornerColors[2].B, CornerColors[2].A,
                x + art.Width, y + art.Height, u1, v1, CornerColors[3].R, CornerColors[3].G, CornerColors[3].B, CornerColors[3].A,
            };

            Texture2d tex = art.BaseTexture;

            PrepDrawSubrectInternal(tex);

            fixed(float *pData = &data[0])
            {
                Owner.BindArrayData(pData);
                Owner.DrawArrays(PrimitiveType.TriangleStrip, 0, 4);
            }
        }
コード例 #4
0
ファイル: GuiRenderer.cs プロジェクト: tunstek/BizHawk
 public void DrawFlipped(Art art, bool xflip, bool yflip)
 {
     DrawInternal(art, 0, 0, art.Width, art.Height, xflip, yflip);
 }
コード例 #5
0
ファイル: GuiRenderer.cs プロジェクト: CadeLaRen/BizHawk
		public void DrawFlipped(Art art, bool xflip, bool yflip) { DrawInternal(art, 0, 0, art.Width, art.Height, xflip, yflip); }
コード例 #6
0
ファイル: GuiRenderer.cs プロジェクト: tunstek/BizHawk
 public void Draw(Art art, float x, float y, float width, float height)
 {
     DrawInternal(art, x, y, width, height, false, false);
 }
コード例 #7
0
ファイル: GuiRenderer.cs プロジェクト: tunstek/BizHawk
 public void Draw(Art art, Vector2 pos)
 {
     DrawInternal(art, pos.X, pos.Y, art.Width, art.Height, false, false);
 }
コード例 #8
0
ファイル: GuiRenderer.cs プロジェクト: tunstek/BizHawk
 public void Draw(Art art)
 {
     DrawInternal(art, 0, 0, art.Width, art.Height, false, false);
 }
コード例 #9
0
ファイル: GuiRenderer.cs プロジェクト: tunstek/BizHawk
 public void Draw(Art art, float x, float y)
 {
     DrawInternal(art, x, y, art.Width, art.Height, false, false);
 }
コード例 #10
0
ファイル: GuiRenderer.cs プロジェクト: CadeLaRen/BizHawk
		unsafe void DrawInternal(Texture2d tex, float x, float y, float w, float h)
		{
			Art art = new Art(null);
			art.Width = w;
			art.Height = h;
			art.u0 = art.v0 = 0;
			art.u1 = art.v1 = 1;
			art.BaseTexture = tex;
			DrawInternal(art, x, y, w, h, false, tex.IsUpsideDown);
		}
コード例 #11
0
ファイル: GuiRenderer.cs プロジェクト: CadeLaRen/BizHawk
		unsafe void DrawInternal(Art art, float x, float y, float w, float h, bool fx, bool fy)
		{
			//TEST: d3d shouldnt ever use this, it was a gl hack. maybe we can handle it some other way in gl (fix the projection? take a render-to-texture arg to the gui view transforms?)
			fy = false;

			float u0, v0, u1, v1;
			if (fx) { u0 = art.u1; u1 = art.u0; }
			else { u0 = art.u0; u1 = art.u1; }
			if (fy) { v0 = art.v1; v1 = art.v0; }
			else { v0 = art.v0; v1 = art.v1; }

			float[] data = new float[32] {
			  x,y, u0,v0, CornerColors[0].R, CornerColors[0].G, CornerColors[0].B, CornerColors[0].A,
			  x+art.Width,y, u1,v0, CornerColors[1].R, CornerColors[1].G, CornerColors[1].B, CornerColors[1].A,
			  x,y+art.Height, u0,v1, CornerColors[2].R, CornerColors[2].G, CornerColors[2].B, CornerColors[2].A,
			  x+art.Width,y+art.Height, u1,v1,  CornerColors[3].R, CornerColors[3].G, CornerColors[3].B, CornerColors[3].A,
			};

			Texture2d tex = art.BaseTexture;

			PrepDrawSubrectInternal(tex);

			fixed (float* pData = &data[0])
			{
				Owner.BindArrayData(pData);
				Owner.DrawArrays(PrimitiveType.TriangleStrip, 0, 4);
			}
		}
コード例 #12
0
ファイル: GuiRenderer.cs プロジェクト: CadeLaRen/BizHawk
		public void Draw(Art art, Vector2 pos) { DrawInternal(art, pos.X, pos.Y, art.Width, art.Height, false, false); }
コード例 #13
0
 unsafe void DrawInternal(Art art, float x, float y, float w, float h)
 {
     DrawInternal(art.BaseTexture, x, y, w, h, art.u0, art.v0, art.u1, art.v1);
 }
コード例 #14
0
ファイル: GuiRenderer.cs プロジェクト: CadeLaRen/BizHawk
		public void Draw(Art art, float x, float y, float width, float height) { DrawInternal(art, x, y, width, height, false, false); }
コード例 #15
0
ファイル: GuiRenderer.cs プロジェクト: CadeLaRen/BizHawk
		public void Draw(Art art, float x, float y) { DrawInternal(art, x, y, art.Width, art.Height, false, false); }
コード例 #16
0
ファイル: GuiRenderer.cs プロジェクト: CadeLaRen/BizHawk
		public void Draw(Art art) { DrawInternal(art, 0, 0, art.Width, art.Height, false, false); }
コード例 #17
0
ファイル: GuiRenderer.cs プロジェクト: cas1993per/bizhawk
        unsafe void DrawInternal(Art art, float x, float y, float w, float h, bool fx, bool fy)
        {
            float u0,v0,u1,v1;
            if(fx) { u0 = art.u1; u1 = art.u0; }
            else { u0 = art.u0; u1 = art.u1; }
            if(fy) { v0 = art.v1; v1 = art.v0; }
            else { v0 = art.v0; v1 = art.v1; }

            float[] data = new float[32] {
              x,y, u0,v0, CornerColors[0].R, CornerColors[0].G, CornerColors[0].B, CornerColors[0].A,
              x+art.Width,y, u1,v0, CornerColors[1].R, CornerColors[1].G, CornerColors[1].B, CornerColors[1].A,
              x,y+art.Height, u0,v1, CornerColors[2].R, CornerColors[2].G, CornerColors[2].B, CornerColors[2].A,
              x+art.Width,y+art.Height, u1,v1,  CornerColors[3].R, CornerColors[3].G, CornerColors[3].B, CornerColors[3].A,
            };

            Texture2d tex = art.BaseTexture;

            PrepDrawSubrectInternal(tex);

            fixed (float* pData = &data[0])
            {
                Owner.BindArrayData(pData);
                Owner.DrawArrays(PrimitiveType.TriangleStrip, 0, 4);
            }
        }
コード例 #18
0
 unsafe void DrawInternal(Art art, float x, float y, float w, float h, bool fx, bool fy)
 {
 }