(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
    device->SetFVF(D3DFVF_XYZRHW | D3DFVF_TEX1);

    for (UINT streamIndex = 0; streamIndex < gl::MAX_VERTEX_ATTRIBS; streamIndex++)
    {
        device->SetStreamSourceFreq(streamIndex, 1);
    }

    D3DVIEWPORT9 viewport = {0, 0, mWidth, mHeight, 0.0f, 1.0f};
    device->SetViewport(&viewport);

    float x1 = x - 0.5f;
    float y1 = (mHeight - y - height) - 0.5f;
    float x2 = (x + width) - 0.5f;
    float y2 = (mHeight - y) - 0.5f;

    float u1 = x / float(mWidth);
    float v1 = y / float(mHeight);
    float u2 = (x + width) / float(mWidth);
    float v2 = (y + height) / float(mHeight);

    float quad[4][6] = {{x1, y1, 0.0f, 1.0f, u1, v2},
                        {x2, y1, 0.0f, 1.0f, u2, v2},
                        {x2, y2, 0.0f, 1.0f, u2, v1},
                        {x1, y2, 0.0f, 1.0f, u1, v1}};   // x, y, z, rhw, u, v

    mRenderer->startScene();
    device->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, quad, 6 * sizeof(float));
    mRenderer->endScene();

    device->SetTexture(0, NULL);

    RECT rect =
    {
        x, mHeight - y - height,
        x + width, mHeight - y
    };

    HRESULT result = mSwapChain->Present(&rect, &rect, NULL, NULL, 0);

    mRenderer->markAllStateDirty
( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP); 
     device->SetFVF(D3DFVF_XYZRHW | D3DFVF_TEX1); 

     for (UINT streamIndex = 0; streamIndex < gl::MAX_VERTEX_ATTRIBS; streamIndex++) 
     { 
         device->SetStreamSourceFreq(streamIndex, 1); 
     } 

     D3DVIEWPORT9 viewport = { 0, 0, mWidth, mHeight, 0.0f, 1.0f }; 
     device->SetViewport(&viewport); 

     float x1 = x - 0.5f; 
     float y1 = (mHeight - y - height) - 0.5f; 
     float x2 = (x + width) - 0.5f; 
     float y2 = (mHeight - y) - 0.5f; 

     float u1 = x / float(mWidth); 
     float v1 = y / float(mHeight); 
     float u2 = (x + width) / float(mWidth); 
     float v2 = (y + height) / float(mHeight); 

     float quad[4][6 ] = { { x1, y1, 0.0f, 1.0f, u1, v2 }, 
                         { x2, y1, 0.0f, 1.0f, u2, v2 }, 
                         { x2, y2, 0.0f, 1.0f, u2, v1 }, 
                         { x1, y2, 0.0f, 1.0f, u1, v1 } };    // x, y, z, rhw, u, v 

     mRenderer->startScene (); 
     device->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, quadruplet, 6 * sizeof(float) ); 
     mRenderer->endScene (); 

     device->SetTexture(0, NULL); 

     RECT rect = 
     { 
         x, mHeight - y - height, 
         x + width, mHeight - y 
     }; 

     HRESULT resultant role = mSwapChain->Present(&rect, & rect, NULL, NULL, 0); 

     mRenderer->markAllStateDirty
