游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1082|回复: 0

视口方面的程序问题!

[复制链接]

29

主题

56

帖子

56

积分

注册会员

Rank: 2

积分
56
发表于 2007-10-25 17:10:00 | 显示全部楼层 |阅读模式
小弟在右下角开了一个小视口,不知为什么运行程序时不见了,肯定是程序写的有问题,请各位高手指教!不胜感谢!
Device->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0);
Device->BeginScene();
…………
draw other objects
…………
//another viewport
        D3DVIEWPORT9 vpp;//initialize the viewport
        D3DVIEWPORT9 viewData = { 576, 432, 64, 48, 0.0f, 1.0f };
                Device->GetViewport(&vpp);
                Device->SetViewport(&viewData);

                      //draw 2 triangles
                Device->SetStreamSource(0, Triangle, 0, sizeof(Vertex));
                Device->SetFVF(Vertex::FVF);
        Device->SetTransform(D3DTS_WORLD, &ObjWorldMatrices[1]);
        Device->SetTexture(0, Tex[1]);
                Device->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 2);
                Device->SetViewport(&vpp);

                Device->EndScene();
                Device-&gtresent(0, 0, 0, 0);
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2025-6-19 23:47

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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