|
发表于 2011-5-16 17:50:43
|
显示全部楼层
关于旋转我先上图
render部分的代码 ,关于背景色。。第十行的注释。。。另外只是旋转没有缩放,汇报完毕
-
- void Render()
- {
- D3DXMATRIX g_mat;
- D3DXMatrixTransformation2D(&g_mat, NULL, 0.0f, NULL ,
- &D3DXVECTOR2(50.0f, 50.0f), 1.0f, &D3DXVECTOR2(100.0f, 100.0f));//旋转弧度为1
- // Clear the backbuffer to a black color
- g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0 );
- RECT rct = {0,0,512,512};
- //背景白色的那张图 其他都一样,但是 D3DCOLOR_XRGB(0,0,0), 黑变成了 D3DCOLOR_XRGB(255,255,255),白
- // Begin the scene
- if( SUCCEEDED( g_pd3dDevice->BeginScene() ) )
- {
- if ( SUCCEEDED( g_pSprite->Begin(D3DXSPRITE_ALPHABLEND) ) )
- {
- g_pSprite->SetTransform(&g_mat);
- g_pSprite->Draw(g_pTexture, &rct, NULL, &D3DXVECTOR3(0,0,1), 0xffffffff);
- g_pSprite->End();
- }
- g_pd3dDevice->EndScene();
- }
- // Present the backbuffer contents to the display
- g_pd3dDevice->Present( NULL, NULL, NULL, NULL );
- }
-
复制代码
从图上看,确实没有杂色啊 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|