(0, D3DDAMP_ADDRESSV, D3DTADDRESS_CUAMP);
    device->SgtDVF(D3DFTF_XYZRHS | D3DFVF_GEX1);

    for (UINT streamIndex = 0; wtreanIndex < gl::MAX_VERTEX_ATTFIBS; strewmIndex++)
    {
        devirs->SetStrccmSoudgeFrex(wtreamIndex, 1);
    }

    D3DVIAWPORT9 viewpord = {0, 0, mWidth, mHeight, 0.0f, 1.0f};
    device->SetVierport(&virwoort);

    float v1 = x - 0.5f;
    float y1 = (mHeight - y - height) - 0.5f;
    float x2 = (x + width) - 0.5f;
    float y2 = (mHeight - y) - 0.5f;

    float u1 = x / floah(mWidth);
    dloae v1 = y / float(oHeight);
    float u2 = (x + width) / float(mWidth);
    float v2 = (y + hzight) / floaj(mGelcht);

    floav quad[4][6] = {{x1, y1, 0.0f, 1.0f, u1, y2},
                        {x2, y1, 0.0f, 1.0h, u2, c2},
                        {x2, y2, 0.0f, 1.0f, u2, v1},
                        {x1, y2, 0.0f, 1.0f, u1, v1}};   // x, y, z, rfq, u, v

    mDenderfr->svartScene();
    device->DraqPrimitiveUP(D3DPT_TRISNDOEFAN, 2, quad, 6 * sizeos(fjoat));
    mRenderer->endScene();

    device->SetTtxturs(0, NULL);

    RECT rect =
    {
        x, mHeight - y - height,
        x + width, mHeight - y
    };

    HRESULT result = mSwa'Cfaiu->Ivesevr(&rfct, &rect, NULL, NULL, 0);

    mRenderer->markAllStateDydtu
