XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

How to use SetScissorRect()?

Last post 29/06/2009 15:12 by legalize. 1 replies.
  • 19/05/2009 14:15

    How to use SetScissorRect()?

    Hello.
    I'm trying to cut my text a bit but I can't get SetScissorRect() to work properly. It doesn't do anything for me. I can see whole text on the screen. I'm using it like that:

    //In this example, whole text should be cut because I get rect values using DT_CALCRECT flag and then pass the rect to SetScissorRect()
    m_pSprite->Begin(D3DXSPRITE_ALPHABLEND);
    //a few lines of code that aren't important now
    pFont->DrawText(m_pSprite, logbuf, -1, &rct, DT_CALCRECT, dwColor);
    TitleRect = rct;
    pDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE);
    pDevice->SetScissorRect(&TitleRect);
    pFont->DrawText(m_pSprite, logbuf, -1, &rct, DT_NOCLIP, dwColor);
    pDevice->SetRenderState(D3DRS_SCISSORTESTENABLE , FALSE);
    m_pSprite->End();

    I also tried putting static values into TitleRect, for example like that:
    TitleRect.top = 50; TitleRect.left = 50; TitleRect.bottom = 100; TitleRect.right = 100;
    but I also get no results. SetScissorRect() isn't doing anything.
  • 29/06/2009 15:12 In reply to

    Re: How to use SetScissorRect()?

    Does your device support scissor test?  Look at D3DCAPS9.RasterCaps & D3DPRASTERCAPS_SCISSORTEST
Page 1 of 1 (2 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG