游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2085|回复: 3

问一个D3DSurface8的copyrects问题,有了解过的进来帮忙~谢~

[复制链接]

7

主题

19

帖子

19

积分

新手上路

Rank: 1

积分
19
发表于 2006-4-3 20:57:00 | 显示全部楼层 |阅读模式

我用了一个D3DSurface8来copy到BackSuface,但不能显示,郁闷中,了解过的朋友指点一二,谢谢先~
下边是拷贝部分代码。

......
......
        g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,255), 1.0f, 0 );

        // Begin the scene
        g_pd3dDevice->BeginScene();

        LPDIRECT3DSURFACE8 pBackBuffer;
        //;
        if(FAILED(g_pd3dDevice->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer)))
        {
                MessageBox(NULL, "fadfasdf", "", MB_OK);
        }

        RECT        rtTemp = { 0, 0, 200, 200};
        POINT        ptDst = { 0, 0};

        g_pd3dDevice->CopyRects(g_pSurface, &rtTemp, 1, pBackBuffer, &ptDst);
        pBackBuffer->Release();

        // End the scene
        g_pd3dDevice->EndScene();
        // Present the backbuffer contents to the display
        g_pd3dDevice-&gtresent( NULL, NULL, NULL, NULL );
.....
.....

其中,suface是正常的

125

主题

364

帖子

396

积分

中级会员

Rank: 3Rank: 3

积分
396
QQ
发表于 2006-4-4 00:07:00 | 显示全部楼层

Re:问一个D3DSurface8的copyrects问题,有了解过的进来帮忙~

关注中

38

主题

275

帖子

281

积分

中级会员

Rank: 3Rank: 3

积分
281
QQ
发表于 2006-4-11 10:34:00 | 显示全部楼层

Re:问一个D3DSurface8的copyrects问题,有了解过的进来帮忙~

  Yeah~~I have got the same error~ And the error code thar CopyRests return is D3DERR_INVALIDCALL. I have checked all of the parameters , I am a beginner of the D3D8~Pay attention too~~
  Who can help us?

38

主题

275

帖子

281

积分

中级会员

Rank: 3Rank: 3

积分
281
QQ
发表于 2006-4-11 15:59:00 | 显示全部楼层

Re:问一个D3DSurface8的copyrects问题,有了解过的进来帮忙~

  Yes,I have got the correct the answer and the reson why it did not work correctly.

I will talk about how I do it. (Maybe it is not suit for your program), I got the error code --
D3DERR_INVALIDCALL.So there must be some parameters that I have passed to the method CopyRects were not correct. And finally ,yeah ,I have created a window that 640*480,but in face the client area is 635*449 .(Maybe  your window program is not the size). And the RECT that passed to the CopyRescts is 640*480,and CopyRects method does not support stretch, color key, alpha blend, format conversion, or clipping of either source or destination rectangles.
  So ,the parameter RECT is not available-----That is why I made the miatake.
  I hope this infomation  can help you .
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-24 04:09

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表