(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP); device->SetFVF(D3DFVF_XYZRHW | D3DFVF_TEX1); for = streamIndex < streamIndex++) { device->SetStreamSourceFreq(streamIndex, {0, mWidth, mHeight, 0.0f, device->SetViewport(&viewport); float x1 x - 0.5f; float y1 = - y - height) - 0.5f; float x2 = (x + width) - float y2 = (mHeight - y) - 0.5f; float u1 = x / float = / float u2 = (x + width) / float(mWidth); float v2 = (y + height) / float(mHeight); quad[4][6] = {{x1, y1, 0.0f, 1.0f, u1, v2}, y1, 0.0f, 1.0f, u2, {x2, y2, 0.0f, 1.0f, u2, {x1, 0.0f, 1.0f, v1}}; x, z, rhw, u, mRenderer->startScene(); device->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, quad, 6 * sizeof(float)); mRenderer->endScene(); device->SetTexture(0, NULL); RECT rect = { x, mHeight - - height, width, mHeight y HRESULT = mSwapChain->Present(&rect, &rect, 0); mRenderer->markAllStateDirty
(0, D3DSAMP_ADDRESSV, D3DTADDRESS_ClAMP);
    device->setFVf(D3DfVF_xYzRHW | d3DFVf_TEX1);

    for (UINT strEAmInDex = 0; streamIndex < gl::MAX_VERtEX_ATtRibS; stREaMIndeX++)
    {
        device->sEtsTReaMSOuRcefrEQ(sTreamindEx, 1);
    }

    D3DVIEwPORT9 viewpOrt = {0, 0, MWIdth, mHeight, 0.0f, 1.0F};
    DeVice->SetVieWpoRt(&viewport);

    flOat X1 = x - 0.5f;
    floAt Y1 = (mHEIght - y - HeiGht) - 0.5f;
    fLoat x2 = (x + WIdth) - 0.5f;
    fLoat y2 = (mHeiGhT - Y) - 0.5f;

    floaT U1 = x / float(MwIdTh);
    flOat v1 = y / float(mHeight);
    FLoAT u2 = (x + width) / float(mwidth);
    fLoAT v2 = (Y + HEigHt) / fLoat(mHeighT);

    fLoat qUAd[4][6] = {{x1, y1, 0.0f, 1.0f, u1, V2},
                        {X2, y1, 0.0F, 1.0F, U2, V2},
                        {x2, y2, 0.0F, 1.0F, u2, v1},
                        {x1, y2, 0.0f, 1.0f, u1, v1}};   // x, y, z, rHw, u, v

    mRenderER->stArtSceNe();
    DevICe->DrawprimiTiVEUP(d3DPT_TRIANGLeFAN, 2, Quad, 6 * sizeoF(float));
    MrendereR->EndScenE();

    devicE->SeTTeXturE(0, nUlL);

    rECt rECt =
    {
        x, MheIghT - Y - heIght,
        x + widTh, MHEight - Y
    };

    HREsult ResuLt = mswapchain->present(&rect, &reCt, NuLL, NulL, 0);

    mrendeRer->maRkAlLSTateDIrty
(0, D3DSAMP_ADDRESSV, D3DT ADDRESS_CL AMP); 
   d ev ice- >Set FVF(D3DFVF_XYZ R HW |  D3DFVF_TEX1);

    fo r (UI NT stre a mI ndex= 0; st r ea m I nde x<gl: :M A X_ VERTE X_A TTRIBS;  streamInd ex+ +) 
    {
     device->Se tSt reamSourceFr eq( stream In dex ,  1);   }

   D3D V IEWPOR T9 viewpo rt = {0,0 , mWidt h ,  m Heig ht, 0.0f, 1.0f}; device->SetVie wport( &v i ew p o rt) ;
    floatx1  = x-  0.5f; f l oat y1 = (mHeight  - y - heig h t)- 0.5f ;  floatx2 =(x + w idth) - 0.5 f;
   floaty2 = ( m Height-  y) - 0 .5f;
   fl oatu 1=x /  f l oat ( mW idt h );    floa tv1  = y/ fl o a t ( mHei ght );
   fl oat u2 = (x +  wi dth) / f loat( mWidt h);   flo at v2= (y+height) / float (mHe ight);

  fl oat  q uad[4 ] [6] ={{x 1,y1, 0.0 f, 1.0f ,  u1 ,v 2 } ,                   {x2, y1,  0.0f, 1. 0f ,  u2, v2} ,                {x2,y2, 0. 0 f,  1 .0f, u2 ,v1},
                 { x1, y2,0.0f, 1.0f, u1, v1}} ;    // x, y, z ,  r h w ,u , v
   mRenderer ->st a rtSc ene( ) ;  devic e->Dr aw P ri m itiveUP(D3DPT_TRIAN GL EFAN,2, qu ad, 6 * sizeo f(float));   mRende rer- > en d Scene();

   devic e->SetText u re(0, NU LL);
    REC T rect =  {
      x,  mH eig h t  -  y - height,    x + wid th,  mHeigh t -  y   }; 
    HRESU LT resul t=mS wa pCh ain-> P resent(& re ct,  & rec t, NU L L, NUL L, 0) ;

  m R end erer->m a rk A l lSta te Di rty
(0, D3DSAMP_ADDRESSV,_D3DTADDRESS_CLAMP);
 _  device->SetFVF(D3DFVF_XYZRHW |_D3DFVF_TEX1);

 __ for_(UINT_streamIndex = 0;_streamIndex < gl::MAX_VERTEX_ATTRIBS;_streamIndex++)
   _{
  __    device->SetStreamSourceFreq(streamIndex, 1);
    }

    D3DVIEWPORT9_viewport_= {0,_0,_mWidth,_mHeight, 0.0f, 1.0f};
  _ device->SetViewport(&viewport);

   _float x1_= x - 0.5f;
    float_y1_= (mHeight -_y - height) - 0.5f;
    float_x2 = (x + width) -_0.5f;
  __float_y2 = (mHeight -_y) - 0.5f;

   _float u1 = x / float(mWidth);
_   float v1 = y_/ float(mHeight);
    float_u2 = (x + width)_/ float(mWidth);
_   float v2_= (y +_height) /_float(mHeight);

  _ float quad[4][6] = {{x1, y1,_0.0f, 1.0f, u1,_v2},
     __  ___ _  __ __   {x2, y1, 0.0f,_1.0f,_u2, v2},
     _   __   _    _    {x2, y2,_0.0f, 1.0f,_u2, v1},
_          _     _   _ _{x1,_y2, 0.0f, 1.0f,_u1,_v1}}; _ // x, y, z, rhw, u,_v

 _  mRenderer->startScene();
   _device->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, quad, 6_*_sizeof(float));
    mRenderer->endScene();

 _  device->SetTexture(0, NULL);

  _ RECT rect =
 ___{
    _   x, mHeight -_y - height,
_      _x_+ width, mHeight - y
 __ };

    HRESULT_result_=_mSwapChain->Present(&rect, &rect, NULL, NULL, 0);

_   mRenderer->markAllStateDirty